diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManagementClient.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManagementClient.java new file mode 100644 index 000000000000..473889a72080 --- /dev/null +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManagementClient.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.management.compute; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.util.logging.ClientLogger; +import com.azure.management.AzureServiceClient; +import com.azure.management.compute.fluent.AvailabilitySetsClient; +import com.azure.management.compute.fluent.ContainerServicesClient; +import com.azure.management.compute.fluent.DedicatedHostGroupsClient; +import com.azure.management.compute.fluent.DedicatedHostsClient; +import com.azure.management.compute.fluent.DiskEncryptionSetsClient; +import com.azure.management.compute.fluent.DisksClient; +import com.azure.management.compute.fluent.GalleriesClient; +import com.azure.management.compute.fluent.GalleryApplicationVersionsClient; +import com.azure.management.compute.fluent.GalleryApplicationsClient; +import com.azure.management.compute.fluent.GalleryImageVersionsClient; +import com.azure.management.compute.fluent.GalleryImagesClient; +import com.azure.management.compute.fluent.ImagesClient; +import com.azure.management.compute.fluent.LogAnalyticsClient; +import com.azure.management.compute.fluent.OperationsClient; +import com.azure.management.compute.fluent.ProximityPlacementGroupsClient; +import com.azure.management.compute.fluent.ResourceSkusClient; +import com.azure.management.compute.fluent.SnapshotsClient; +import com.azure.management.compute.fluent.UsagesClient; +import com.azure.management.compute.fluent.VirtualMachineExtensionImagesClient; +import com.azure.management.compute.fluent.VirtualMachineExtensionsClient; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; +import com.azure.management.compute.fluent.VirtualMachineRunCommandsClient; +import com.azure.management.compute.fluent.VirtualMachineScaleSetExtensionsClient; +import com.azure.management.compute.fluent.VirtualMachineScaleSetRollingUpgradesClient; +import com.azure.management.compute.fluent.VirtualMachineScaleSetVMsClient; +import com.azure.management.compute.fluent.VirtualMachineScaleSetsClient; +import com.azure.management.compute.fluent.VirtualMachineSizesClient; +import com.azure.management.compute.fluent.VirtualMachinesClient; + +/** Initializes a new instance of the ComputeManagementClient type. */ +@ServiceClient(builder = ComputeManagementClientBuilder.class) +public final class ComputeManagementClient extends AzureServiceClient { + private final ClientLogger logger = new ClientLogger(ComputeManagementClient.class); + + /** + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The AvailabilitySetsClient object to access its operations. */ + private final AvailabilitySetsClient availabilitySets; + + /** + * Gets the AvailabilitySetsClient object to access its operations. + * + * @return the AvailabilitySetsClient object. + */ + public AvailabilitySetsClient getAvailabilitySets() { + return this.availabilitySets; + } + + /** The ProximityPlacementGroupsClient object to access its operations. */ + private final ProximityPlacementGroupsClient proximityPlacementGroups; + + /** + * Gets the ProximityPlacementGroupsClient object to access its operations. + * + * @return the ProximityPlacementGroupsClient object. + */ + public ProximityPlacementGroupsClient getProximityPlacementGroups() { + return this.proximityPlacementGroups; + } + + /** The DedicatedHostGroupsClient object to access its operations. */ + private final DedicatedHostGroupsClient dedicatedHostGroups; + + /** + * Gets the DedicatedHostGroupsClient object to access its operations. + * + * @return the DedicatedHostGroupsClient object. + */ + public DedicatedHostGroupsClient getDedicatedHostGroups() { + return this.dedicatedHostGroups; + } + + /** The DedicatedHostsClient object to access its operations. */ + private final DedicatedHostsClient dedicatedHosts; + + /** + * Gets the DedicatedHostsClient object to access its operations. + * + * @return the DedicatedHostsClient object. + */ + public DedicatedHostsClient getDedicatedHosts() { + return this.dedicatedHosts; + } + + /** The VirtualMachineExtensionImagesClient object to access its operations. */ + private final VirtualMachineExtensionImagesClient virtualMachineExtensionImages; + + /** + * Gets the VirtualMachineExtensionImagesClient object to access its operations. + * + * @return the VirtualMachineExtensionImagesClient object. + */ + public VirtualMachineExtensionImagesClient getVirtualMachineExtensionImages() { + return this.virtualMachineExtensionImages; + } + + /** The VirtualMachineExtensionsClient object to access its operations. */ + private final VirtualMachineExtensionsClient virtualMachineExtensions; + + /** + * Gets the VirtualMachineExtensionsClient object to access its operations. + * + * @return the VirtualMachineExtensionsClient object. + */ + public VirtualMachineExtensionsClient getVirtualMachineExtensions() { + return this.virtualMachineExtensions; + } + + /** The VirtualMachineImagesClient object to access its operations. */ + private final VirtualMachineImagesClient virtualMachineImages; + + /** + * Gets the VirtualMachineImagesClient object to access its operations. + * + * @return the VirtualMachineImagesClient object. + */ + public VirtualMachineImagesClient getVirtualMachineImages() { + return this.virtualMachineImages; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** 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 VirtualMachineSizesClient object to access its operations. */ + private final VirtualMachineSizesClient virtualMachineSizes; + + /** + * Gets the VirtualMachineSizesClient object to access its operations. + * + * @return the VirtualMachineSizesClient object. + */ + public VirtualMachineSizesClient getVirtualMachineSizes() { + return this.virtualMachineSizes; + } + + /** The ImagesClient object to access its operations. */ + private final ImagesClient images; + + /** + * Gets the ImagesClient object to access its operations. + * + * @return the ImagesClient object. + */ + public ImagesClient getImages() { + return this.images; + } + + /** The VirtualMachineScaleSetsClient object to access its operations. */ + private final VirtualMachineScaleSetsClient virtualMachineScaleSets; + + /** + * Gets the VirtualMachineScaleSetsClient object to access its operations. + * + * @return the VirtualMachineScaleSetsClient object. + */ + public VirtualMachineScaleSetsClient getVirtualMachineScaleSets() { + return this.virtualMachineScaleSets; + } + + /** The VirtualMachineScaleSetExtensionsClient object to access its operations. */ + private final VirtualMachineScaleSetExtensionsClient virtualMachineScaleSetExtensions; + + /** + * Gets the VirtualMachineScaleSetExtensionsClient object to access its operations. + * + * @return the VirtualMachineScaleSetExtensionsClient object. + */ + public VirtualMachineScaleSetExtensionsClient getVirtualMachineScaleSetExtensions() { + return this.virtualMachineScaleSetExtensions; + } + + /** The VirtualMachineScaleSetRollingUpgradesClient object to access its operations. */ + private final VirtualMachineScaleSetRollingUpgradesClient virtualMachineScaleSetRollingUpgrades; + + /** + * Gets the VirtualMachineScaleSetRollingUpgradesClient object to access its operations. + * + * @return the VirtualMachineScaleSetRollingUpgradesClient object. + */ + public VirtualMachineScaleSetRollingUpgradesClient getVirtualMachineScaleSetRollingUpgrades() { + return this.virtualMachineScaleSetRollingUpgrades; + } + + /** The VirtualMachineScaleSetVMsClient object to access its operations. */ + private final VirtualMachineScaleSetVMsClient virtualMachineScaleSetVMs; + + /** + * Gets the VirtualMachineScaleSetVMsClient object to access its operations. + * + * @return the VirtualMachineScaleSetVMsClient object. + */ + public VirtualMachineScaleSetVMsClient getVirtualMachineScaleSetVMs() { + return this.virtualMachineScaleSetVMs; + } + + /** The LogAnalyticsClient object to access its operations. */ + private final LogAnalyticsClient logAnalytics; + + /** + * Gets the LogAnalyticsClient object to access its operations. + * + * @return the LogAnalyticsClient object. + */ + public LogAnalyticsClient getLogAnalytics() { + return this.logAnalytics; + } + + /** The VirtualMachineRunCommandsClient object to access its operations. */ + private final VirtualMachineRunCommandsClient virtualMachineRunCommands; + + /** + * Gets the VirtualMachineRunCommandsClient object to access its operations. + * + * @return the VirtualMachineRunCommandsClient object. + */ + public VirtualMachineRunCommandsClient getVirtualMachineRunCommands() { + return this.virtualMachineRunCommands; + } + + /** The ResourceSkusClient object to access its operations. */ + private final ResourceSkusClient resourceSkus; + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + public ResourceSkusClient getResourceSkus() { + return this.resourceSkus; + } + + /** The DisksClient object to access its operations. */ + private final DisksClient disks; + + /** + * Gets the DisksClient object to access its operations. + * + * @return the DisksClient object. + */ + public DisksClient getDisks() { + return this.disks; + } + + /** The SnapshotsClient object to access its operations. */ + private final SnapshotsClient snapshots; + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + public SnapshotsClient getSnapshots() { + return this.snapshots; + } + + /** The DiskEncryptionSetsClient object to access its operations. */ + private final DiskEncryptionSetsClient diskEncryptionSets; + + /** + * Gets the DiskEncryptionSetsClient object to access its operations. + * + * @return the DiskEncryptionSetsClient object. + */ + public DiskEncryptionSetsClient getDiskEncryptionSets() { + return this.diskEncryptionSets; + } + + /** The GalleriesClient object to access its operations. */ + private final GalleriesClient galleries; + + /** + * Gets the GalleriesClient object to access its operations. + * + * @return the GalleriesClient object. + */ + public GalleriesClient getGalleries() { + return this.galleries; + } + + /** The GalleryImagesClient object to access its operations. */ + private final GalleryImagesClient galleryImages; + + /** + * Gets the GalleryImagesClient object to access its operations. + * + * @return the GalleryImagesClient object. + */ + public GalleryImagesClient getGalleryImages() { + return this.galleryImages; + } + + /** The GalleryImageVersionsClient object to access its operations. */ + private final GalleryImageVersionsClient galleryImageVersions; + + /** + * Gets the GalleryImageVersionsClient object to access its operations. + * + * @return the GalleryImageVersionsClient object. + */ + public GalleryImageVersionsClient getGalleryImageVersions() { + return this.galleryImageVersions; + } + + /** The GalleryApplicationsClient object to access its operations. */ + private final GalleryApplicationsClient galleryApplications; + + /** + * Gets the GalleryApplicationsClient object to access its operations. + * + * @return the GalleryApplicationsClient object. + */ + public GalleryApplicationsClient getGalleryApplications() { + return this.galleryApplications; + } + + /** The GalleryApplicationVersionsClient object to access its operations. */ + private final GalleryApplicationVersionsClient galleryApplicationVersions; + + /** + * Gets the GalleryApplicationVersionsClient object to access its operations. + * + * @return the GalleryApplicationVersionsClient object. + */ + public GalleryApplicationVersionsClient getGalleryApplicationVersions() { + return this.galleryApplicationVersions; + } + + /** The ContainerServicesClient object to access its operations. */ + private final ContainerServicesClient containerServices; + + /** + * Gets the ContainerServicesClient object to access its operations. + * + * @return the ContainerServicesClient object. + */ + public ContainerServicesClient getContainerServices() { + return this.containerServices; + } + + /** + * Initializes an instance of ComputeManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param environment The Azure environment. + */ + ComputeManagementClient( + HttpPipeline httpPipeline, AzureEnvironment environment, String subscriptionId, String endpoint) { + super(httpPipeline, environment); + this.httpPipeline = httpPipeline; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.operations = new OperationsClient(this); + this.availabilitySets = new AvailabilitySetsClient(this); + this.proximityPlacementGroups = new ProximityPlacementGroupsClient(this); + this.dedicatedHostGroups = new DedicatedHostGroupsClient(this); + this.dedicatedHosts = new DedicatedHostsClient(this); + this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesClient(this); + this.virtualMachineExtensions = new VirtualMachineExtensionsClient(this); + this.virtualMachineImages = new VirtualMachineImagesClient(this); + this.usages = new UsagesClient(this); + this.virtualMachines = new VirtualMachinesClient(this); + this.virtualMachineSizes = new VirtualMachineSizesClient(this); + this.images = new ImagesClient(this); + this.virtualMachineScaleSets = new VirtualMachineScaleSetsClient(this); + this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsClient(this); + this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesClient(this); + this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsClient(this); + this.logAnalytics = new LogAnalyticsClient(this); + this.virtualMachineRunCommands = new VirtualMachineRunCommandsClient(this); + this.resourceSkus = new ResourceSkusClient(this); + this.disks = new DisksClient(this); + this.snapshots = new SnapshotsClient(this); + this.diskEncryptionSets = new DiskEncryptionSetsClient(this); + this.galleries = new GalleriesClient(this); + this.galleryImages = new GalleryImagesClient(this); + this.galleryImageVersions = new GalleryImageVersionsClient(this); + this.galleryApplications = new GalleryApplicationsClient(this); + this.galleryApplicationVersions = new GalleryApplicationVersionsClient(this); + this.containerServices = new ContainerServicesClient(this); + } +} diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeManagementClientBuilder.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManagementClientBuilder.java similarity index 77% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeManagementClientBuilder.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManagementClientBuilder.java index fdd46448cb7f..0c1b97653159 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeManagementClientBuilder.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManagementClientBuilder.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; @@ -12,8 +12,8 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; -/** A builder for creating a new instance of the ComputeManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ComputeManagementClientImpl.class}) +/** A builder for creating a new instance of the ComputeManagementClient type. */ +@ServiceClientBuilder(serviceClients = {ComputeManagementClient.class}) public final class ComputeManagementClientBuilder { /* * Subscription credentials which uniquely identify Microsoft Azure @@ -37,16 +37,16 @@ public ComputeManagementClientBuilder subscriptionId(String subscriptionId) { /* * server parameter */ - private String host; + private String endpoint; /** * Sets server parameter. * - * @param host the host value. + * @param endpoint the endpoint value. * @return the ComputeManagementClientBuilder. */ - public ComputeManagementClientBuilder host(String host) { - this.host = host; + public ComputeManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } @@ -83,13 +83,13 @@ public ComputeManagementClientBuilder pipeline(HttpPipeline pipeline) { } /** - * Builds an instance of ComputeManagementClientImpl with the provided parameters. + * Builds an instance of ComputeManagementClient with the provided parameters. * - * @return an instance of ComputeManagementClientImpl. + * @return an instance of ComputeManagementClient. */ - public ComputeManagementClientImpl buildClient() { - if (host == null) { - this.host = "https://management.azure.com"; + public ComputeManagementClient buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; } if (environment == null) { this.environment = AzureEnvironment.AZURE; @@ -100,9 +100,7 @@ public ComputeManagementClientImpl buildClient() { .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) .build(); } - ComputeManagementClientImpl client = new ComputeManagementClientImpl(pipeline, environment); - client.setSubscriptionId(this.subscriptionId); - client.setHost(this.host); + ComputeManagementClient client = new ComputeManagementClient(pipeline, environment, subscriptionId, endpoint); return client; } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeManager.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManager.java similarity index 78% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeManager.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManager.java index e489f70e144c..9a579c798ab5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeManager.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeManager.java @@ -1,25 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute.implementation; +package com.azure.management.compute; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpPipeline; -import com.azure.management.compute.AvailabilitySets; -import com.azure.management.compute.ComputeSkus; -import com.azure.management.compute.ComputeUsages; -import com.azure.management.compute.Disks; -import com.azure.management.compute.Galleries; -import com.azure.management.compute.GalleryImageVersions; -import com.azure.management.compute.GalleryImages; -import com.azure.management.compute.Snapshots; -import com.azure.management.compute.VirtualMachineCustomImages; -import com.azure.management.compute.VirtualMachineExtensionImages; -import com.azure.management.compute.VirtualMachineImages; -import com.azure.management.compute.VirtualMachineScaleSets; -import com.azure.management.compute.VirtualMachines; -import com.azure.management.compute.models.ComputeManagementClientBuilder; -import com.azure.management.compute.models.ComputeManagementClientImpl; +import com.azure.management.compute.implementation.AvailabilitySetsImpl; +import com.azure.management.compute.implementation.ComputeSkusImpl; +import com.azure.management.compute.implementation.ComputeUsagesImpl; +import com.azure.management.compute.implementation.DisksImpl; +import com.azure.management.compute.implementation.GalleriesImpl; +import com.azure.management.compute.implementation.GalleryImageVersionsImpl; +import com.azure.management.compute.implementation.GalleryImagesImpl; +import com.azure.management.compute.implementation.SnapshotsImpl; +import com.azure.management.compute.implementation.VirtualMachineCustomImagesImpl; +import com.azure.management.compute.implementation.VirtualMachineExtensionImagesImpl; +import com.azure.management.compute.implementation.VirtualMachineImagesImpl; +import com.azure.management.compute.implementation.VirtualMachinePublishersImpl; +import com.azure.management.compute.implementation.VirtualMachineScaleSetsImpl; +import com.azure.management.compute.implementation.VirtualMachinesImpl; +import com.azure.management.compute.models.AvailabilitySets; +import com.azure.management.compute.models.ComputeSkus; +import com.azure.management.compute.models.ComputeUsages; +import com.azure.management.compute.models.Disks; +import com.azure.management.compute.models.Galleries; +import com.azure.management.compute.models.GalleryImageVersions; +import com.azure.management.compute.models.GalleryImages; +import com.azure.management.compute.models.Snapshots; +import com.azure.management.compute.models.VirtualMachineCustomImages; +import com.azure.management.compute.models.VirtualMachineExtensionImages; +import com.azure.management.compute.models.VirtualMachineImages; +import com.azure.management.compute.models.VirtualMachineScaleSets; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.network.implementation.NetworkManager; import com.azure.management.resources.fluentcore.arm.AzureConfigurable; @@ -31,11 +43,11 @@ import com.azure.management.storage.StorageManager; /** Entry point to Azure compute resource management. */ -public final class ComputeManager extends Manager { +public final class ComputeManager extends Manager { // The service managers - private StorageManager storageManager; - private NetworkManager networkManager; - private GraphRbacManager rbacManager; + private final StorageManager storageManager; + private final NetworkManager networkManager; + private final GraphRbacManager rbacManager; // The collections private AvailabilitySets availabilitySets; @@ -151,9 +163,9 @@ public VirtualMachineImages virtualMachineImages() { virtualMachineImages = new VirtualMachineImagesImpl( new VirtualMachinePublishersImpl( - super.innerManagementClient.virtualMachineImages(), - super.innerManagementClient.virtualMachineExtensionImages()), - super.innerManagementClient.virtualMachineImages()); + super.innerManagementClient.getVirtualMachineImages(), + super.innerManagementClient.getVirtualMachineExtensionImages()), + super.innerManagementClient.getVirtualMachineImages()); } return virtualMachineImages; } @@ -164,8 +176,8 @@ public VirtualMachineExtensionImages virtualMachineExtensionImages() { virtualMachineExtensionImages = new VirtualMachineExtensionImagesImpl( new VirtualMachinePublishersImpl( - super.innerManagementClient.virtualMachineImages(), - super.innerManagementClient.virtualMachineExtensionImages())); + super.innerManagementClient.getVirtualMachineImages(), + super.innerManagementClient.getVirtualMachineExtensionImages())); } return virtualMachineExtensionImages; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/AvailabilitySetsClient.java similarity index 75% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/AvailabilitySetsClient.java index de81540447f5..1c3f94574466 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/AvailabilitySetsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,36 +25,40 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AvailabilitySetUpdate; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.AvailabilitySetInner; +import com.azure.management.compute.fluent.inner.AvailabilitySetListResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeInner; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeListResultInner; +import com.azure.management.compute.models.AvailabilitySetUpdate; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in AvailabilitySets. */ -public final class AvailabilitySetsInner +public final class AvailabilitySetsClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(AvailabilitySetsInner.class); + private final ClientLogger logger = new ClientLogger(AvailabilitySetsClient.class); /** The proxy service used to perform REST calls. */ private final AvailabilitySetsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of AvailabilitySetsInner. + * Initializes an instance of AvailabilitySetsClient. * * @param client the instance of the service client containing this operation class. */ - AvailabilitySetsInner(ComputeManagementClientImpl client) { + public AvailabilitySetsClient(ComputeManagementClient client) { this.service = RestProxy.create(AvailabilitySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -73,8 +77,8 @@ private interface AvailabilitySetsService { + "/availabilitySets/{availabilitySetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String host, + Mono> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("availabilitySetName") String availabilitySetName, @QueryParam("api-version") String apiVersion, @@ -88,8 +92,8 @@ Mono> createOrUpdate( + "/availabilitySets/{availabilitySetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String host, + Mono> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("availabilitySetName") String availabilitySetName, @QueryParam("api-version") String apiVersion, @@ -104,7 +108,7 @@ Mono> update( @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( - @HostParam("$host") String host, + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("availabilitySetName") String availabilitySetName, @QueryParam("api-version") String apiVersion, @@ -117,8 +121,8 @@ Mono> delete( + "/availabilitySets/{availabilitySetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("availabilitySetName") String availabilitySetName, @QueryParam("api-version") String apiVersion, @@ -129,8 +133,8 @@ Mono> getByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, @@ -142,8 +146,8 @@ Mono> list( + "/availabilitySets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -155,8 +159,8 @@ Mono> listByResourceGroup( + "/availabilitySets/{availabilitySetName}/vmSizes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableSizes( - @HostParam("$host") String host, + Mono> listAvailableSizes( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("availabilitySetName") String availabilitySetName, @QueryParam("api-version") String apiVersion, @@ -167,14 +171,14 @@ Mono> listAvailableSizes( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -198,11 +202,13 @@ Mono> listNext( * @return specifies information about the availability set that the virtual machine should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( + public Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -229,7 +235,7 @@ public Mono> createOrUpdateWithResponseAsyn context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -260,11 +266,13 @@ public Mono> createOrUpdateWithResponseAsyn * @return specifies information about the availability set that the virtual machine should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( + public Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -288,7 +296,7 @@ public Mono> createOrUpdateWithResponseAsyn final String apiVersion = "2019-03-01"; return service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -321,7 +329,41 @@ public Mono createOrUpdateAsync( String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Specifies information about the availability set that the virtual machine should be assigned + * to. Virtual machines specified in the same availability set are allocated to different nodes to maximize + * availability. For more information about availability sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM + * cannot be added to an availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, parameters, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -355,6 +397,32 @@ public AvailabilitySetInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, availabilitySetName, parameters).block(); } + /** + * Create or update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Specifies information about the availability set that the virtual machine should be assigned + * to. Virtual machines specified in the same availability set are allocated to different nodes to maximize + * availability. For more information about availability sets, see [Manage the availability of virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). + * <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual + * machines in + * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) + * <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM + * cannot be added to an availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilitySetInner createOrUpdate( + String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, availabilitySetName, parameters, context).block(); + } + /** * Update an availability set. * @@ -368,11 +436,13 @@ public AvailabilitySetInner createOrUpdate( * @return specifies information about the availability set that the virtual machine should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( + public Mono> updateWithResponseAsync( String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -399,7 +469,7 @@ public Mono> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -423,11 +493,13 @@ public Mono> updateWithResponseAsync( * @return specifies information about the availability set that the virtual machine should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( + public Mono> updateWithResponseAsync( String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -451,7 +523,7 @@ public Mono> updateWithResponseAsync( final String apiVersion = "2019-03-01"; return service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -477,7 +549,34 @@ public Mono updateAsync( String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters) { return updateWithResponseAsync(resourceGroupName, availabilitySetName, parameters) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Specifies information about the availability set that the virtual machine should be assigned + * to. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, availabilitySetName, parameters, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -504,6 +603,25 @@ public AvailabilitySetInner update( return updateAsync(resourceGroupName, availabilitySetName, parameters).block(); } + /** + * Update an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param parameters Specifies information about the availability set that the virtual machine should be assigned + * to. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilitySetInner update( + String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context) { + return updateAsync(resourceGroupName, availabilitySetName, parameters, context).block(); + } + /** * Delete an availability set. * @@ -516,9 +634,11 @@ public AvailabilitySetInner update( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String availabilitySetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -540,7 +660,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -563,9 +683,11 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync( String resourceGroupName, String availabilitySetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -584,7 +706,7 @@ public Mono> deleteWithResponseAsync( final String apiVersion = "2019-03-01"; return service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -608,6 +730,23 @@ public Mono deleteAsync(String resourceGroupName, String availabilitySetNa .flatMap((Response res) -> Mono.empty()); } + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String availabilitySetName, Context context) { + return deleteWithResponseAsync(resourceGroupName, availabilitySetName, context) + .flatMap((Response res) -> Mono.empty()); + } + /** * Delete an availability set. * @@ -622,6 +761,21 @@ public void delete(String resourceGroupName, String availabilitySetName) { deleteAsync(resourceGroupName, availabilitySetName).block(); } + /** + * Delete an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 availabilitySetName, Context context) { + deleteAsync(resourceGroupName, availabilitySetName, context).block(); + } + /** * Retrieves information about an availability set. * @@ -633,11 +787,13 @@ public void delete(String resourceGroupName, String availabilitySetName) { * @return specifies information about the availability set that the virtual machine should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String availabilitySetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -659,7 +815,7 @@ public Mono> getByResourceGroupWithResponse context -> service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -680,11 +836,13 @@ public Mono> getByResourceGroupWithResponse * @return specifies information about the availability set that the virtual machine should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String availabilitySetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -703,7 +861,7 @@ public Mono> getByResourceGroupWithResponse final String apiVersion = "2019-03-01"; return service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -725,7 +883,32 @@ public Mono> getByResourceGroupWithResponse public Mono getByResourceGroupAsync(String resourceGroupName, String availabilitySetName) { return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String availabilitySetName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -749,6 +932,23 @@ public AvailabilitySetInner getByResourceGroup(String resourceGroupName, String return getByResourceGroupAsync(resourceGroupName, availabilitySetName).block(); } + /** + * Retrieves information about an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the availability set that the virtual machine should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailabilitySetInner getByResourceGroup( + String resourceGroupName, String availabilitySetName, Context context) { + return getByResourceGroupAsync(resourceGroupName, availabilitySetName, context).block(); + } + /** * Lists all availability sets in a subscription. * @@ -760,9 +960,11 @@ public AvailabilitySetInner getByResourceGroup(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -774,7 +976,8 @@ public Mono> listSinglePageAsync(String expa return FluxUtil .withContext( context -> - service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), expand, context)) + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, context)) .>map( res -> new PagedResponseBase<>( @@ -799,9 +1002,11 @@ public Mono> listSinglePageAsync(String expa */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -811,7 +1016,7 @@ public Mono> listSinglePageAsync(String expa } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), expand, context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, context) .map( res -> new PagedResponseBase<>( @@ -883,6 +1088,21 @@ public PagedIterable list(String expand) { return new PagedIterable<>(listAsync(expand)); } + /** + * Lists all availability sets in a subscription. + * + * @param expand The expand expression to apply to 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 the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, Context context) { + return new PagedIterable<>(listAsync(expand, context)); + } + /** * Lists all availability sets in a subscription. * @@ -908,9 +1128,11 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -928,7 +1150,7 @@ public Mono> listByResourceGroupSinglePageAs context -> service .listByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), @@ -958,9 +1180,11 @@ public Mono> listByResourceGroupSinglePageAs @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -975,7 +1199,7 @@ public Mono> listByResourceGroupSinglePageAs final String apiVersion = "2019-03-01"; return service .listByResourceGroup( - this.client.getHost(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -1033,6 +1257,21 @@ public PagedIterable listByResourceGroup(String resourceGr return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } + /** + * Lists all availability sets in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Availability Set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + /** * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing * availability set. @@ -1047,9 +1286,11 @@ public PagedIterable listByResourceGroup(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableSizesSinglePageAsync( String resourceGroupName, String availabilitySetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1071,7 +1312,7 @@ public Mono> listAvailableSizesSinglePage context -> service .listAvailableSizes( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -1099,9 +1340,11 @@ public Mono> listAvailableSizesSinglePage @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listAvailableSizesSinglePageAsync( String resourceGroupName, String availabilitySetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1120,7 +1363,7 @@ public Mono> listAvailableSizesSinglePage final String apiVersion = "2019-03-01"; return service .listAvailableSizes( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, availabilitySetName, apiVersion, @@ -1185,6 +1428,24 @@ public PagedIterable listAvailableSizes( return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, availabilitySetName)); } + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing + * availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes( + String resourceGroupName, String availabilitySetName, Context context) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, availabilitySetName, context)); + } + /** * Get the next page of items. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServicesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ContainerServicesClient.java similarity index 62% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServicesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ContainerServicesClient.java index 90f8f2740b3a..6928284a9c7b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServicesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ContainerServicesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -24,12 +24,16 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.ContainerServiceInner; +import com.azure.management.compute.fluent.inner.ContainerServiceListResultInner; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -38,24 +42,24 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ContainerServices. */ -public final class ContainerServicesInner +public final class ContainerServicesClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(ContainerServicesInner.class); + private final ClientLogger logger = new ClientLogger(ContainerServicesClient.class); /** The proxy service used to perform REST calls. */ private final ContainerServicesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of ContainerServicesInner. + * Initializes an instance of ContainerServicesClient. * * @param client the instance of the service client containing this operation class. */ - ContainerServicesInner(ComputeManagementClientImpl client) { + public ContainerServicesClient(ComputeManagementClient client) { this.service = RestProxy.create(ContainerServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -72,8 +76,8 @@ private interface ContainerServicesService { @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); @@ -84,8 +88,8 @@ Mono> list( + "/containerServices/{containerServiceName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerServiceName") String containerServiceName, @QueryParam("api-version") String apiVersion, @@ -99,8 +103,8 @@ Mono>> createOrUpdate( + "/containerServices/{containerServiceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerServiceName") String containerServiceName, @QueryParam("api-version") String apiVersion, @@ -113,8 +117,8 @@ Mono> getByResourceGroup( + "/containerServices/{containerServiceName}") @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerServiceName") String containerServiceName, @QueryParam("api-version") String apiVersion, @@ -127,8 +131,8 @@ Mono>> delete( + "/containerServices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -140,8 +144,8 @@ Mono> listByResourceGroup( + "/containerServices/{containerServiceName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerServiceName") String containerServiceName, @QueryParam("api-version") String apiVersion, @@ -155,8 +159,8 @@ Mono> beginCreateOrUpdate( + "/containerServices/{containerServiceName}") @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerServiceName") String containerServiceName, @QueryParam("api-version") String apiVersion, @@ -167,14 +171,14 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -188,9 +192,11 @@ Mono> listByResourceGroupNext( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -201,7 +207,8 @@ public Mono> listSinglePageAsync() { final String apiVersion = "2017-01-31"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context)) + context -> + service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -226,9 +233,11 @@ public Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -238,7 +247,7 @@ public Mono> listSinglePageAsync(Context co } final String apiVersion = "2017-01-31"; return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -291,6 +300,21 @@ public PagedIterable list() { return new PagedIterable<>(listAsync()); } + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container services in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. * @@ -303,11 +327,13 @@ public PagedIterable list() { * @return container service. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -334,7 +360,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -344,6 +370,103 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Container service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2017-01-31"; + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Container service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ContainerServiceInner> beginCreateOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ContainerServiceInner.class, ContainerServiceInner.class); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Container service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ContainerServiceInner> beginCreateOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ContainerServiceInner.class, ContainerServiceInner.class); + } + /** * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. * @@ -358,7 +481,7 @@ public Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters); return this .client @@ -368,6 +491,31 @@ public Mono createOrUpdateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Container service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ContainerServiceInner.class, ContainerServiceInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. * @@ -385,6 +533,24 @@ public ContainerServiceInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, containerServiceName, parameters).block(); } + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Container service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerServiceInner createOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context).block(); + } + /** * Gets the properties of the specified container service in the specified subscription and resource group. The * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of @@ -398,11 +564,13 @@ public ContainerServiceInner createOrUpdate( * @return the properties of the specified container service in the specified subscription and resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String containerServiceName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -424,7 +592,7 @@ public Mono> getByResourceGroupWithRespons context -> service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -447,11 +615,13 @@ public Mono> getByResourceGroupWithRespons * @return the properties of the specified container service in the specified subscription and resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String containerServiceName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -470,7 +640,7 @@ public Mono> getByResourceGroupWithRespons final String apiVersion = "2017-01-31"; return service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -494,7 +664,34 @@ public Mono> getByResourceGroupWithRespons public Mono getByResourceGroupAsync(String resourceGroupName, String containerServiceName) { return getByResourceGroupWithResponseAsync(resourceGroupName, containerServiceName) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String containerServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerServiceName, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -520,6 +717,25 @@ public ContainerServiceInner getByResourceGroup(String resourceGroupName, String return getByResourceGroupAsync(resourceGroupName, containerServiceName).block(); } + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerServiceInner getByResourceGroup( + String resourceGroupName, String containerServiceName, Context context) { + return getByResourceGroupAsync(resourceGroupName, containerServiceName, context).block(); + } + /** * Deletes the specified container service in the specified subscription and resource group. The operation does not * delete other resources created as part of creating a container service, including storage accounts, VMs, and @@ -534,11 +750,13 @@ public ContainerServiceInner getByResourceGroup(String resourceGroupName, String * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String containerServiceName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -560,7 +778,7 @@ public Mono>> deleteWithResponseAsync( context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -569,6 +787,95 @@ public Mono>> deleteWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String containerServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 apiVersion = "2017-01-31"; + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete(String resourceGroupName, String containerServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerServiceName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String containerServiceName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, containerServiceName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Deletes the specified container service in the specified subscription and resource group. The operation does not * delete other resources created as part of creating a container service, including storage accounts, VMs, and @@ -584,7 +891,32 @@ public Mono>> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String containerServiceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerServiceName); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerServiceName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String containerServiceName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, containerServiceName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -609,6 +941,24 @@ public void delete(String resourceGroupName, String containerServiceName) { deleteAsync(resourceGroupName, containerServiceName).block(); } + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 containerServiceName, Context context) { + deleteAsync(resourceGroupName, containerServiceName, context).block(); + } + /** * Gets a list of container services in the specified subscription and resource group. The operation returns * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of @@ -622,9 +972,11 @@ public void delete(String resourceGroupName, String containerServiceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -642,7 +994,7 @@ public Mono> listByResourceGroupSinglePageA context -> service .listByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), @@ -674,9 +1026,11 @@ public Mono> listByResourceGroupSinglePageA @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -691,7 +1045,7 @@ public Mono> listByResourceGroupSinglePageA final String apiVersion = "2017-01-31"; return service .listByResourceGroup( - this.client.getHost(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -756,6 +1110,23 @@ public PagedIterable listByResourceGroup(String resourceG return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of container services in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + /** * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. * @@ -768,11 +1139,13 @@ public PagedIterable listByResourceGroup(String resourceG * @return container service. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -798,8 +1171,8 @@ public Mono> beginCreateOrUpdateWithRespon .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -822,11 +1195,13 @@ public Mono> beginCreateOrUpdateWithRespon * @return container service. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -849,8 +1224,8 @@ public Mono> beginCreateOrUpdateWithRespon } final String apiVersion = "2017-01-31"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -871,11 +1246,11 @@ public Mono> beginCreateOrUpdateWithRespon * @return container service. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters) + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName, parameters) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -890,15 +1265,61 @@ public Mono beginCreateOrUpdateAsync( * @param resourceGroupName The name of the resource group. * @param containerServiceName The name of the container service in the specified subscription and resource group. * @param parameters Container service. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return container service. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner beginCreateOrUpdate( + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, containerServiceName, parameters, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Container service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerServiceInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).block(); + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, containerServiceName, parameters).block(); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Container service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerServiceInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, containerServiceName, parameters, context) + .block(); } /** @@ -915,10 +1336,13 @@ public ContainerServiceInner beginCreateOrUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String containerServiceName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync( + String resourceGroupName, String containerServiceName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -939,8 +1363,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -964,11 +1388,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String containerServiceName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -986,8 +1412,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2017-01-31"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, containerServiceName, apiVersion, @@ -1009,8 +1435,8 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String containerServiceName) { - return beginDeleteWithResponseAsync(resourceGroupName, containerServiceName) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String containerServiceName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName) .flatMap((Response res) -> Mono.empty()); } @@ -1022,13 +1448,52 @@ public Mono beginDeleteAsync(String resourceGroupName, String containerSer * * @param resourceGroupName The name of the resource group. * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String containerServiceName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginDeleteWithoutPolling(String resourceGroupName, String containerServiceName) { + beginDeleteWithoutPollingAsync(resourceGroupName, containerServiceName).block(); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 beginDelete(String resourceGroupName, String containerServiceName) { - beginDeleteAsync(resourceGroupName, containerServiceName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String containerServiceName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, containerServiceName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DedicatedHostGroupsClient.java similarity index 74% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DedicatedHostGroupsClient.java index 01b36c6d9bbd..ed3d41c354c4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DedicatedHostGroupsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,36 +25,38 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.DedicatedHostGroupUpdate; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.DedicatedHostGroupInner; +import com.azure.management.compute.fluent.inner.DedicatedHostGroupListResultInner; +import com.azure.management.compute.models.DedicatedHostGroupUpdate; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in DedicatedHostGroups. */ -public final class DedicatedHostGroupsInner +public final class DedicatedHostGroupsClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(DedicatedHostGroupsInner.class); + private final ClientLogger logger = new ClientLogger(DedicatedHostGroupsClient.class); /** The proxy service used to perform REST calls. */ private final DedicatedHostGroupsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of DedicatedHostGroupsInner. + * Initializes an instance of DedicatedHostGroupsClient. * * @param client the instance of the service client containing this operation class. */ - DedicatedHostGroupsInner(ComputeManagementClientImpl client) { + public DedicatedHostGroupsClient(ComputeManagementClient client) { this.service = RestProxy.create(DedicatedHostGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -73,8 +75,8 @@ private interface DedicatedHostGroupsService { + "/{hostGroupName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String host, + Mono> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @QueryParam("api-version") String apiVersion, @@ -88,8 +90,8 @@ Mono> createOrUpdate( + "/{hostGroupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String host, + Mono> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @QueryParam("api-version") String apiVersion, @@ -104,7 +106,7 @@ Mono> update( @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( - @HostParam("$host") String host, + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @QueryParam("api-version") String apiVersion, @@ -117,8 +119,8 @@ Mono> delete( + "/{hostGroupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @QueryParam("api-version") String apiVersion, @@ -130,8 +132,8 @@ Mono> getByResourceGroup( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -141,8 +143,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); @@ -151,14 +153,14 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -177,11 +179,13 @@ Mono> listBySubscriptionNext( * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( + public Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -207,7 +211,7 @@ public Mono> createOrUpdateWithResponseA context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -233,11 +237,13 @@ public Mono> createOrUpdateWithResponseA * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( + public Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -260,7 +266,7 @@ public Mono> createOrUpdateWithResponseA final String apiVersion = "2019-03-01"; return service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -288,7 +294,36 @@ public Mono createOrUpdateAsync( String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Specifies information about the dedicated host group that the dedicated hosts should be + * assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at + * creation time. An existing dedicated host cannot be added to another dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, parameters, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -317,6 +352,27 @@ public DedicatedHostGroupInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, hostGroupName, parameters).block(); } + /** + * Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see + * [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Specifies information about the dedicated host group that the dedicated hosts should be + * assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at + * creation time. An existing dedicated host cannot be added to another dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostGroupInner createOrUpdate( + String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, hostGroupName, parameters, context).block(); + } + /** * Update an dedicated host group. * @@ -330,11 +386,13 @@ public DedicatedHostGroupInner createOrUpdate( * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( + public Mono> updateWithResponseAsync( String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -360,7 +418,7 @@ public Mono> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -384,11 +442,13 @@ public Mono> updateWithResponseAsync( * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( + public Mono> updateWithResponseAsync( String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -411,7 +471,7 @@ public Mono> updateWithResponseAsync( final String apiVersion = "2019-03-01"; return service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -437,7 +497,34 @@ public Mono updateAsync( String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters) { return updateWithResponseAsync(resourceGroupName, hostGroupName, parameters) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Specifies information about the dedicated host group that the dedicated host should be assigned + * to. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, hostGroupName, parameters, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -464,6 +551,25 @@ public DedicatedHostGroupInner update( return updateAsync(resourceGroupName, hostGroupName, parameters).block(); } + /** + * Update an dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param parameters Specifies information about the dedicated host group that the dedicated host should be assigned + * to. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostGroupInner update( + String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context) { + return updateAsync(resourceGroupName, hostGroupName, parameters, context).block(); + } + /** * Delete a dedicated host group. * @@ -476,9 +582,11 @@ public DedicatedHostGroupInner update( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String hostGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -499,7 +607,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -522,9 +630,11 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync( String resourceGroupName, String hostGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -542,7 +652,7 @@ public Mono> deleteWithResponseAsync( final String apiVersion = "2019-03-01"; return service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -565,6 +675,23 @@ public Mono deleteAsync(String resourceGroupName, String hostGroupName) { return deleteWithResponseAsync(resourceGroupName, hostGroupName).flatMap((Response res) -> Mono.empty()); } + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String hostGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, hostGroupName, context) + .flatMap((Response res) -> Mono.empty()); + } + /** * Delete a dedicated host group. * @@ -579,6 +706,21 @@ public void delete(String resourceGroupName, String hostGroupName) { deleteAsync(resourceGroupName, hostGroupName).block(); } + /** + * Delete a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 hostGroupName, Context context) { + deleteAsync(resourceGroupName, hostGroupName, context).block(); + } + /** * Retrieves information about a dedicated host group. * @@ -590,11 +732,13 @@ public void delete(String resourceGroupName, String hostGroupName) { * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String hostGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -615,7 +759,7 @@ public Mono> getByResourceGroupWithRespo context -> service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -636,11 +780,13 @@ public Mono> getByResourceGroupWithRespo * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String hostGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -658,7 +804,7 @@ public Mono> getByResourceGroupWithRespo final String apiVersion = "2019-03-01"; return service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -680,7 +826,32 @@ public Mono> getByResourceGroupWithRespo public Mono getByResourceGroupAsync(String resourceGroupName, String hostGroupName) { return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String hostGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hostGroupName, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -704,6 +875,22 @@ public DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, Stri return getByResourceGroupAsync(resourceGroupName, hostGroupName).block(); } + /** + * Retrieves information about a dedicated host group. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, String hostGroupName, Context context) { + return getByResourceGroupAsync(resourceGroupName, hostGroupName, context).block(); + } + /** * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response * to get the next page of dedicated host groups. @@ -716,9 +903,11 @@ public DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -736,7 +925,7 @@ public Mono> listByResourceGroupSinglePag context -> service .listByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), @@ -767,9 +956,11 @@ public Mono> listByResourceGroupSinglePag @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -784,7 +975,7 @@ public Mono> listByResourceGroupSinglePag final String apiVersion = "2019-03-01"; return service .listByResourceGroup( - this.client.getHost(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -846,6 +1037,22 @@ public PagedIterable listByResourceGroup(String resourc return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } + /** + * Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response + * to get the next page of dedicated host groups. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + /** * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the * next page of dedicated host groups. @@ -856,9 +1063,11 @@ public PagedIterable listByResourceGroup(String resourc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -869,7 +1078,8 @@ public Mono> listSinglePageAsync() { final String apiVersion = "2019-03-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context)) + context -> + service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -894,9 +1104,11 @@ public Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -906,7 +1118,7 @@ public Mono> listSinglePageAsync(Context } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -961,6 +1173,21 @@ public PagedIterable list() { return new PagedIterable<>(listAsync()); } + /** + * Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the + * next page of dedicated host groups. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Dedicated Host Group with resource group response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Get the next page of items. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DedicatedHostsClient.java similarity index 59% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DedicatedHostsClient.java index 8f37b70743d1..5cc2d3cc998f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DedicatedHostsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,34 +25,38 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.DedicatedHostUpdate; -import com.azure.management.compute.InstanceViewTypes; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.DedicatedHostInner; +import com.azure.management.compute.fluent.inner.DedicatedHostListResultInner; +import com.azure.management.compute.models.DedicatedHostUpdate; +import com.azure.management.compute.models.InstanceViewTypes; 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 DedicatedHosts. */ -public final class DedicatedHostsInner { - private final ClientLogger logger = new ClientLogger(DedicatedHostsInner.class); +public final class DedicatedHostsClient { + private final ClientLogger logger = new ClientLogger(DedicatedHostsClient.class); /** The proxy service used to perform REST calls. */ private final DedicatedHostsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of DedicatedHostsInner. + * Initializes an instance of DedicatedHostsClient. * * @param client the instance of the service client containing this operation class. */ - DedicatedHostsInner(ComputeManagementClientImpl client) { + public DedicatedHostsClient(ComputeManagementClient client) { this.service = RestProxy.create(DedicatedHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -71,8 +75,8 @@ private interface DedicatedHostsService { + "/{hostGroupName}/hosts/{hostName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @PathParam("hostName") String hostname, @@ -87,8 +91,8 @@ Mono>> createOrUpdate( + "/{hostGroupName}/hosts/{hostName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @PathParam("hostName") String hostname, @@ -103,8 +107,8 @@ Mono>> update( + "/{hostGroupName}/hosts/{hostName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @PathParam("hostName") String hostname, @@ -118,8 +122,8 @@ Mono>> delete( + "/{hostGroupName}/hosts/{hostName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @PathParam("hostName") String hostname, @@ -134,8 +138,8 @@ Mono> get( + "/{hostGroupName}/hosts") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostGroup( - @HostParam("$host") String host, + Mono> listByHostGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @QueryParam("api-version") String apiVersion, @@ -148,8 +152,8 @@ Mono> listByHostGroup( + "/{hostGroupName}/hosts/{hostName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @PathParam("hostName") String hostname, @@ -164,8 +168,8 @@ Mono> beginCreateOrUpdate( + "/{hostGroupName}/hosts/{hostName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @PathParam("hostName") String hostname, @@ -180,8 +184,8 @@ Mono> beginUpdate( + "/{hostGroupName}/hosts/{hostName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostGroupName") String hostGroupName, @PathParam("hostName") String hostname, @@ -193,7 +197,7 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostGroupNext( + Mono> listByHostGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -210,11 +214,13 @@ Mono> listByHostGroupNext( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -243,7 +249,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -254,6 +260,117 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the Dedicated 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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the Dedicated 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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the Dedicated 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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DedicatedHostInner> beginCreateOrUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class); + } + /** * Create or update a dedicated host . * @@ -269,7 +386,7 @@ public Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); return this .client @@ -279,6 +396,36 @@ public Mono createOrUpdateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the Dedicated 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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Create or update a dedicated host . * @@ -297,6 +444,29 @@ public DedicatedHostInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); } + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the Dedicated 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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner createOrUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); + } + /** * Update an dedicated host . * @@ -311,11 +481,13 @@ public DedicatedHostInner createOrUpdate( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono>> updateWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -344,7 +516,7 @@ public Mono>> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -355,6 +527,120 @@ public Mono>> updateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType + * may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType + * may be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DedicatedHostInner> beginUpdate( + String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType + * may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DedicatedHostInner> beginUpdate( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class); + } + /** * Update an dedicated host . * @@ -371,7 +657,7 @@ public Mono>> updateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - Mono>> mono = + Mono>> mono = updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters); return this .client @@ -381,6 +667,37 @@ public Mono updateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType + * may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DedicatedHostInner.class, DedicatedHostInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Update an dedicated host . * @@ -400,6 +717,30 @@ public DedicatedHostInner update( return updateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); } + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType + * may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner update( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + return updateAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); + } + /** * Delete a dedicated host. * @@ -412,11 +753,13 @@ public DedicatedHostInner update( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -440,7 +783,7 @@ public Mono>> deleteWithResponseAsync( context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -450,6 +793,93 @@ public Mono>> deleteWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); + } + if (hostname == null) { + return Mono.error(new IllegalArgumentException("Parameter hostname 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 apiVersion = "2019-03-01"; + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + hostGroupName, + hostname, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String hostGroupName, String hostname) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Delete a dedicated host. * @@ -463,8 +893,30 @@ public Mono>> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, hostGroupName, hostname, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -487,6 +939,22 @@ public void delete(String resourceGroupName, String hostGroupName, String hostna deleteAsync(resourceGroupName, hostGroupName, hostname).block(); } + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hostGroupName, String hostname, Context context) { + deleteAsync(resourceGroupName, hostGroupName, hostname, context).block(); + } + /** * Retrieves information about a dedicated host. * @@ -500,11 +968,13 @@ public void delete(String resourceGroupName, String hostGroupName, String hostna * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -528,7 +998,7 @@ public Mono> getWithResponseAsync( context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -553,11 +1023,13 @@ public Mono> getWithResponseAsync( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -578,7 +1050,7 @@ public Mono> getWithResponseAsync( final String apiVersion = "2019-03-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -605,7 +1077,34 @@ public Mono getAsync( String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand) { return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context) { + return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -631,7 +1130,7 @@ public Mono getAsync(String resourceGroupName, String hostGr final Context context = null; return getWithResponseAsync(resourceGroupName, hostGroupName, hostname, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -658,6 +1157,25 @@ public DedicatedHostInner get( return getAsync(resourceGroupName, hostGroupName, hostname, expand).block(); } + /** + * Retrieves information about a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host. + * @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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner get( + String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context) { + return getAsync(resourceGroupName, hostGroupName, hostname, expand, context).block(); + } + /** * Retrieves information about a dedicated host. * @@ -690,9 +1208,11 @@ public DedicatedHostInner get(String resourceGroupName, String hostGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByHostGroupSinglePageAsync( String resourceGroupName, String hostGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -713,7 +1233,7 @@ public Mono> listByHostGroupSinglePageAsync( context -> service .listByHostGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -746,9 +1266,11 @@ public Mono> listByHostGroupSinglePageAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByHostGroupSinglePageAsync( String resourceGroupName, String hostGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -766,7 +1288,7 @@ public Mono> listByHostGroupSinglePageAsync( final String apiVersion = "2019-03-01"; return service .listByHostGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, hostGroupName, apiVersion, @@ -837,6 +1359,24 @@ public PagedIterable listByHostGroup(String resourceGroupNam return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName)); } + /** + * Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response + * to get the next page of dedicated hosts. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list dedicated host operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHostGroup( + String resourceGroupName, String hostGroupName, Context context) { + return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName, context)); + } + /** * Create or update a dedicated host . * @@ -850,11 +1390,13 @@ public PagedIterable listByHostGroup(String resourceGroupNam * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -882,8 +1424,8 @@ public Mono> beginCreateOrUpdateWithResponseA .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -908,15 +1450,17 @@ public Mono> beginCreateOrUpdateWithResponseA * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -941,8 +1485,8 @@ public Mono> beginCreateOrUpdateWithResponseA } final String apiVersion = "2019-03-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -965,11 +1509,44 @@ public Mono> beginCreateOrUpdateWithResponseA * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters) + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, hostGroupName, hostname, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the Dedicated 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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, hostGroupName, hostname, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -991,9 +1568,33 @@ public Mono beginCreateOrUpdateAsync( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginCreateOrUpdate( + public DedicatedHostInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); + } + + /** + * Create or update a dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the Dedicated 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 specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostInner parameters, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters, context) + .block(); } /** @@ -1010,11 +1611,13 @@ public DedicatedHostInner beginCreateOrUpdate( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1042,8 +1645,8 @@ public Mono> beginUpdateWithResponseAsync( .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -1069,15 +1672,17 @@ public Mono> beginUpdateWithResponseAsync( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1102,8 +1707,8 @@ public Mono> beginUpdateWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -1127,11 +1732,44 @@ public Mono> beginUpdateWithResponseAsync( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters) + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType + * may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, hostGroupName, hostname, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1154,9 +1792,33 @@ public Mono beginUpdateAsync( * @return specifies information about the Dedicated host. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginUpdate( + public DedicatedHostInner beginUpdateWithoutPolling( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); + return beginUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); + } + + /** + * Update an dedicated host . + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated host . + * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType + * may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Dedicated host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DedicatedHostInner beginUpdateWithoutPolling( + String resourceGroupName, + String hostGroupName, + String hostname, + DedicatedHostUpdate parameters, + Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); } /** @@ -1171,11 +1833,13 @@ public DedicatedHostInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1198,8 +1862,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -1222,11 +1886,13 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String hostGroupName, String hostname, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1246,8 +1912,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, hostGroupName, hostname, @@ -1268,8 +1934,8 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String hostGroupName, String hostname) { - return beginDeleteWithResponseAsync(resourceGroupName, hostGroupName, hostname) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String hostGroupName, String hostname) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname) .flatMap((Response res) -> Mono.empty()); } @@ -1279,13 +1945,49 @@ public Mono beginDeleteAsync(String resourceGroupName, String hostGroupNam * @param resourceGroupName The name of the resource group. * @param hostGroupName The name of the dedicated host group. * @param hostname The name of the dedicated 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginDeleteWithoutPolling(String resourceGroupName, String hostGroupName, String hostname) { + beginDeleteWithoutPollingAsync(resourceGroupName, hostGroupName, hostname).block(); + } + + /** + * Delete a dedicated host. + * + * @param resourceGroupName The name of the resource group. + * @param hostGroupName The name of the dedicated host group. + * @param hostname The name of the dedicated 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String hostGroupName, String hostname) { - beginDeleteAsync(resourceGroupName, hostGroupName, hostname).block(); + public void beginDeleteWithoutPolling( + String resourceGroupName, String hostGroupName, String hostname, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DiskEncryptionSetsClient.java similarity index 59% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DiskEncryptionSetsClient.java index 12a5ab58ad95..41f26592130b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DiskEncryptionSetsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,13 +25,17 @@ 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.http.rest.SimpleResponse; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.ApiErrorException; -import com.azure.management.compute.DiskEncryptionSetUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.DiskEncryptionSetInner; +import com.azure.management.compute.fluent.inner.DiskEncryptionSetListInner; +import com.azure.management.compute.models.ApiErrorException; +import com.azure.management.compute.models.DiskEncryptionSetUpdate; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -40,24 +44,24 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in DiskEncryptionSets. */ -public final class DiskEncryptionSetsInner +public final class DiskEncryptionSetsClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(DiskEncryptionSetsInner.class); + private final ClientLogger logger = new ClientLogger(DiskEncryptionSetsClient.class); /** The proxy service used to perform REST calls. */ private final DiskEncryptionSetsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of DiskEncryptionSetsInner. + * Initializes an instance of DiskEncryptionSetsClient. * * @param client the instance of the service client containing this operation class. */ - DiskEncryptionSetsInner(ComputeManagementClientImpl client) { + public DiskEncryptionSetsClient(ComputeManagementClient client) { this.service = RestProxy.create(DiskEncryptionSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -76,8 +80,8 @@ private interface DiskEncryptionSetsService { + "/diskEncryptionSets/{diskEncryptionSetName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskEncryptionSetName") String diskEncryptionSetName, @@ -91,8 +95,8 @@ Mono>> createOrUpdate( + "/diskEncryptionSets/{diskEncryptionSetName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskEncryptionSetName") String diskEncryptionSetName, @@ -106,8 +110,8 @@ Mono>> update( + "/diskEncryptionSets/{diskEncryptionSetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskEncryptionSetName") String diskEncryptionSetName, @@ -120,8 +124,8 @@ Mono> getByResourceGroup( + "/diskEncryptionSets/{diskEncryptionSetName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskEncryptionSetName") String diskEncryptionSetName, @@ -134,8 +138,8 @@ Mono>> delete( + "/diskEncryptionSets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -145,8 +149,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, Context context); @@ -157,8 +161,8 @@ Mono> list( + "/diskEncryptionSets/{diskEncryptionSetName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskEncryptionSetName") String diskEncryptionSetName, @@ -172,8 +176,8 @@ Mono> beginCreateOrUpdate( + "/diskEncryptionSets/{diskEncryptionSetName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskEncryptionSetName") String diskEncryptionSetName, @@ -187,8 +191,8 @@ Mono> beginUpdate( + "/diskEncryptionSets/{diskEncryptionSetName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskEncryptionSetName") String diskEncryptionSetName, @@ -199,14 +203,14 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -224,11 +228,13 @@ Mono> listNext( * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -256,7 +262,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -266,6 +272,116 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + if (diskEncryptionSet == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); + } else { + diskEncryptionSet.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + context); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskEncryptionSetInner.class, DiskEncryptionSetInner.class); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DiskEncryptionSetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskEncryptionSetInner.class, DiskEncryptionSetInner.class); + } + /** * Creates or updates a disk encryption set. * @@ -282,7 +398,7 @@ public Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); return this .client @@ -292,6 +408,36 @@ public Mono createOrUpdateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskEncryptionSetInner.class, DiskEncryptionSetInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Creates or updates a disk encryption set. * @@ -311,6 +457,29 @@ public DiskEncryptionSetInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); } + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner createOrUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + return createOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).block(); + } + /** * Updates (patches) a disk encryption set. * @@ -325,11 +494,13 @@ public DiskEncryptionSetInner createOrUpdate( * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono>> updateWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -357,7 +528,7 @@ public Mono>> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -367,6 +538,116 @@ public Mono>> updateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set update resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + if (diskEncryptionSet == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); + } else { + diskEncryptionSet.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + diskEncryptionSet, + context); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set update resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskEncryptionSetInner.class, DiskEncryptionSetInner.class); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set update resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DiskEncryptionSetInner> beginUpdate( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskEncryptionSetInner.class, DiskEncryptionSetInner.class); + } + /** * Updates (patches) a disk encryption set. * @@ -383,7 +664,7 @@ public Mono>> updateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - Mono>> mono = + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet); return this .client @@ -393,6 +674,36 @@ public Mono updateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set update resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskEncryptionSetInner.class, DiskEncryptionSetInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Updates (patches) a disk encryption set. * @@ -412,6 +723,29 @@ public DiskEncryptionSetInner update( return updateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); } + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set update resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner update( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + return updateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context).block(); + } + /** * Gets information about a disk encryption set. * @@ -425,11 +759,13 @@ public DiskEncryptionSetInner update( * @return information about a disk encryption set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String diskEncryptionSetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -451,7 +787,7 @@ public Mono> getByResourceGroupWithRespon context -> service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -474,11 +810,199 @@ public Mono> getByResourceGroupWithRespon * @return information about a disk encryption set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName, 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + context); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String diskEncryptionSetName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName) { + return getByResourceGroupAsync(resourceGroupName, diskEncryptionSetName).block(); + } + + /** + * Gets information about a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk encryption set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner getByResourceGroup( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return getByResourceGroupAsync(resourceGroupName, diskEncryptionSetName, context).block(); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName) { + 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 (diskEncryptionSetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskEncryptionSetName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -496,8 +1020,8 @@ public Mono> getByResourceGroupWithRespon } final String apiVersion = "2019-07-01"; return service - .getByResourceGroup( - this.client.getHost(), + .delete( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -506,7 +1030,7 @@ public Mono> getByResourceGroupWithRespon } /** - * Gets information about a disk encryption set. + * Deletes a disk encryption set. * * @param resourceGroupName The name of the resource group. * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed @@ -515,37 +1039,33 @@ public Mono> getByResourceGroupWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String diskEncryptionSetName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, diskEncryptionSetName) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, Void> beginDelete(String resourceGroupName, String diskEncryptionSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets information about a disk encryption set. + * Deletes a disk encryption set. * * @param resourceGroupName The name of the resource group. * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The * maximum name length is 80 characters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a disk encryption set. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName) { - return getByResourceGroupAsync(resourceGroupName, diskEncryptionSetName).block(); + public PollerFlux, Void> beginDelete( + String resourceGroupName, String diskEncryptionSetName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** @@ -561,39 +1081,13 @@ public DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, Strin * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -603,14 +1097,16 @@ public Mono>> deleteWithResponseAsync( * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The * maximum name length is 80 characters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName); + public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, diskEncryptionSetName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -634,6 +1130,23 @@ public void delete(String resourceGroupName, String diskEncryptionSetName) { deleteAsync(resourceGroupName, diskEncryptionSetName).block(); } + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 diskEncryptionSetName, Context context) { + deleteAsync(resourceGroupName, diskEncryptionSetName, context).block(); + } + /** * Lists all the disk encryption sets under a resource group. * @@ -645,9 +1158,11 @@ public void delete(String resourceGroupName, String diskEncryptionSetName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -665,7 +1180,7 @@ public Mono> listByResourceGroupSinglePage context -> service .listByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, @@ -695,9 +1210,11 @@ public Mono> listByResourceGroupSinglePage @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -712,7 +1229,7 @@ public Mono> listByResourceGroupSinglePage final String apiVersion = "2019-07-01"; return service .listByResourceGroup( - this.client.getHost(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) .map( res -> new PagedResponseBase<>( @@ -771,6 +1288,21 @@ public PagedIterable listByResourceGroup(String resource return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } + /** + * Lists all the disk encryption sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + /** * Lists all the disk encryption sets under a subscription. * @@ -780,9 +1312,11 @@ public PagedIterable listByResourceGroup(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -793,7 +1327,8 @@ public Mono> listSinglePageAsync() { final String apiVersion = "2019-07-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context)) + context -> + service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context)) .>map( res -> new PagedResponseBase<>( @@ -817,9 +1352,11 @@ public Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -829,7 +1366,7 @@ public Mono> listSinglePageAsync(Context c } final String apiVersion = "2019-07-01"; return service - .list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( res -> new PagedResponseBase<>( @@ -879,6 +1416,20 @@ public PagedIterable list() { return new PagedIterable<>(listAsync()); } + /** + * Lists all the disk encryption sets under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List disk encryption set operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Creates or updates a disk encryption set. * @@ -893,11 +1444,13 @@ public PagedIterable list() { * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -924,8 +1477,8 @@ public Mono> beginCreateOrUpdateWithRespo .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -950,14 +1503,16 @@ public Mono> beginCreateOrUpdateWithRespo * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -981,8 +1536,8 @@ public Mono> beginCreateOrUpdateWithRespo } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -1005,11 +1560,44 @@ public Mono> beginCreateOrUpdateWithRespo * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1032,9 +1620,35 @@ public Mono beginCreateOrUpdateAsync( * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginCreateOrUpdate( + public DiskEncryptionSetInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + .block(); + } + + /** + * Creates or updates a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetInner diskEncryptionSet, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) + .block(); } /** @@ -1051,11 +1665,13 @@ public DiskEncryptionSetInner beginCreateOrUpdate( * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1082,8 +1698,8 @@ public Mono> beginUpdateWithResponseAsync .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -1108,14 +1724,16 @@ public Mono> beginUpdateWithResponseAsync * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1139,8 +1757,8 @@ public Mono> beginUpdateWithResponseAsync } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -1163,11 +1781,43 @@ public Mono> beginUpdateWithResponseAsync * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set update resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1190,9 +1840,33 @@ public Mono beginUpdateAsync( * @return disk encryption set resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginUpdate( + public DiskEncryptionSetInner beginUpdateWithoutPolling( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); + return beginUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); + } + + /** + * Updates (patches) a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set update resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return disk encryption set resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskEncryptionSetInner beginUpdateWithoutPolling( + String resourceGroupName, + String diskEncryptionSetName, + DiskEncryptionSetUpdate diskEncryptionSet, + Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) + .block(); } /** @@ -1208,10 +1882,13 @@ public DiskEncryptionSetInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String diskEncryptionSetName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync( + String resourceGroupName, String diskEncryptionSetName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1232,8 +1909,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -1256,11 +1933,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String diskEncryptionSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1278,8 +1957,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskEncryptionSetName, @@ -1300,8 +1979,28 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String diskEncryptionSetName) { - return beginDeleteWithResponseAsync(resourceGroupName, diskEncryptionSetName) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String diskEncryptionSetName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String diskEncryptionSetName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1317,8 +2016,25 @@ public Mono beginDeleteAsync(String resourceGroupName, String diskEncrypti * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String diskEncryptionSetName) { - beginDeleteAsync(resourceGroupName, diskEncryptionSetName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String diskEncryptionSetName) { + beginDeleteWithoutPollingAsync(resourceGroupName, diskEncryptionSetName).block(); + } + + /** + * Deletes a disk encryption set. + * + * @param resourceGroupName The name of the resource group. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed + * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + * maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String diskEncryptionSetName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DisksInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DisksClient.java similarity index 56% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DisksInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DisksClient.java index 36d2042def82..539468d3c5ef 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DisksInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/DisksClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -26,14 +26,19 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.DiskUpdate; -import com.azure.management.compute.GrantAccessData; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.AccessUriInner; +import com.azure.management.compute.fluent.inner.DiskInner; +import com.azure.management.compute.fluent.inner.DiskListInner; +import com.azure.management.compute.models.DiskUpdate; +import com.azure.management.compute.models.GrantAccessData; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -42,22 +47,22 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in Disks. */ -public final class DisksInner +public final class DisksClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(DisksInner.class); + private final ClientLogger logger = new ClientLogger(DisksClient.class); /** The proxy service used to perform REST calls. */ private final DisksService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of DisksInner. + * Initializes an instance of DisksClient. * * @param client the instance of the service client containing this operation class. */ - DisksInner(ComputeManagementClientImpl client) { + public DisksClient(ComputeManagementClient client) { this.service = RestProxy.create(DisksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -75,8 +80,8 @@ private interface DisksService { + "/{diskName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -90,8 +95,8 @@ Mono>> createOrUpdate( + "/{diskName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -105,8 +110,8 @@ Mono>> update( + "/{diskName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -119,8 +124,8 @@ Mono> getByResourceGroup( + "/{diskName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -131,8 +136,8 @@ Mono>> delete( @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -142,8 +147,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, Context context); @@ -154,8 +159,8 @@ Mono> list( + "/{diskName}/beginGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> grantAccess( - @HostParam("$host") String host, + Mono>> grantAccess( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -169,8 +174,8 @@ Mono>> grantAccess( + "/{diskName}/endGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> revokeAccess( - @HostParam("$host") String host, + Mono>> revokeAccess( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -183,8 +188,8 @@ Mono>> revokeAccess( + "/{diskName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -198,8 +203,8 @@ Mono> beginCreateOrUpdate( + "/{diskName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -213,8 +218,8 @@ Mono> beginUpdate( + "/{diskName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -227,8 +232,8 @@ Mono> beginDelete( + "/{diskName}/beginGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginGrantAccess( - @HostParam("$host") String host, + Mono> beginGrantAccessWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -242,8 +247,8 @@ Mono> beginGrantAccess( + "/{diskName}/endGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRevokeAccess( - @HostParam("$host") String host, + Mono> beginRevokeAccessWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("diskName") String diskName, @@ -254,14 +259,14 @@ Mono> beginRevokeAccess( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -278,11 +283,13 @@ Mono> listNext( * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String diskName, DiskInner disk) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -308,7 +315,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -325,21 +332,71 @@ public Mono>> createOrUpdateWithResponseAsync( * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @param disk Disk 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 disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk); + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskName, DiskInner disk, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (disk == null) { + return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); + } else { + disk.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + disk, + context); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk 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 disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk); return this .client .getLroResultAsync( - mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class); } /** @@ -349,84 +406,64 @@ public Mono createOrUpdateAsync(String resourceGroupName, String disk * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @param disk Disk 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 disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk) { - return createOrUpdateAsync(resourceGroupName, diskName, disk).block(); + public PollerFlux, DiskInner> beginCreateOrUpdate( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class); } /** - * Updates (patches) a disk. + * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. + * @param disk Disk 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 disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono createOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Updates (patches) a disk. + * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. + * @param disk Disk 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 disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk); + public Mono createOrUpdateAsync( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskName, disk, context); return this .client .getLroResultAsync( @@ -436,39 +473,60 @@ public Mono updateAsync(String resourceGroupName, String diskName, Di } /** - * Updates (patches) a disk. + * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. + * @param disk Disk 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 disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk) { - return updateAsync(resourceGroupName, diskName, disk).block(); + public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk) { + return createOrUpdateAsync(resourceGroupName, diskName, disk).block(); } /** - * Gets information about a disk. + * Creates or updates a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk 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 information about a disk. + * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String diskName) { - if (this.client.getHost() == null) { + public DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk, Context context) { + return createOrUpdateAsync(resourceGroupName, diskName, disk, context).block(); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String diskName, DiskUpdate disk) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -483,39 +541,48 @@ public Mono> getByResourceGroupWithResponseAsync( if (diskName == null) { return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } + if (disk == null) { + return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); + } else { + disk.validate(); + } final String apiVersion = "2019-07-01"; return FluxUtil .withContext( context -> service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, apiVersion, + disk, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets information about a disk. + * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 information about a disk. + * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String diskName, Context context) { - if (this.client.getHost() == null) { + public Mono>> updateWithResponseAsync( + String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -530,152 +597,168 @@ public Mono> getByResourceGroupWithResponseAsync( if (diskName == null) { return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } + if (disk == null) { + return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); + } else { + disk.validate(); + } final String apiVersion = "2019-07-01"; return service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, apiVersion, + disk, context); } /** - * Gets information about a disk. + * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 information about a disk. + * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String diskName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, diskName) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class); } /** - * Gets information about a disk. + * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 information about a disk. + * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner getByResourceGroup(String resourceGroupName, String diskName) { - return getByResourceGroupAsync(resourceGroupName, diskName).block(); + public PollerFlux, DiskInner> beginUpdate( + String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class); } /** - * Deletes a disk. + * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String diskName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Deletes a disk. + * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 completion. + * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String diskName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName); + public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, diskName, disk, context); return this .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class) .last() .flatMap(AsyncPollResponse::getFinalResult); } /** - * Deletes a disk. + * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String diskName) { - deleteAsync(resourceGroupName, diskName).block(); - } + public DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk) { + return updateAsync(resourceGroupName, diskName, disk).block(); + } /** - * Lists all the disks under a resource group. + * Updates (patches) a disk. * * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 List Disks operation response. + * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + public DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + return updateAsync(resourceGroupName, diskName, disk, context).block(); + } + + /** + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String diskName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -687,45 +770,44 @@ public Mono> listByResourceGroupSinglePageAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return FluxUtil .withContext( context -> service - .listByResourceGroup( - this.client.getHost(), + .getByResourceGroup( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + diskName, apiVersion, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Lists all the disks under a resource group. + * Gets information about a disk. * * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return information about a disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -737,80 +819,120 @@ public Mono> listByResourceGroupSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return service - .listByResourceGroup( - this.client.getHost(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context); } /** - * Lists all the disks under a resource group. + * Gets information about a disk. * * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return information about a disk. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String diskName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Lists all the disks under a resource group. + * Gets information about a disk. * * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return information about a disk. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String diskName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Lists all the disks under a resource group. + * Gets information about a disk. * * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return information about a disk. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner getByResourceGroup(String resourceGroupName, String diskName) { + return getByResourceGroupAsync(resourceGroupName, diskName).block(); } /** - * Lists all the disks under a subscription. + * Gets information about a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner getByResourceGroup(String resourceGroupName, String diskName, Context context) { + return getByResourceGroupAsync(resourceGroupName, diskName, context).block(); + } + + /** + * Deletes a disk. * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, String diskName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -818,36 +940,48 @@ public Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Lists all the disks under a subscription. + * Deletes a disk. * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String diskName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -855,76 +989,493 @@ public Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return service - .list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context); } /** - * Lists all the disks under a subscription. + * Deletes a disk. * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete(String resourceGroupName, String diskName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists all the disks under a subscription. + * Deletes a disk. * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete(String resourceGroupName, String diskName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists all the disks under a subscription. + * Deletes a disk. * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Disks operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String diskName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Grants access to a disk. + * Deletes a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 disk access SAS uri. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + public Mono deleteAsync(String resourceGroupName, String diskName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskName) { + deleteAsync(resourceGroupName, diskName).block(); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskName, Context context) { + deleteAsync(resourceGroupName, diskName, context).block(); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return service + .listByResourceGroup( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the disks under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the disks under 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 the List Disks operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + grantAccessData, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, 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 @@ -946,19 +1497,62 @@ public Mono>> grantAccessWithResponseAsync( grantAccessData.validate(); } final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .grantAccess( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - grantAccessData, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + grantAccessData, + context); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AccessUriInner> beginGrantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class); } /** @@ -976,7 +1570,7 @@ public Mono>> grantAccessWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono grantAccessAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - Mono>> mono = + Mono>> mono = grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData); return this .client @@ -986,6 +1580,32 @@ public Mono grantAccessAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono grantAccessAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Grants access to a disk. * @@ -1003,50 +1623,194 @@ public AccessUriInner grantAccess(String resourceGroupName, String diskName, Gra return grantAccessAsync(resourceGroupName, diskName, grantAccessData).block(); } + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + return grantAccessAsync(resourceGroupName, diskName, grantAccessData, context).block(); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> revokeAccessWithResponseAsync(String resourceGroupName, String diskName) { + 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, String diskName, 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 (diskName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskName, + apiVersion, + context); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRevokeAccess(String resourceGroupName, String diskName) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRevokeAccess( + String resourceGroupName, String diskName, Context context) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono revokeAccessAsync(String resourceGroupName, String diskName) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Revokes access to a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> revokeAccessWithResponseAsync( - String resourceGroupName, String diskName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .revokeAccess( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono revokeAccessAsync(String resourceGroupName, String diskName, Context context) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -1058,16 +1822,10 @@ public Mono>> revokeAccessWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono revokeAccessAsync(String resourceGroupName, String diskName) { - Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, diskName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public void revokeAccess(String resourceGroupName, String diskName) { + revokeAccessAsync(resourceGroupName, diskName).block(); } /** @@ -1076,13 +1834,14 @@ public Mono revokeAccessAsync(String resourceGroupName, String diskName) { * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 revokeAccess(String resourceGroupName, String diskName) { - revokeAccessAsync(resourceGroupName, diskName).block(); + public void revokeAccess(String resourceGroupName, String diskName, Context context) { + revokeAccessAsync(resourceGroupName, diskName, context).block(); } /** @@ -1098,11 +1857,13 @@ public void revokeAccess(String resourceGroupName, String diskName) { * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, DiskInner disk) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1127,8 +1888,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1152,11 +1913,13 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, DiskInner disk, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1178,8 +1941,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1201,10 +1964,38 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, diskName, disk) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String diskName, DiskInner disk) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk 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 disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1226,8 +2017,27 @@ public Mono beginCreateOrUpdateAsync(String resourceGroupName, String * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginCreateOrUpdate(String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk).block(); + public DiskInner beginCreateOrUpdateWithoutPolling(String resourceGroupName, String diskName, DiskInner disk) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskName, disk).block(); + } + + /** + * Creates or updates a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk 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 disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String diskName, DiskInner disk, Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskName, disk, context).block(); } /** @@ -1243,11 +2053,13 @@ public DiskInner beginCreateOrUpdate(String resourceGroupName, String diskName, * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, DiskUpdate disk) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1272,8 +2084,8 @@ public Mono> beginUpdateWithResponseAsync( .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1297,11 +2109,13 @@ public Mono> beginUpdateWithResponseAsync( * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1323,8 +2137,8 @@ public Mono> beginUpdateWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1346,10 +2160,37 @@ public Mono> beginUpdateWithResponseAsync( * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateWithResponseAsync(resourceGroupName, diskName, disk) + public Mono beginUpdateWithoutPollingAsync(String resourceGroupName, String diskName, DiskUpdate disk) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1371,8 +2212,27 @@ public Mono beginUpdateAsync(String resourceGroupName, String diskNam * @return disk resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginUpdate(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateAsync(resourceGroupName, diskName, disk).block(); + public DiskInner beginUpdateWithoutPolling(String resourceGroupName, String diskName, DiskUpdate disk) { + return beginUpdateWithoutPollingAsync(resourceGroupName, diskName, disk).block(); + } + + /** + * Updates (patches) a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param disk Disk update 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 disk resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskInner beginUpdateWithoutPolling( + String resourceGroupName, String diskName, DiskUpdate disk, Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, diskName, disk, context).block(); } /** @@ -1387,10 +2247,12 @@ public DiskInner beginUpdate(String resourceGroupName, String diskName, DiskUpda * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String diskName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String diskName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1410,8 +2272,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1433,11 +2295,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1454,8 +2318,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1475,8 +2339,42 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String diskName) { - return beginDeleteWithResponseAsync(resourceGroupName, diskName).flatMap((Response res) -> Mono.empty()); + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String diskName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String diskName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginDeleteWithoutPolling(String resourceGroupName, String diskName) { + beginDeleteWithoutPollingAsync(resourceGroupName, diskName).block(); } /** @@ -1485,13 +2383,14 @@ public Mono beginDeleteAsync(String resourceGroupName, String diskName) { * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 beginDelete(String resourceGroupName, String diskName) { - beginDeleteAsync(resourceGroupName, diskName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String diskName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, diskName, context).block(); } /** @@ -1507,11 +2406,13 @@ public void beginDelete(String resourceGroupName, String diskName) { * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithResponseAsync( + public Mono> beginGrantAccessWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1537,8 +2438,8 @@ public Mono> beginGrantAccessWithResponseAsync( .withContext( context -> service - .beginGrantAccess( - this.client.getHost(), + .beginGrantAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1562,11 +2463,13 @@ public Mono> beginGrantAccessWithResponseAsync( * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithResponseAsync( + public Mono> beginGrantAccessWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1589,8 +2492,8 @@ public Mono> beginGrantAccessWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginGrantAccess( - this.client.getHost(), + .beginGrantAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1612,11 +2515,38 @@ public Mono> beginGrantAccessWithResponseAsync( * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessAsync( + public Mono beginGrantAccessWithoutPollingAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessWithResponseAsync(resourceGroupName, diskName, grantAccessData) + return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, grantAccessData) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginGrantAccessWithoutPollingAsync( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, grantAccessData, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1638,8 +2568,28 @@ public Mono beginGrantAccessAsync( * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData).block(); + public AccessUriInner beginGrantAccessWithoutPolling( + String resourceGroupName, String diskName, GrantAccessData grantAccessData) { + return beginGrantAccessWithoutPollingAsync(resourceGroupName, diskName, grantAccessData).block(); + } + + /** + * Grants access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner beginGrantAccessWithoutPolling( + String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessWithoutPollingAsync(resourceGroupName, diskName, grantAccessData, context).block(); } /** @@ -1654,10 +2604,13 @@ public AccessUriInner beginGrantAccess(String resourceGroupName, String diskName * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithResponseAsync(String resourceGroupName, String diskName) { - if (this.client.getHost() == null) { + public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( + String resourceGroupName, String diskName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1677,8 +2630,8 @@ public Mono> beginRevokeAccessWithResponseAsync(String resourceGr .withContext( context -> service - .beginRevokeAccess( - this.client.getHost(), + .beginRevokeAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1700,11 +2653,13 @@ public Mono> beginRevokeAccessWithResponseAsync(String resourceGr * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithResponseAsync( + public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( String resourceGroupName, String diskName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1721,8 +2676,8 @@ public Mono> beginRevokeAccessWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginRevokeAccess( - this.client.getHost(), + .beginRevokeAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, @@ -1742,8 +2697,26 @@ public Mono> beginRevokeAccessWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRevokeAccessAsync(String resourceGroupName, String diskName) { - return beginRevokeAccessWithResponseAsync(resourceGroupName, diskName) + public Mono beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String diskName) { + return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String diskName, Context context) { + return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1758,8 +2731,24 @@ public Mono beginRevokeAccessAsync(String resourceGroupName, String diskNa * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRevokeAccess(String resourceGroupName, String diskName) { - beginRevokeAccessAsync(resourceGroupName, diskName).block(); + public void beginRevokeAccessWithoutPolling(String resourceGroupName, String diskName) { + beginRevokeAccessWithoutPollingAsync(resourceGroupName, diskName).block(); + } + + /** + * Revokes access to a disk. + * + * @param resourceGroupName The name of the resource group. + * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is + * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginRevokeAccessWithoutPolling(String resourceGroupName, String diskName, Context context) { + beginRevokeAccessWithoutPollingAsync(resourceGroupName, diskName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleriesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleriesClient.java similarity index 59% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleriesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleriesClient.java index cf18829b097e..4845247f1522 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleriesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleriesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,13 +25,17 @@ 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.http.rest.SimpleResponse; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.ApiErrorException; -import com.azure.management.compute.GalleryUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.GalleryInner; +import com.azure.management.compute.fluent.inner.GalleryListInner; +import com.azure.management.compute.models.ApiErrorException; +import com.azure.management.compute.models.GalleryUpdate; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -40,22 +44,22 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in Galleries. */ -public final class GalleriesInner +public final class GalleriesClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(GalleriesInner.class); + private final ClientLogger logger = new ClientLogger(GalleriesClient.class); /** The proxy service used to perform REST calls. */ private final GalleriesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of GalleriesInner. + * Initializes an instance of GalleriesClient. * * @param client the instance of the service client containing this operation class. */ - GalleriesInner(ComputeManagementClientImpl client) { + public GalleriesClient(ComputeManagementClient client) { this.service = RestProxy.create(GalleriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -74,8 +78,8 @@ private interface GalleriesService { + "/{galleryName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -89,8 +93,8 @@ Mono>> createOrUpdate( + "/{galleryName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -104,8 +108,8 @@ Mono>> update( + "/{galleryName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -118,8 +122,8 @@ Mono> getByResourceGroup( + "/{galleryName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -130,8 +134,8 @@ Mono>> delete( @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -141,8 +145,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, Context context); @@ -153,8 +157,8 @@ Mono> list( + "/{galleryName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -168,8 +172,8 @@ Mono> beginCreateOrUpdate( + "/{galleryName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -183,8 +187,8 @@ Mono> beginUpdate( + "/{galleryName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -195,14 +199,14 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -219,11 +223,13 @@ Mono> listNext( * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String galleryName, GalleryInner gallery) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -249,7 +255,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -259,6 +265,105 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String galleryName, GalleryInner gallery, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (gallery == null) { + return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); + } else { + gallery.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + context); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class); + } + /** * Create or update a Shared Image Gallery. * @@ -273,7 +378,7 @@ public Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery); return this .client @@ -283,6 +388,32 @@ public Mono createOrUpdateAsync(String resourceGroupName, String g .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Create or update a Shared Image Gallery. * @@ -300,6 +431,25 @@ public GalleryInner createOrUpdate(String resourceGroupName, String galleryName, return createOrUpdateAsync(resourceGroupName, galleryName, gallery).block(); } + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner createOrUpdate( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, gallery, context).block(); + } + /** * Update a Shared Image Gallery. * @@ -313,11 +463,13 @@ public GalleryInner createOrUpdate(String resourceGroupName, String galleryName, * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono>> updateWithResponseAsync( String resourceGroupName, String galleryName, GalleryUpdate gallery) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -343,7 +495,7 @@ public Mono>> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -353,6 +505,104 @@ public Mono>> updateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (gallery == null) { + return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); + } else { + gallery.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + gallery, + context); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, gallery); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryInner> beginUpdate( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, gallery, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class); + } + /** * Update a Shared Image Gallery. * @@ -367,7 +617,33 @@ public Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, gallery); + Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, gallery); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryInner.class, GalleryInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, gallery, context); return this .client .getLroResultAsync( @@ -389,26 +665,214 @@ public Mono updateAsync(String resourceGroupName, String galleryNa * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return updateAsync(resourceGroupName, galleryName, gallery).block(); + public GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery) { + return updateAsync(resourceGroupName, galleryName, gallery).block(); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + return updateAsync(resourceGroupName, galleryName, gallery, context).block(); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String galleryName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + apiVersion, + context); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String galleryName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String galleryName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner getByResourceGroup(String resourceGroupName, String galleryName) { + return getByResourceGroupAsync(resourceGroupName, galleryName).block(); + } + + /** + * Retrieves information about a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner getByResourceGroup(String resourceGroupName, String galleryName, Context context) { + return getByResourceGroupAsync(resourceGroupName, galleryName, context).block(); } /** - * Retrieves information about a Shared Image Gallery. + * Delete a Shared Image Gallery. * * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. + * @param galleryName The name of the Shared Image Gallery to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String galleryName) { - if (this.client.getHost() == null) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -428,8 +892,8 @@ public Mono> getByResourceGroupWithResponseAsync( .withContext( context -> service - .getByResourceGroup( - this.client.getHost(), + .delete( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -439,22 +903,24 @@ public Mono> getByResourceGroupWithResponseAsync( } /** - * Retrieves information about a Shared Image Gallery. + * Delete a Shared Image Gallery. * * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. + * @param galleryName The name of the Shared Image Gallery to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String galleryName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -471,8 +937,8 @@ public Mono> getByResourceGroupWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .getByResourceGroup( - this.client.getHost(), + .delete( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -481,41 +947,37 @@ public Mono> getByResourceGroupWithResponseAsync( } /** - * Retrieves information about a Shared Image Gallery. + * Delete a Shared Image Gallery. * * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. + * @param galleryName The name of the Shared Image Gallery to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String galleryName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, galleryName) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, Void> beginDelete(String resourceGroupName, String galleryName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Retrieves information about a Shared Image Gallery. + * Delete a Shared Image Gallery. * * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner getByResourceGroup(String resourceGroupName, String galleryName) { - return getByResourceGroupAsync(resourceGroupName, galleryName).block(); + public PollerFlux, Void> beginDelete( + String resourceGroupName, String galleryName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** @@ -529,38 +991,13 @@ public GalleryInner getByResourceGroup(String resourceGroupName, String galleryN * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono deleteAsync(String resourceGroupName, String galleryName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -568,14 +1005,15 @@ public Mono>> deleteWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String galleryName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName); + public Mono deleteAsync(String resourceGroupName, String galleryName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -597,6 +1035,21 @@ public void delete(String resourceGroupName, String galleryName) { deleteAsync(resourceGroupName, galleryName).block(); } + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, Context context) { + deleteAsync(resourceGroupName, galleryName, context).block(); + } + /** * List galleries under a resource group. * @@ -608,9 +1061,11 @@ public void delete(String resourceGroupName, String galleryName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -628,7 +1083,7 @@ public Mono> listByResourceGroupSinglePageAsync(Stri context -> service .listByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, @@ -658,9 +1113,11 @@ public Mono> listByResourceGroupSinglePageAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -675,7 +1132,7 @@ public Mono> listByResourceGroupSinglePageAsync( final String apiVersion = "2019-07-01"; return service .listByResourceGroup( - this.client.getHost(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) .map( res -> new PagedResponseBase<>( @@ -734,6 +1191,21 @@ public PagedIterable listByResourceGroup(String resourceGroupName) return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } + /** + * List galleries under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + /** * List galleries under a subscription. * @@ -743,9 +1215,11 @@ public PagedIterable listByResourceGroup(String resourceGroupName) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -756,7 +1230,8 @@ public Mono> listSinglePageAsync() { final String apiVersion = "2019-07-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context)) + context -> + service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context)) .>map( res -> new PagedResponseBase<>( @@ -780,9 +1255,11 @@ public Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -792,7 +1269,7 @@ public Mono> listSinglePageAsync(Context context) { } final String apiVersion = "2019-07-01"; return service - .list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( res -> new PagedResponseBase<>( @@ -842,6 +1319,20 @@ public PagedIterable list() { return new PagedIterable<>(listAsync()); } + /** + * List galleries under a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Galleries operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Create or update a Shared Image Gallery. * @@ -855,11 +1346,13 @@ public PagedIterable list() { * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, GalleryInner gallery) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -884,8 +1377,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -909,11 +1402,13 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -935,8 +1430,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -958,11 +1453,38 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, galleryName, gallery) + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -984,8 +1506,28 @@ public Mono beginCreateOrUpdateAsync( * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginCreateOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery).block(); + public GalleryInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String galleryName, GalleryInner gallery) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery).block(); + } + + /** + * Create or update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery, context).block(); } /** @@ -1001,11 +1543,13 @@ public GalleryInner beginCreateOrUpdate(String resourceGroupName, String gallery * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, GalleryUpdate gallery) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1030,8 +1574,8 @@ public Mono> beginUpdateWithResponseAsync( .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1055,11 +1599,13 @@ public Mono> beginUpdateWithResponseAsync( * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1081,8 +1627,8 @@ public Mono> beginUpdateWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1104,10 +1650,38 @@ public Mono> beginUpdateWithResponseAsync( * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateWithResponseAsync(resourceGroupName, galleryName, gallery) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1129,8 +1703,27 @@ public Mono beginUpdateAsync(String resourceGroupName, String gall * @return specifies information about the Shared Image Gallery that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginUpdate(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateAsync(resourceGroupName, galleryName, gallery).block(); + public GalleryInner beginUpdateWithoutPolling(String resourceGroupName, String galleryName, GalleryUpdate gallery) { + return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery).block(); + } + + /** + * Update a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with + * dots and periods allowed in the middle. The maximum length is 80 characters. + * @param gallery Specifies information about the Shared Image Gallery that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the Shared Image Gallery that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryInner beginUpdateWithoutPolling( + String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery, context).block(); } /** @@ -1144,10 +1737,13 @@ public GalleryInner beginUpdate(String resourceGroupName, String galleryName, Ga * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String galleryName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync( + String resourceGroupName, String galleryName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1167,8 +1763,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1189,11 +1785,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1210,8 +1808,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1230,8 +1828,25 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String galleryName) { - return beginDeleteWithResponseAsync(resourceGroupName, galleryName) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String galleryName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String galleryName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1245,8 +1860,23 @@ public Mono beginDeleteAsync(String resourceGroupName, String galleryName) * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String galleryName) { - beginDeleteAsync(resourceGroupName, galleryName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String galleryName) { + beginDeleteWithoutPollingAsync(resourceGroupName, galleryName).block(); + } + + /** + * Delete a Shared Image Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String galleryName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryApplicationVersionsClient.java similarity index 59% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryApplicationVersionsClient.java index d79d52fb99fb..4caeb81f0227 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryApplicationVersionsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,34 +25,38 @@ 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.http.rest.SimpleResponse; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.ApiErrorException; -import com.azure.management.compute.GalleryApplicationVersionUpdate; -import com.azure.management.compute.ReplicationStatusTypes; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.GalleryApplicationVersionInner; +import com.azure.management.compute.fluent.inner.GalleryApplicationVersionListInner; +import com.azure.management.compute.models.ApiErrorException; +import com.azure.management.compute.models.GalleryApplicationVersionUpdate; +import com.azure.management.compute.models.ReplicationStatusTypes; 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 GalleryApplicationVersions. */ -public final class GalleryApplicationVersionsInner { - private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionsInner.class); +public final class GalleryApplicationVersionsClient { + private final ClientLogger logger = new ClientLogger(GalleryApplicationVersionsClient.class); /** The proxy service used to perform REST calls. */ private final GalleryApplicationVersionsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of GalleryApplicationVersionsInner. + * Initializes an instance of GalleryApplicationVersionsClient. * * @param client the instance of the service client containing this operation class. */ - GalleryApplicationVersionsInner(ComputeManagementClientImpl client) { + public GalleryApplicationVersionsClient(ComputeManagementClient client) { this.service = RestProxy .create( @@ -73,8 +77,8 @@ private interface GalleryApplicationVersionsService { + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -90,8 +94,8 @@ Mono>> createOrUpdate( + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -107,8 +111,8 @@ Mono>> update( + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -124,8 +128,8 @@ Mono> get( + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -140,8 +144,8 @@ Mono>> delete( + "/{galleryName}/applications/{galleryApplicationName}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryApplication( - @HostParam("$host") String host, + Mono> listByGalleryApplication( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -155,8 +159,8 @@ Mono> listByGalleryApplicatio + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -172,8 +176,8 @@ Mono> beginCreateOrUpdate( + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -189,8 +193,8 @@ Mono> beginUpdate( + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -203,7 +207,7 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryApplicationNext( + Mono> listByGalleryApplicationNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -225,15 +229,17 @@ Mono> listByGalleryApplicatio * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionInner galleryApplicationVersion) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -273,7 +279,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -285,6 +291,167 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + if (galleryApplicationVersion == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersion is required and cannot be null.")); + } else { + galleryApplicationVersion.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + context); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryApplicationVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class); + } + /** * Create or update a gallery Application Version. * @@ -309,7 +476,7 @@ public Mono createOrUpdateAsync( String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionInner galleryApplicationVersion) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync( resourceGroupName, galleryName, @@ -327,6 +494,51 @@ public Mono createOrUpdateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Create or update a gallery Application Version. * @@ -360,6 +572,42 @@ public GalleryApplicationVersionInner createOrUpdate( .block(); } + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .block(); + } + /** * Update a gallery Application Version. * @@ -378,15 +626,17 @@ public GalleryApplicationVersionInner createOrUpdate( * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono>> updateWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -426,7 +676,7 @@ public Mono>> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -438,6 +688,254 @@ public Mono>> updateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + if (galleryApplicationVersion == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersion is required and cannot be null.")); + } else { + galleryApplicationVersion.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + galleryApplicationVersion, + context); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryApplicationVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + GalleryApplicationVersionInner.class, + GalleryApplicationVersionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Update a gallery Application Version. * @@ -456,28 +954,19 @@ public Mono>> updateWithResponseAsync( * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( + public GalleryApplicationVersionInner update( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) { - Mono>> mono = - updateWithResponseAsync( + return updateAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, - galleryApplicationVersion); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - GalleryApplicationVersionInner.class, - GalleryApplicationVersionInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + galleryApplicationVersion) + .block(); } /** @@ -492,6 +981,7 @@ public Mono updateAsync( * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to * update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -503,13 +993,15 @@ public GalleryApplicationVersionInner update( String galleryName, String galleryApplicationName, String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { return updateAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, - galleryApplicationVersion) + galleryApplicationVersion, + context) .block(); } @@ -528,15 +1020,17 @@ public GalleryApplicationVersionInner update( * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, ReplicationStatusTypes expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -568,7 +1062,7 @@ public Mono> getWithResponseAsync context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -596,16 +1090,18 @@ public Mono> getWithResponseAsync * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, ReplicationStatusTypes expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -634,7 +1130,7 @@ public Mono> getWithResponseAsync final String apiVersion = "2019-07-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -669,7 +1165,42 @@ public Mono getAsync( return getWithResponseAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -702,7 +1233,7 @@ public Mono getAsync( return getWithResponseAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -736,6 +1267,34 @@ public GalleryApplicationVersionInner get( .block(); } + /** + * Retrieves information about a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved. + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner get( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + ReplicationStatusTypes expand, + Context context) { + return getAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand, context) + .block(); + } + /** * Retrieves information about a gallery Application Version. * @@ -775,14 +1334,16 @@ public GalleryApplicationVersionInner get( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -814,7 +1375,7 @@ public Mono>> deleteWithResponseAsync( context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -825,6 +1386,182 @@ public Mono>> deleteWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplicationVersionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter galleryApplicationVersionName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + apiVersion, + context); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Delete a gallery Application Version. * @@ -836,22 +1573,14 @@ public Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( + public void delete( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName) { - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + deleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).block(); } /** @@ -862,6 +1591,7 @@ public Mono deleteAsync( * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version * resides. * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -871,8 +1601,10 @@ public void delete( String resourceGroupName, String galleryName, String galleryApplicationName, - String galleryApplicationVersionName) { - deleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).block(); + String galleryApplicationVersionName, + Context context) { + deleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) + .block(); } /** @@ -890,9 +1622,11 @@ public void delete( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGalleryApplicationSinglePageAsync( String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -918,7 +1652,7 @@ public Mono> listByGalleryApplicat context -> service .listByGalleryApplication( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -953,9 +1687,11 @@ public Mono> listByGalleryApplicat @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGalleryApplicationSinglePageAsync( String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -978,7 +1714,7 @@ public Mono> listByGalleryApplicat final String apiVersion = "2019-07-01"; return service .listByGalleryApplication( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1058,6 +1794,26 @@ public PagedIterable listByGalleryApplication( listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName)); } + /** + * List gallery Application Versions in a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the + * Application Versions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Application version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryApplication( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return new PagedIterable<>( + listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName, context)); + } + /** * Create or update a gallery Application Version. * @@ -1076,15 +1832,17 @@ public PagedIterable listByGalleryApplication( * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionInner galleryApplicationVersion) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1123,8 +1881,8 @@ public Mono> beginCreateOrUpdateW .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1155,16 +1913,18 @@ public Mono> beginCreateOrUpdateW * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionInner galleryApplicationVersion, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1200,8 +1960,8 @@ public Mono> beginCreateOrUpdateW } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1230,20 +1990,63 @@ public Mono> beginCreateOrUpdateW * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateWithResponseAsync( + return beginCreateOrUpdateWithoutPollingWithResponseAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1270,13 +2073,13 @@ public Mono beginCreateOrUpdateAsync( * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginCreateOrUpdate( + public GalleryApplicationVersionInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateAsync( + return beginCreateOrUpdateWithoutPollingAsync( resourceGroupName, galleryName, galleryApplicationName, @@ -1285,6 +2088,42 @@ public GalleryApplicationVersionInner beginCreateOrUpdate( .block(); } + /** + * Create or update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be created. + * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionInner galleryApplicationVersion, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .block(); + } + /** * Update a gallery Application Version. * @@ -1303,15 +2142,17 @@ public GalleryApplicationVersionInner beginCreateOrUpdate( * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1350,8 +2191,8 @@ public Mono> beginUpdateWithRespo .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1382,16 +2223,18 @@ public Mono> beginUpdateWithRespo * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1427,8 +2270,8 @@ public Mono> beginUpdateWithRespo } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1457,20 +2300,63 @@ public Mono> beginUpdateWithRespo * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateWithResponseAsync( + return beginUpdateWithoutPollingWithResponseAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1497,13 +2383,13 @@ public Mono beginUpdateAsync( * @return specifies information about the gallery Application Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginUpdate( + public GalleryApplicationVersionInner beginUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateAsync( + return beginUpdateWithoutPollingAsync( resourceGroupName, galleryName, galleryApplicationName, @@ -1512,6 +2398,42 @@ public GalleryApplicationVersionInner beginUpdate( .block(); } + /** + * Update a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is + * to be updated. + * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow + * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range + * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationVersionInner beginUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + GalleryApplicationVersionUpdate galleryApplicationVersion, + Context context) { + return beginUpdateWithoutPollingAsync( + resourceGroupName, + galleryName, + galleryApplicationName, + galleryApplicationVersionName, + galleryApplicationVersion, + context) + .block(); + } + /** * Delete a gallery Application Version. * @@ -1526,14 +2448,16 @@ public GalleryApplicationVersionInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1564,8 +2488,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1591,15 +2515,17 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1627,8 +2553,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1652,16 +2578,42 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync( + public Mono beginDeleteWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName) { - return beginDeleteWithResponseAsync( + return beginDeleteWithoutPollingWithResponseAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) .flatMap((Response res) -> Mono.empty()); } + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + return beginDeleteWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) + .flatMap((Response res) -> Mono.empty()); + } + /** * Delete a gallery Application Version. * @@ -1675,12 +2627,39 @@ public Mono beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete( + public void beginDeleteWithoutPolling( String resourceGroupName, String galleryName, String galleryApplicationName, String galleryApplicationVersionName) { - beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName).block(); + beginDeleteWithoutPollingAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) + .block(); + } + + /** + * Delete a gallery Application Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. + * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version + * resides. + * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 beginDeleteWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + String galleryApplicationVersionName, + Context context) { + beginDeleteWithoutPollingAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) + .block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryApplicationsClient.java similarity index 57% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryApplicationsClient.java index 3eb83641e4d7..a2a049ce5e3f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryApplicationsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,33 +25,37 @@ 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.http.rest.SimpleResponse; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.ApiErrorException; -import com.azure.management.compute.GalleryApplicationUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.GalleryApplicationInner; +import com.azure.management.compute.fluent.inner.GalleryApplicationListInner; +import com.azure.management.compute.models.ApiErrorException; +import com.azure.management.compute.models.GalleryApplicationUpdate; 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 GalleryApplications. */ -public final class GalleryApplicationsInner { - private final ClientLogger logger = new ClientLogger(GalleryApplicationsInner.class); +public final class GalleryApplicationsClient { + private final ClientLogger logger = new ClientLogger(GalleryApplicationsClient.class); /** The proxy service used to perform REST calls. */ private final GalleryApplicationsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of GalleryApplicationsInner. + * Initializes an instance of GalleryApplicationsClient. * * @param client the instance of the service client containing this operation class. */ - GalleryApplicationsInner(ComputeManagementClientImpl client) { + public GalleryApplicationsClient(ComputeManagementClient client) { this.service = RestProxy.create(GalleryApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -70,8 +74,8 @@ private interface GalleryApplicationsService { + "/{galleryName}/applications/{galleryApplicationName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -86,8 +90,8 @@ Mono>> createOrUpdate( + "/{galleryName}/applications/{galleryApplicationName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -102,8 +106,8 @@ Mono>> update( + "/{galleryName}/applications/{galleryApplicationName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -117,8 +121,8 @@ Mono> get( + "/{galleryName}/applications/{galleryApplicationName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -132,8 +136,8 @@ Mono>> delete( + "/{galleryName}/applications") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGallery( - @HostParam("$host") String host, + Mono> listByGallery( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -146,8 +150,8 @@ Mono> listByGallery( + "/{galleryName}/applications/{galleryApplicationName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -162,8 +166,8 @@ Mono> beginCreateOrUpdate( + "/{galleryName}/applications/{galleryApplicationName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -178,8 +182,8 @@ Mono> beginUpdate( + "/{galleryName}/applications/{galleryApplicationName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -191,7 +195,7 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryNext( + Mono> listByGalleryNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -212,14 +216,16 @@ Mono> listByGalleryNext( * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationInner galleryApplication) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -251,7 +257,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -273,25 +279,90 @@ public Mono>> createOrUpdateWithResponseAsync( * maximum length is 80 characters. * @param galleryApplication Specifies information about the gallery Application Definition that you want to create * or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + if (galleryApplication == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); + } else { + galleryApplication.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + context); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to create + * or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryApplicationInner> beginCreateOrUpdate( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationInner galleryApplication) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); return this .client .getLroResultAsync( - mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class); } /** @@ -305,109 +376,87 @@ public Mono createOrUpdateAsync( * maximum length is 80 characters. * @param galleryApplication Specifies information about the gallery Application Definition that you want to create * or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner createOrUpdate( + public PollerFlux, GalleryApplicationInner> beginCreateOrUpdate( String resourceGroupName, String galleryName, String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return createOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); + GalleryApplicationInner galleryApplication, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class); } /** - * Update a gallery Application Definition. + * Create or update a gallery Application Definition. * * @param resourceGroupName The name of the resource group. * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to create + * or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono createOrUpdateAsync( String resourceGroupName, String galleryName, String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + GalleryApplicationInner galleryApplication) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Update a gallery Application Definition. + * Create or update a gallery Application Definition. * * @param resourceGroupName The name of the resource group. * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to create + * or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( + public Mono createOrUpdateAsync( String resourceGroupName, String galleryName, String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); + GalleryApplicationInner galleryApplication, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); return this .client .getLroResultAsync( @@ -417,47 +466,84 @@ public Mono updateAsync( } /** - * Update a gallery Application Definition. + * Create or update a gallery Application Definition. * * @param resourceGroupName The name of the resource group. * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to create + * or update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner update( + public GalleryApplicationInner createOrUpdate( String resourceGroupName, String galleryName, String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return updateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); + GalleryApplicationInner galleryApplication) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); } /** - * Retrieves information about a gallery Application Definition. + * Create or update a gallery Application Definition. * * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to create + * or update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getHost() == null) { + public GalleryApplicationInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .block(); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -477,29 +563,39 @@ public Mono> getWithResponseAsync( .error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } + if (galleryApplication == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); + } else { + galleryApplication.validate(); + } final String apiVersion = "2019-07-01"; return FluxUtil .withContext( context -> service - .get( - this.client.getHost(), + .update( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryApplicationName, apiVersion, + galleryApplication, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Retrieves information about a gallery Application Definition. + * Update a gallery Application Definition. * * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be - * retrieved. - * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. @@ -507,11 +603,17 @@ public Mono> getWithResponseAsync( * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - if (this.client.getHost() == null) { + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -531,11 +633,301 @@ public Mono> getWithResponseAsync( .error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } - final String apiVersion = "2019-07-01"; - return service - .get( - this.client.getHost(), - this.client.getSubscriptionId(), + if (galleryApplication == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); + } else { + galleryApplication.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + galleryApplication, + context); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryApplicationInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryApplicationInner.class, GalleryApplicationInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication) { + return updateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner update( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + return updateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context).block(); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryApplicationName, @@ -560,7 +952,34 @@ public Mono getAsync( String resourceGroupName, String galleryName, String galleryApplicationName) { return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -579,11 +998,178 @@ public Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName) { + return getAsync(resourceGroupName, galleryName, galleryApplicationName).block(); + } + + /** + * Retrieves information about a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be + * retrieved. + * @param galleryApplicationName The name of the gallery Application Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner get( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return getAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryApplicationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryApplicationName, + apiVersion, + context); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName) { - return getAsync(resourceGroupName, galleryName, galleryApplicationName).block(); + public PollerFlux, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** @@ -599,44 +1185,14 @@ public GalleryApplicationInner get(String resourceGroupName, String galleryName, * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -646,15 +1202,17 @@ public Mono>> deleteWithResponseAsync( * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be * deleted. * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName); + public Mono deleteAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -678,6 +1236,23 @@ public void delete(String resourceGroupName, String galleryName, String galleryA deleteAsync(resourceGroupName, galleryName, galleryApplicationName).block(); } + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, String galleryApplicationName, Context context) { + deleteAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); + } + /** * List gallery Application Definitions in a gallery. * @@ -692,9 +1267,11 @@ public void delete(String resourceGroupName, String galleryName, String galleryA @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGallerySinglePageAsync( String resourceGroupName, String galleryName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -715,7 +1292,7 @@ public Mono> listByGallerySinglePageAsync context -> service .listByGallery( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -748,9 +1325,11 @@ public Mono> listByGallerySinglePageAsync @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGallerySinglePageAsync( String resourceGroupName, String galleryName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -768,7 +1347,7 @@ public Mono> listByGallerySinglePageAsync final String apiVersion = "2019-07-01"; return service .listByGallery( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -839,6 +1418,24 @@ public PagedIterable listByGallery(String resourceGroup return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName)); } + /** + * List gallery Application Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Applications operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery( + String resourceGroupName, String galleryName, Context context) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); + } + /** * Create or update a gallery Application Definition. * @@ -856,14 +1453,16 @@ public PagedIterable listByGallery(String resourceGroup * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationInner galleryApplication) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -894,8 +1493,8 @@ public Mono> beginCreateOrUpdateWithResp .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -924,15 +1523,17 @@ public Mono> beginCreateOrUpdateWithResp * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationInner galleryApplication, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -960,8 +1561,8 @@ public Mono> beginCreateOrUpdateWithResp } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -988,15 +1589,51 @@ public Mono> beginCreateOrUpdateWithResp * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateWithResponseAsync( + return beginCreateOrUpdateWithoutPollingWithResponseAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplication) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to create + * or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1022,12 +1659,42 @@ public Mono beginCreateOrUpdateAsync( * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginCreateOrUpdate( + public GalleryApplicationInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + .block(); + } + + /** + * Create or update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * created. + * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The + * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + * maximum length is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to create + * or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationInner galleryApplication, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) .block(); } @@ -1047,14 +1714,16 @@ public GalleryApplicationInner beginCreateOrUpdate( * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationUpdate galleryApplication) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1085,8 +1754,8 @@ public Mono> beginUpdateWithResponseAsyn .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1114,15 +1783,17 @@ public Mono> beginUpdateWithResponseAsyn * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationUpdate galleryApplication, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1150,8 +1821,8 @@ public Mono> beginUpdateWithResponseAsyn } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1177,14 +1848,50 @@ public Mono> beginUpdateWithResponseAsyn * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationUpdate galleryApplication) { - return beginUpdateWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1209,12 +1916,42 @@ public Mono beginUpdateAsync( * @return specifies information about the gallery Application Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginUpdate( + public GalleryApplicationInner beginUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryApplicationName, GalleryApplicationUpdate galleryApplication) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication).block(); + return beginUpdateWithoutPollingAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + .block(); + } + + /** + * Update a gallery Application Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * updated. + * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed + * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length + * is 80 characters. + * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Application Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryApplicationInner beginUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryApplicationName, + GalleryApplicationUpdate galleryApplication, + Context context) { + return beginUpdateWithoutPollingAsync( + resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) + .block(); } /** @@ -1230,11 +1967,13 @@ public GalleryApplicationInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1259,8 +1998,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1284,11 +2023,13 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1310,8 +2051,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1333,8 +2074,30 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName) { - return beginDeleteWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String galleryName, String galleryApplicationName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryApplicationName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1350,8 +2113,26 @@ public Mono beginDeleteAsync(String resourceGroupName, String galleryName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String galleryName, String galleryApplicationName) { - beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String galleryName, String galleryApplicationName) { + beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryApplicationName).block(); + } + + /** + * Delete a gallery Application. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be + * deleted. + * @param galleryApplicationName The name of the gallery Application Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 beginDeleteWithoutPolling( + String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryImageVersionsClient.java similarity index 59% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryImageVersionsClient.java index cfde61656316..42a665da9892 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryImageVersionsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,34 +25,38 @@ 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.http.rest.SimpleResponse; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.ApiErrorException; -import com.azure.management.compute.GalleryImageVersionUpdate; -import com.azure.management.compute.ReplicationStatusTypes; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.GalleryImageVersionInner; +import com.azure.management.compute.fluent.inner.GalleryImageVersionListInner; +import com.azure.management.compute.models.ApiErrorException; +import com.azure.management.compute.models.GalleryImageVersionUpdate; +import com.azure.management.compute.models.ReplicationStatusTypes; 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 GalleryImageVersions. */ -public final class GalleryImageVersionsInner { - private final ClientLogger logger = new ClientLogger(GalleryImageVersionsInner.class); +public final class GalleryImageVersionsClient { + private final ClientLogger logger = new ClientLogger(GalleryImageVersionsClient.class); /** The proxy service used to perform REST calls. */ private final GalleryImageVersionsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of GalleryImageVersionsInner. + * Initializes an instance of GalleryImageVersionsClient. * * @param client the instance of the service client containing this operation class. */ - GalleryImageVersionsInner(ComputeManagementClientImpl client) { + public GalleryImageVersionsClient(ComputeManagementClient client) { this.service = RestProxy .create(GalleryImageVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -72,8 +76,8 @@ private interface GalleryImageVersionsService { + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -89,8 +93,8 @@ Mono>> createOrUpdate( + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -106,8 +110,8 @@ Mono>> update( + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -123,8 +127,8 @@ Mono> get( + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -139,8 +143,8 @@ Mono>> delete( + "/{galleryName}/images/{galleryImageName}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryImage( - @HostParam("$host") String host, + Mono> listByGalleryImage( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -154,8 +158,8 @@ Mono> listByGalleryImage( + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -171,8 +175,8 @@ Mono> beginCreateOrUpdate( + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -188,8 +192,8 @@ Mono> beginUpdate( + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -202,7 +206,7 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryImageNext( + Mono> listByGalleryImageNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -223,15 +227,17 @@ Mono> listByGalleryImageNext( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -267,7 +273,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -279,6 +285,150 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + if (galleryImageVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); + } else { + galleryImageVersion.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + context); + } + + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class); + } + + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageVersionInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class); + } + /** * Create or update a gallery Image Version. * @@ -302,43 +452,362 @@ public Mono createOrUpdateAsync( String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); return this .client .getLroResultAsync( - mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion) { + return createOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .block(); + } + + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + return createOrUpdateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .block(); + } + + /** + * Update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + if (galleryImageVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); + } else { + galleryImageVersion.validate(); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + if (galleryImageVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); + } else { + galleryImageVersion.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + galleryImageVersion, + context); + } + + /** + * Update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class); + } + + /** + * Update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageVersionInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class); } /** - * Create or update a gallery Image Version. + * Update a gallery Image Version. * * @param resourceGroupName The name of the resource group. * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic * version name pattern: The allowed characters are digit and period. Digits must be within the range of a * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner createOrUpdate( + public Mono updateAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return createOrUpdateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .block(); + GalleryImageVersionUpdate galleryImageVersion) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -351,66 +820,34 @@ public GalleryImageVersionInner createOrUpdate( * version name pattern: The allowed characters are digit and period. Digits must be within the range of a * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono updateAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + galleryImageVersion, + context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -429,21 +866,15 @@ public Mono>> updateWithResponseAsync( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( + public GalleryImageVersionInner update( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) { - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), GalleryImageVersionInner.class, GalleryImageVersionInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + return updateAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + .block(); } /** @@ -456,6 +887,7 @@ public Mono updateAsync( * version name pattern: The allowed characters are digit and period. Digits must be within the range of a * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -467,9 +899,10 @@ public GalleryImageVersionInner update( String galleryName, String galleryImageName, String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { + GalleryImageVersionUpdate galleryImageVersion, + Context context) { return updateAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) .block(); } @@ -487,15 +920,17 @@ public GalleryImageVersionInner update( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, ReplicationStatusTypes expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -525,7 +960,7 @@ public Mono> getWithResponseAsync( context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -552,16 +987,18 @@ public Mono> getWithResponseAsync( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, ReplicationStatusTypes expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -588,7 +1025,7 @@ public Mono> getWithResponseAsync( final String apiVersion = "2019-07-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -621,7 +1058,41 @@ public Mono getAsync( ReplicationStatusTypes expand) { return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -649,7 +1120,7 @@ public Mono getAsync( final Context context = null; return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -681,6 +1152,32 @@ public GalleryImageVersionInner get( return getAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand).block(); } + /** + * Retrieves information about a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be retrieved. + * @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 ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner get( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + ReplicationStatusTypes expand, + Context context) { + return getAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand, context) + .block(); + } + /** * Retrieves information about a gallery Image Version. * @@ -714,11 +1211,13 @@ public GalleryImageVersionInner get( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -748,7 +1247,7 @@ public Mono>> deleteWithResponseAsync( context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -759,6 +1258,112 @@ public Mono>> deleteWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Delete a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImageVersionName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + galleryImageVersionName, + apiVersion, + context); + } + + /** + * Delete a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Delete a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Delete a gallery Image Version. * @@ -774,7 +1379,7 @@ public Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - Mono>> mono = + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName); return this .client @@ -783,6 +1388,35 @@ public Mono deleteAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Delete a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Delete a gallery Image Version. * @@ -800,6 +1434,28 @@ public void delete( deleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).block(); } + /** + * Delete a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + deleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context).block(); + } + /** * List gallery Image Versions in a gallery Image Definition. * @@ -815,9 +1471,11 @@ public void delete( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGalleryImageSinglePageAsync( String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -842,7 +1500,7 @@ public Mono> listByGalleryImageSinglePag context -> service .listByGalleryImage( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -877,9 +1535,11 @@ public Mono> listByGalleryImageSinglePag @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGalleryImageSinglePageAsync( String resourceGroupName, String galleryName, String galleryImageName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -901,7 +1561,7 @@ public Mono> listByGalleryImageSinglePag final String apiVersion = "2019-07-01"; return service .listByGalleryImage( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -978,6 +1638,25 @@ public PagedIterable listByGalleryImage( return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName)); } + /** + * List gallery Image Versions in a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the Shared Image Gallery Image Definition from which the Image Versions are + * to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Image version operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryImage( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName, context)); + } + /** * Create or update a gallery Image Version. * @@ -995,15 +1674,17 @@ public PagedIterable listByGalleryImage( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1038,8 +1719,8 @@ public Mono> beginCreateOrUpdateWithRes .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1069,16 +1750,18 @@ public Mono> beginCreateOrUpdateWithRes * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1110,8 +1793,8 @@ public Mono> beginCreateOrUpdateWithRes } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1139,16 +1822,53 @@ public Mono> beginCreateOrUpdateWithRes * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateWithResponseAsync( + return beginCreateOrUpdateWithoutPollingWithResponseAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1174,17 +1894,47 @@ public Mono beginCreateOrUpdateAsync( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginCreateOrUpdate( + public GalleryImageVersionInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateAsync( + return beginCreateOrUpdateWithoutPollingAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .block(); } + /** + * Create or update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. + * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or + * update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionInner galleryImageVersion, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .block(); + } + /** * Update a gallery Image Version. * @@ -1201,15 +1951,17 @@ public GalleryImageVersionInner beginCreateOrUpdate( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1244,8 +1996,8 @@ public Mono> beginUpdateWithResponseAsy .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1274,16 +2026,18 @@ public Mono> beginUpdateWithResponseAsy * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1315,8 +2069,8 @@ public Mono> beginUpdateWithResponseAsy } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1343,16 +2097,52 @@ public Mono> beginUpdateWithResponseAsy * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateWithResponseAsync( + return beginUpdateWithoutPollingWithResponseAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1377,17 +2167,46 @@ public Mono beginUpdateAsync( * @return specifies information about the gallery Image Version that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginUpdate( + public GalleryImageVersionInner beginUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateAsync( + return beginUpdateWithoutPollingAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .block(); } + /** + * Update a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. + * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic + * version name pattern: The allowed characters are digit and period. Digits must be within the range of a + * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. + * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Version that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageVersionInner beginUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + GalleryImageVersionUpdate galleryImageVersion, + Context context) { + return beginUpdateWithoutPollingAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) + .block(); + } + /** * Delete a gallery Image Version. * @@ -1401,11 +2220,13 @@ public GalleryImageVersionInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1434,8 +2255,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1460,15 +2281,17 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1494,8 +2317,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1518,9 +2341,35 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync( + public Mono beginDeleteWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return beginDeleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) + return beginDeleteWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + return beginDeleteWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1536,9 +2385,34 @@ public Mono beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete( + public void beginDeleteWithoutPolling( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName).block(); + beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) + .block(); + } + + /** + * Delete a gallery Image Version. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. + * @param galleryImageVersionName The name of the gallery Image Version to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 beginDeleteWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryImageName, + String galleryImageVersionName, + Context context) { + beginDeleteWithoutPollingAsync( + resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) + .block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImagesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryImagesClient.java similarity index 57% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImagesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryImagesClient.java index 97adf53462ac..30bbf405cea4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImagesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/GalleryImagesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,33 +25,37 @@ 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.http.rest.SimpleResponse; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.ApiErrorException; -import com.azure.management.compute.GalleryImageUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.GalleryImageInner; +import com.azure.management.compute.fluent.inner.GalleryImageListInner; +import com.azure.management.compute.models.ApiErrorException; +import com.azure.management.compute.models.GalleryImageUpdate; 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 GalleryImages. */ -public final class GalleryImagesInner { - private final ClientLogger logger = new ClientLogger(GalleryImagesInner.class); +public final class GalleryImagesClient { + private final ClientLogger logger = new ClientLogger(GalleryImagesClient.class); /** The proxy service used to perform REST calls. */ private final GalleryImagesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of GalleryImagesInner. + * Initializes an instance of GalleryImagesClient. * * @param client the instance of the service client containing this operation class. */ - GalleryImagesInner(ComputeManagementClientImpl client) { + public GalleryImagesClient(ComputeManagementClient client) { this.service = RestProxy.create(GalleryImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -70,8 +74,8 @@ private interface GalleryImagesService { + "/{galleryName}/images/{galleryImageName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -86,8 +90,8 @@ Mono>> createOrUpdate( + "/{galleryName}/images/{galleryImageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -102,8 +106,8 @@ Mono>> update( + "/{galleryName}/images/{galleryImageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -117,8 +121,8 @@ Mono> get( + "/{galleryName}/images/{galleryImageName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -132,8 +136,8 @@ Mono>> delete( + "/{galleryName}/images") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGallery( - @HostParam("$host") String host, + Mono> listByGallery( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -146,8 +150,8 @@ Mono> listByGallery( + "/{galleryName}/images/{galleryImageName}") @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -162,8 +166,8 @@ Mono> beginCreateOrUpdate( + "/{galleryName}/images/{galleryImageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -178,8 +182,8 @@ Mono> beginUpdate( + "/{galleryName}/images/{galleryImageName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, @@ -191,7 +195,7 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> listByGalleryNext( + Mono> listByGalleryNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -210,11 +214,13 @@ Mono> listByGalleryNext( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -244,7 +250,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -255,6 +261,124 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Create or update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImage == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + } else { + galleryImage.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + context); + } + + /** + * Create or update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class); + } + + /** + * Create or update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageInner> beginCreateOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class); + } + /** * Create or update a gallery Image Definition. * @@ -272,7 +396,7 @@ public Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); return this .client @@ -282,6 +406,38 @@ public Mono createOrUpdateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Create or update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Create or update a gallery Image Definition. * @@ -302,6 +458,31 @@ public GalleryImageInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); } + /** + * Create or update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner createOrUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context).block(); + } + /** * Update a gallery Image Definition. * @@ -317,11 +498,13 @@ public GalleryImageInner createOrUpdate( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono>> updateWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -351,7 +534,7 @@ public Mono>> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -362,6 +545,124 @@ public Mono>> updateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + if (galleryImage == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + } else { + galleryImage.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + galleryImage, + context); + } + + /** + * Update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageInner> beginUpdate( + String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class); + } + + /** + * Update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, GalleryImageInner> beginUpdate( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class); + } + /** * Update a gallery Image Definition. * @@ -379,7 +680,7 @@ public Mono>> updateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - Mono>> mono = + Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage); return this .client @@ -389,6 +690,38 @@ public Mono updateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), GalleryImageInner.class, GalleryImageInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Update a gallery Image Definition. * @@ -409,6 +742,31 @@ public GalleryImageInner update( return updateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); } + /** + * Update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner update( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + return updateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context).block(); + } + /** * Retrieves information about a gallery Image Definition. * @@ -421,11 +779,13 @@ public GalleryImageInner update( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -450,7 +810,7 @@ public Mono> getWithResponseAsync( context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -473,11 +833,13 @@ public Mono> getWithResponseAsync( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -499,7 +861,7 @@ public Mono> getWithResponseAsync( final String apiVersion = "2019-07-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -517,35 +879,221 @@ public Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String galleryName, String galleryImageName) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery Image Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery Image Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName) { + return getAsync(resourceGroupName, galleryName, galleryImageName).block(); + } + + /** + * Retrieves information about a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. + * @param galleryImageName The name of the gallery Image Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner get( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return getAsync(resourceGroupName, galleryName, galleryImageName, context).block(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName) { + 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String galleryName, String galleryImageName, 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 (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryImageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + galleryName, + galleryImageName, + apiVersion, + context); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String galleryName, String galleryImageName) { - return getWithResponseAsync(resourceGroupName, galleryName, galleryImageName) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Retrieves information about a gallery Image Definition. + * Delete a gallery image. * * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. - * @param galleryImageName The name of the gallery Image Definition to be retrieved. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner get(String resourceGroupName, String galleryName, String galleryImageName) { - return getAsync(resourceGroupName, galleryName, galleryImageName).block(); + public PollerFlux, Void> beginDelete( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** @@ -560,43 +1108,14 @@ public GalleryImageInner get(String resourceGroupName, String galleryName, Strin * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -605,15 +1124,17 @@ public Mono>> deleteWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName); + public Mono deleteAsync( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -636,6 +1157,22 @@ public void delete(String resourceGroupName, String galleryName, String galleryI deleteAsync(resourceGroupName, galleryName, galleryImageName).block(); } + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 galleryName, String galleryImageName, Context context) { + deleteAsync(resourceGroupName, galleryName, galleryImageName, context).block(); + } + /** * List gallery Image Definitions in a gallery. * @@ -649,9 +1186,11 @@ public void delete(String resourceGroupName, String galleryName, String galleryI @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGallerySinglePageAsync( String resourceGroupName, String galleryName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -672,7 +1211,7 @@ public Mono> listByGallerySinglePageAsync( context -> service .listByGallery( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -704,9 +1243,11 @@ public Mono> listByGallerySinglePageAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByGallerySinglePageAsync( String resourceGroupName, String galleryName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -724,7 +1265,7 @@ public Mono> listByGallerySinglePageAsync( final String apiVersion = "2019-07-01"; return service .listByGallery( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -792,6 +1333,23 @@ public PagedIterable listByGallery(String resourceGroupName, return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName)); } + /** + * List gallery Image Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Images operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery( + String resourceGroupName, String galleryName, Context context) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); + } + /** * Create or update a gallery Image Definition. * @@ -807,11 +1365,13 @@ public PagedIterable listByGallery(String resourceGroupName, * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -840,8 +1400,8 @@ public Mono> beginCreateOrUpdateWithResponseAs .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -868,15 +1428,17 @@ public Mono> beginCreateOrUpdateWithResponseAs * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -902,8 +1464,8 @@ public Mono> beginCreateOrUpdateWithResponseAs } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -928,11 +1490,46 @@ public Mono> beginCreateOrUpdateWithResponseAs * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImage) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImage, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -956,9 +1553,37 @@ public Mono beginCreateOrUpdateAsync( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginCreateOrUpdate( + public GalleryImageInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) + .block(); + } + + /** + * Create or update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. + * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters + * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageInner galleryImage, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, galleryName, galleryImageName, galleryImage, context) + .block(); } /** @@ -976,11 +1601,13 @@ public GalleryImageInner beginCreateOrUpdate( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1009,8 +1636,8 @@ public Mono> beginUpdateWithResponseAsync( .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1037,15 +1664,17 @@ public Mono> beginUpdateWithResponseAsync( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1071,8 +1700,8 @@ public Mono> beginUpdateWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1097,11 +1726,46 @@ public Mono> beginUpdateWithResponseAsync( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateWithResponseAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImage) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, galleryName, galleryImageName, galleryImage, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1125,9 +1789,35 @@ public Mono beginUpdateAsync( * @return specifies information about the gallery Image Definition that you want to create or update. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginUpdate( + public GalleryImageInner beginUpdateWithoutPolling( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); + return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); + } + + /** + * Update a gallery Image Definition. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. + * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are + * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 + * characters. + * @param galleryImage Specifies information about the gallery Image Definition that you want to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Image Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner beginUpdateWithoutPolling( + String resourceGroupName, + String galleryName, + String galleryImageName, + GalleryImageUpdate galleryImage, + Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) + .block(); } /** @@ -1142,11 +1832,13 @@ public GalleryImageInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1170,8 +1862,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1194,11 +1886,13 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String galleryName, String galleryImageName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1219,8 +1913,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, galleryName, @@ -1241,8 +1935,28 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { - return beginDeleteWithResponseAsync(resourceGroupName, galleryName, galleryImageName) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String galleryName, String galleryImageName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryImageName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1257,8 +1971,25 @@ public Mono beginDeleteAsync(String resourceGroupName, String galleryName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String galleryName, String galleryImageName) { - beginDeleteAsync(resourceGroupName, galleryName, galleryImageName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String galleryName, String galleryImageName) { + beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName).block(); + } + + /** + * Delete a gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. + * @param galleryImageName The name of the gallery Image Definition to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException 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 beginDeleteWithoutPolling( + String resourceGroupName, String galleryName, String galleryImageName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImagesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ImagesClient.java similarity index 60% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImagesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ImagesClient.java index 19472bd324b4..21842ab21c9a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImagesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ImagesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,13 +25,17 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.ImageUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.ImageInner; +import com.azure.management.compute.fluent.inner.ImageListResultInner; +import com.azure.management.compute.models.ImageUpdate; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -40,22 +44,22 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in Images. */ -public final class ImagesInner +public final class ImagesClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(ImagesInner.class); + private final ClientLogger logger = new ClientLogger(ImagesClient.class); /** The proxy service used to perform REST calls. */ private final ImagesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of ImagesInner. + * Initializes an instance of ImagesClient. * * @param client the instance of the service client containing this operation class. */ - ImagesInner(ComputeManagementClientImpl client) { + public ImagesClient(ComputeManagementClient client) { this.service = RestProxy.create(ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -73,8 +77,8 @@ private interface ImagesService { + "/{imageName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, @QueryParam("api-version") String apiVersion, @@ -88,8 +92,8 @@ Mono>> createOrUpdate( + "/{imageName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, @QueryParam("api-version") String apiVersion, @@ -103,8 +107,8 @@ Mono>> update( + "/{imageName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, @QueryParam("api-version") String apiVersion, @@ -117,8 +121,8 @@ Mono>> delete( + "/{imageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, @QueryParam("$expand") String expand, @@ -130,8 +134,8 @@ Mono> getByResourceGroup( @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -141,8 +145,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); @@ -153,8 +157,8 @@ Mono> list( + "/{imageName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, @QueryParam("api-version") String apiVersion, @@ -168,8 +172,8 @@ Mono> beginCreateOrUpdate( + "/{imageName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, @QueryParam("api-version") String apiVersion, @@ -183,8 +187,8 @@ Mono> beginUpdate( + "/{imageName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("imageName") String imageName, @QueryParam("api-version") String apiVersion, @@ -195,14 +199,14 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -220,11 +224,13 @@ Mono> listNext( * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String imageName, ImageInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -250,7 +256,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -260,6 +266,108 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ImageInner> beginCreateOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class); + } + /** * Create or update an image. * @@ -275,7 +383,7 @@ public Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync(String resourceGroupName, String imageName, ImageInner parameters) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters); return this .client @@ -285,6 +393,33 @@ public Mono createOrUpdateAsync(String resourceGroupName, String ima .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Create or update an image. * @@ -303,6 +438,26 @@ public ImageInner createOrUpdate(String resourceGroupName, String imageName, Ima return createOrUpdateAsync(resourceGroupName, imageName, parameters).block(); } + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner createOrUpdate( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, imageName, parameters, context).block(); + } + /** * Update an image. * @@ -315,11 +470,13 @@ public ImageInner createOrUpdate(String resourceGroupName, String imageName, Ima * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono>> updateWithResponseAsync( String resourceGroupName, String imageName, ImageUpdate parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -345,7 +502,7 @@ public Mono>> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -355,6 +512,101 @@ public Mono>> updateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, imageName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ImageInner> beginUpdate( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, imageName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class); + } + /** * Update an image. * @@ -368,7 +620,32 @@ public Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, imageName, parameters); + Mono>> mono = updateWithResponseAsync(resourceGroupName, imageName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, imageName, parameters, context); return this .client .getLroResultAsync( @@ -378,19 +655,159 @@ public Mono updateAsync(String resourceGroupName, String imageName, } /** - * Update an image. + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters) { + return updateAsync(resourceGroupName, imageName, parameters).block(); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + return updateAsync(resourceGroupName, imageName, parameters, context).block(); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String imageName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String imageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName 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 apiVersion = "2019-03-01"; + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + imageName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete(String resourceGroupName, String imageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Deletes an Image. * * @param resourceGroupName The name of the resource group. * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner update(String resourceGroupName, String imageName, ImageUpdate parameters) { - return updateAsync(resourceGroupName, imageName, parameters).block(); + public PollerFlux, Void> beginDelete(String resourceGroupName, String imageName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** @@ -404,37 +821,13 @@ public ImageInner update(String resourceGroupName, String imageName, ImageUpdate * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String imageName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono deleteAsync(String resourceGroupName, String imageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -442,14 +835,15 @@ public Mono>> deleteWithResponseAsync(String res * * @param resourceGroupName The name of the resource group. * @param imageName The name of the image. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String imageName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName); + public Mono deleteAsync(String resourceGroupName, String imageName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, imageName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -471,6 +865,21 @@ public void delete(String resourceGroupName, String imageName) { deleteAsync(resourceGroupName, imageName).block(); } + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String imageName, Context context) { + deleteAsync(resourceGroupName, imageName, context).block(); + } + /** * Gets an image. * @@ -483,11 +892,13 @@ public void delete(String resourceGroupName, String imageName) { * @return an image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String imageName, String expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -508,7 +919,7 @@ public Mono> getByResourceGroupWithResponseAsync( context -> service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, imageName, expand, @@ -531,11 +942,13 @@ public Mono> getByResourceGroupWithResponseAsync( * @return an image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String imageName, String expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -553,7 +966,7 @@ public Mono> getByResourceGroupWithResponseAsync( final String apiVersion = "2019-03-01"; return service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, imageName, expand, @@ -577,7 +990,33 @@ public Mono> getByResourceGroupWithResponseAsync( public Mono getByResourceGroupAsync(String resourceGroupName, String imageName, String expand) { return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @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 an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String imageName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -602,7 +1041,7 @@ public Mono getByResourceGroupAsync(String resourceGroupName, String final Context context = null; return getByResourceGroupWithResponseAsync(resourceGroupName, imageName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -627,6 +1066,23 @@ public ImageInner getByResourceGroup(String resourceGroupName, String imageName, return getByResourceGroupAsync(resourceGroupName, imageName, expand).block(); } + /** + * Gets an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @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 an image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner getByResourceGroup(String resourceGroupName, String imageName, String expand, Context context) { + return getByResourceGroupAsync(resourceGroupName, imageName, expand, context).block(); + } + /** * Gets an image. * @@ -655,9 +1111,11 @@ public ImageInner getByResourceGroup(String resourceGroupName, String imageName) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -675,7 +1133,7 @@ public Mono> listByResourceGroupSinglePageAsync(String context -> service .listByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), @@ -705,9 +1163,11 @@ public Mono> listByResourceGroupSinglePageAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -722,7 +1182,7 @@ public Mono> listByResourceGroupSinglePageAsync( final String apiVersion = "2019-03-01"; return service .listByResourceGroup( - this.client.getHost(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -781,6 +1241,21 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } + /** + * Gets the list of images under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of images under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + /** * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of * Images. Do this till nextLink is null to fetch all the Images. @@ -791,9 +1266,11 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -804,7 +1281,8 @@ public Mono> listSinglePageAsync() { final String apiVersion = "2019-03-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context)) + context -> + service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -829,9 +1307,11 @@ public Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -841,7 +1321,7 @@ public Mono> listSinglePageAsync(Context context) { } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -894,6 +1374,21 @@ public PagedIterable list() { return new PagedIterable<>(listAsync()); } + /** + * Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of + * Images. Do this till nextLink is null to fetch all the Images. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Images in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Create or update an image. * @@ -908,11 +1403,13 @@ public PagedIterable list() { * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String imageName, ImageInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -937,8 +1434,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -963,11 +1460,13 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String imageName, ImageInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -989,8 +1488,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -1013,11 +1512,39 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, imageName, parameters) + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1040,8 +1567,29 @@ public Mono beginCreateOrUpdateAsync( * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginCreateOrUpdate(String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters).block(); + public ImageInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String imageName, ImageInner parameters) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters).block(); + } + + /** + * Create or update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being + * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not + * exist. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String imageName, ImageInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters, context).block(); } /** @@ -1056,11 +1604,13 @@ public ImageInner beginCreateOrUpdate(String resourceGroupName, String imageName * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String imageName, ImageUpdate parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1085,8 +1635,8 @@ public Mono> beginUpdateWithResponseAsync( .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -1109,11 +1659,13 @@ public Mono> beginUpdateWithResponseAsync( * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1135,8 +1687,8 @@ public Mono> beginUpdateWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -1157,10 +1709,37 @@ public Mono> beginUpdateWithResponseAsync( * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateWithResponseAsync(resourceGroupName, imageName, parameters) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String imageName, ImageUpdate parameters) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1181,8 +1760,26 @@ public Mono beginUpdateAsync(String resourceGroupName, String imageN * @return the source user image virtual hard disk. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginUpdate(String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateAsync(resourceGroupName, imageName, parameters).block(); + public ImageInner beginUpdateWithoutPolling(String resourceGroupName, String imageName, ImageUpdate parameters) { + return beginUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters).block(); + } + + /** + * Update an image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param parameters The source user image virtual hard disk. Only tags may be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source user image virtual hard disk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner beginUpdateWithoutPolling( + String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters, context).block(); } /** @@ -1196,10 +1793,12 @@ public ImageInner beginUpdate(String resourceGroupName, String imageName, ImageU * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String imageName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String imageName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1219,8 +1818,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -1241,11 +1840,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String imageName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1262,8 +1863,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, imageName, apiVersion, @@ -1282,8 +1883,40 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String imageName) { - return beginDeleteWithResponseAsync(resourceGroupName, imageName).flatMap((Response res) -> Mono.empty()); + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String imageName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, imageName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String imageName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, imageName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes an Image. + * + * @param resourceGroupName The name of the resource group. + * @param imageName The name of the image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginDeleteWithoutPolling(String resourceGroupName, String imageName) { + beginDeleteWithoutPollingAsync(resourceGroupName, imageName).block(); } /** @@ -1291,13 +1924,14 @@ public Mono beginDeleteAsync(String resourceGroupName, String imageName) { * * @param resourceGroupName The name of the resource group. * @param imageName The name of the image. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String imageName) { - beginDeleteAsync(resourceGroupName, imageName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String imageName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, imageName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/LogAnalyticsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/LogAnalyticsClient.java new file mode 100644 index 000000000000..886ac027a364 --- /dev/null +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/LogAnalyticsClient.java @@ -0,0 +1,915 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.management.compute.fluent; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.LogAnalyticsOperationResultInner; +import com.azure.management.compute.models.LogAnalyticsInputBase; +import com.azure.management.compute.models.RequestRateByIntervalInput; +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 LogAnalytics. */ +public final class LogAnalyticsClient { + private final ClientLogger logger = new ClientLogger(LogAnalyticsClient.class); + + /** The proxy service used to perform REST calls. */ + private final LogAnalyticsService service; + + /** The service client containing this operation class. */ + private final ComputeManagementClient client; + + /** + * Initializes an instance of LogAnalyticsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public LogAnalyticsClient(ComputeManagementClient client) { + this.service = + RestProxy.create(LogAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientLogAnalytics to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementCli") + private interface LogAnalyticsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" + + "/getRequestRateByInterval") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> exportRequestRateByInterval( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RequestRateByIntervalInput parameters, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" + + "/getThrottledRequests") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> exportThrottledRequests( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LogAnalyticsInputBase parameters, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" + + "/getRequestRateByInterval") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> beginExportRequestRateByIntervalWithoutPolling( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RequestRateByIntervalInput parameters, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" + + "/getThrottledRequests") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> beginExportThrottledRequestsWithoutPolling( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LogAnalyticsInputBase parameters, + Context context); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> exportRequestRateByIntervalWithResponseAsync( + String location, RequestRateByIntervalInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .exportRequestRateByInterval( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> exportRequestRateByIntervalWithResponseAsync( + String location, RequestRateByIntervalInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .exportRequestRateByInterval( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) { + Mono>> mono = exportRequestRateByIntervalWithResponseAsync(location, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, LogAnalyticsOperationResultInner> + beginExportRequestRateByInterval(String location, RequestRateByIntervalInput parameters, Context context) { + Mono>> mono = + exportRequestRateByIntervalWithResponseAsync(location, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportRequestRateByIntervalAsync( + String location, RequestRateByIntervalInput parameters) { + Mono>> mono = exportRequestRateByIntervalWithResponseAsync(location, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportRequestRateByIntervalAsync( + String location, RequestRateByIntervalInput parameters, Context context) { + Mono>> mono = + exportRequestRateByIntervalWithResponseAsync(location, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters) { + return exportRequestRateByIntervalAsync(location, parameters).block(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportRequestRateByInterval( + String location, RequestRateByIntervalInput parameters, Context context) { + return exportRequestRateByIntervalAsync(location, parameters, context).block(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> exportThrottledRequestsWithResponseAsync( + String location, LogAnalyticsInputBase parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .exportThrottledRequests( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> exportThrottledRequestsWithResponseAsync( + String location, LogAnalyticsInputBase parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .exportThrottledRequests( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, LogAnalyticsInputBase parameters) { + Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, LogAnalyticsOperationResultInner> + beginExportThrottledRequests(String location, LogAnalyticsInputBase parameters, Context context) { + Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportThrottledRequestsAsync( + String location, LogAnalyticsInputBase parameters) { + Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportThrottledRequestsAsync( + String location, LogAnalyticsInputBase parameters, Context context) { + Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + LogAnalyticsOperationResultInner.class, + LogAnalyticsOperationResultInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportThrottledRequests(String location, LogAnalyticsInputBase parameters) { + return exportThrottledRequestsAsync(location, parameters).block(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner exportThrottledRequests( + String location, LogAnalyticsInputBase parameters, Context context) { + return exportThrottledRequestsAsync(location, parameters, context).block(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + beginExportRequestRateByIntervalWithoutPollingWithResponseAsync( + String location, RequestRateByIntervalInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .beginExportRequestRateByIntervalWithoutPolling( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + beginExportRequestRateByIntervalWithoutPollingWithResponseAsync( + String location, RequestRateByIntervalInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .beginExportRequestRateByIntervalWithoutPolling( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginExportRequestRateByIntervalWithoutPollingAsync( + String location, RequestRateByIntervalInput parameters) { + return beginExportRequestRateByIntervalWithoutPollingWithResponseAsync(location, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginExportRequestRateByIntervalWithoutPollingAsync( + String location, RequestRateByIntervalInput parameters, Context context) { + return beginExportRequestRateByIntervalWithoutPollingWithResponseAsync(location, parameters, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner beginExportRequestRateByIntervalWithoutPolling( + String location, RequestRateByIntervalInput parameters) { + return beginExportRequestRateByIntervalWithoutPollingAsync(location, parameters).block(); + } + + /** + * Export logs that show Api requests made by this subscription in the given time window to show throttling + * activities. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner beginExportRequestRateByIntervalWithoutPolling( + String location, RequestRateByIntervalInput parameters, Context context) { + return beginExportRequestRateByIntervalWithoutPollingAsync(location, parameters, context).block(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> beginExportThrottledRequestsWithoutPollingWithResponseAsync( + String location, LogAnalyticsInputBase parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .beginExportThrottledRequestsWithoutPolling( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> beginExportThrottledRequestsWithoutPollingWithResponseAsync( + String location, LogAnalyticsInputBase parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .beginExportThrottledRequestsWithoutPolling( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginExportThrottledRequestsWithoutPollingAsync( + String location, LogAnalyticsInputBase parameters) { + return beginExportThrottledRequestsWithoutPollingWithResponseAsync(location, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginExportThrottledRequestsWithoutPollingAsync( + String location, LogAnalyticsInputBase parameters, Context context) { + return beginExportThrottledRequestsWithoutPollingWithResponseAsync(location, parameters, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner beginExportThrottledRequestsWithoutPolling( + String location, LogAnalyticsInputBase parameters) { + return beginExportThrottledRequestsWithoutPollingAsync(location, parameters).block(); + } + + /** + * Export logs that show total throttled Api requests for this subscription in the given time window. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogAnalyticsOperationResultInner beginExportThrottledRequestsWithoutPolling( + String location, LogAnalyticsInputBase parameters, Context context) { + return beginExportThrottledRequestsWithoutPollingAsync(location, parameters, context).block(); + } +} diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperationsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/OperationsClient.java similarity index 75% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperationsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/OperationsClient.java index 21e7aa50b470..05215dc013f1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperationsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/OperationsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -18,30 +18,33 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.ComputeOperationListResultInner; +import com.azure.management.compute.fluent.inner.ComputeOperationValueInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in Operations. */ -public final class OperationsInner { - private final ClientLogger logger = new ClientLogger(OperationsInner.class); +public final class OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClient.class); /** The proxy service used to perform REST calls. */ private final OperationsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of OperationsInner. + * Initializes an instance of OperationsClient. * * @param client the instance of the service client containing this operation class. */ - OperationsInner(ComputeManagementClientImpl client) { + public OperationsClient(ComputeManagementClient client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -58,8 +61,8 @@ private interface OperationsService { @Get("/providers/Microsoft.Compute/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, @QueryParam("api-version") String apiVersion, Context context); + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, Context context); } /** @@ -71,13 +74,15 @@ Mono> list( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; return FluxUtil - .withContext(context -> service.list(this.client.getHost(), apiVersion, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, context)) .>map( res -> new PagedResponseBase<>( @@ -96,13 +101,15 @@ public Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), apiVersion, context) + .list(this.client.getEndpoint(), apiVersion, context) .map( res -> new PagedResponseBase<>( @@ -146,4 +153,18 @@ public PagedFlux listAsync(Context context) { public PagedIterable list() { return new PagedIterable<>(listAsync()); } + + /** + * Gets a list of compute operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of compute operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ProximityPlacementGroupsClient.java similarity index 75% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ProximityPlacementGroupsClient.java index 5d6d8b12729b..bbbedd297ca6 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ProximityPlacementGroupsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,12 +25,14 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.UpdateResource; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.ProximityPlacementGroupInner; +import com.azure.management.compute.fluent.inner.ProximityPlacementGroupListResultInner; +import com.azure.management.compute.models.UpdateResource; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -38,24 +40,24 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ProximityPlacementGroups. */ -public final class ProximityPlacementGroupsInner +public final class ProximityPlacementGroupsClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupsInner.class); + private final ClientLogger logger = new ClientLogger(ProximityPlacementGroupsClient.class); /** The proxy service used to perform REST calls. */ private final ProximityPlacementGroupsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of ProximityPlacementGroupsInner. + * Initializes an instance of ProximityPlacementGroupsClient. * * @param client the instance of the service client containing this operation class. */ - ProximityPlacementGroupsInner(ComputeManagementClientImpl client) { + public ProximityPlacementGroupsClient(ComputeManagementClient client) { this.service = RestProxy .create(ProximityPlacementGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -75,8 +77,8 @@ private interface ProximityPlacementGroupsService { + "/proximityPlacementGroups/{proximityPlacementGroupName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String host, + Mono> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, @QueryParam("api-version") String apiVersion, @@ -90,8 +92,8 @@ Mono> createOrUpdate( + "/proximityPlacementGroups/{proximityPlacementGroupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String host, + Mono> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, @QueryParam("api-version") String apiVersion, @@ -106,7 +108,7 @@ Mono> update( @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> delete( - @HostParam("$host") String host, + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, @QueryParam("api-version") String apiVersion, @@ -119,8 +121,8 @@ Mono> delete( + "/proximityPlacementGroups/{proximityPlacementGroupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("proximityPlacementGroupName") String proximityPlacementGroupName, @QueryParam("api-version") String apiVersion, @@ -131,8 +133,8 @@ Mono> getByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); @@ -143,8 +145,8 @@ Mono> list( + "/proximityPlacementGroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -154,14 +156,14 @@ Mono> listByResourceGroup @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -177,11 +179,13 @@ Mono> listByResourceGroup * @return specifies information about the proximity placement group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( + public Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -210,7 +214,7 @@ public Mono> createOrUpdateWithResp context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -233,14 +237,16 @@ public Mono> createOrUpdateWithResp * @return specifies information about the proximity placement group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( + public Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -266,7 +272,7 @@ public Mono> createOrUpdateWithResp final String apiVersion = "2019-03-01"; return service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -291,7 +297,36 @@ public Mono createOrUpdateAsync( String resourceGroupName, String proximityPlacementGroupName, ProximityPlacementGroupInner parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Specifies information about the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, parameters, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -317,6 +352,27 @@ public ProximityPlacementGroupInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, proximityPlacementGroupName, parameters).block(); } + /** + * Create or update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param parameters Specifies information about the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProximityPlacementGroupInner createOrUpdate( + String resourceGroupName, + String proximityPlacementGroupName, + ProximityPlacementGroupInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, proximityPlacementGroupName, parameters, context).block(); + } + /** * Update a proximity placement group. * @@ -329,11 +385,13 @@ public ProximityPlacementGroupInner createOrUpdate( * @return specifies information about the proximity placement group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( + public Mono> updateWithResponseAsync( String resourceGroupName, String proximityPlacementGroupName, Map tags) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -359,7 +417,7 @@ public Mono> updateWithResponseAsyn context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -382,11 +440,13 @@ public Mono> updateWithResponseAsyn * @return specifies information about the proximity placement group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( + public Mono> updateWithResponseAsync( String resourceGroupName, String proximityPlacementGroupName, Map tags, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -409,7 +469,7 @@ public Mono> updateWithResponseAsyn parameters.withTags(tags); return service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -434,7 +494,33 @@ public Mono updateAsync( String resourceGroupName, String proximityPlacementGroupName, Map tags) { return updateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, tags) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param tags Resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String proximityPlacementGroupName, Map tags, Context context) { + return updateWithResponseAsync(resourceGroupName, proximityPlacementGroupName, tags, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -460,6 +546,24 @@ public ProximityPlacementGroupInner update( return updateAsync(resourceGroupName, proximityPlacementGroupName, tags).block(); } + /** + * Update a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param tags Resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProximityPlacementGroupInner update( + String resourceGroupName, String proximityPlacementGroupName, Map tags, Context context) { + return updateAsync(resourceGroupName, proximityPlacementGroupName, tags, context).block(); + } + /** * Delete a proximity placement group. * @@ -472,9 +576,11 @@ public ProximityPlacementGroupInner update( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String proximityPlacementGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -498,7 +604,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -521,9 +627,11 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync( String resourceGroupName, String proximityPlacementGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -544,7 +652,7 @@ public Mono> deleteWithResponseAsync( final String apiVersion = "2019-03-01"; return service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -568,6 +676,23 @@ public Mono deleteAsync(String resourceGroupName, String proximityPlacemen .flatMap((Response res) -> Mono.empty()); } + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String proximityPlacementGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, proximityPlacementGroupName, context) + .flatMap((Response res) -> Mono.empty()); + } + /** * Delete a proximity placement group. * @@ -582,6 +707,21 @@ public void delete(String resourceGroupName, String proximityPlacementGroupName) deleteAsync(resourceGroupName, proximityPlacementGroupName).block(); } + /** + * Delete a proximity placement group. + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 proximityPlacementGroupName, Context context) { + deleteAsync(resourceGroupName, proximityPlacementGroupName, context).block(); + } + /** * Retrieves information about a proximity placement group . * @@ -593,11 +733,13 @@ public void delete(String resourceGroupName, String proximityPlacementGroupName) * @return specifies information about the proximity placement group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String proximityPlacementGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -621,7 +763,7 @@ public Mono> getByResourceGroupWith context -> service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -642,11 +784,13 @@ public Mono> getByResourceGroupWith * @return specifies information about the proximity placement group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String proximityPlacementGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -667,7 +811,7 @@ public Mono> getByResourceGroupWith final String apiVersion = "2019-03-01"; return service .getByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, proximityPlacementGroupName, apiVersion, @@ -690,7 +834,32 @@ public Mono getByResourceGroupAsync( String resourceGroupName, String proximityPlacementGroupName) { return getByResourceGroupWithResponseAsync(resourceGroupName, proximityPlacementGroupName) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String proximityPlacementGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, proximityPlacementGroupName, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -715,6 +884,23 @@ public ProximityPlacementGroupInner getByResourceGroup( return getByResourceGroupAsync(resourceGroupName, proximityPlacementGroupName).block(); } + /** + * Retrieves information about a proximity placement group . + * + * @param resourceGroupName The name of the resource group. + * @param proximityPlacementGroupName The name of the proximity placement group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the proximity placement group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProximityPlacementGroupInner getByResourceGroup( + String resourceGroupName, String proximityPlacementGroupName, Context context) { + return getByResourceGroupAsync(resourceGroupName, proximityPlacementGroupName, context).block(); + } + /** * Lists all proximity placement groups in a subscription. * @@ -724,9 +910,11 @@ public ProximityPlacementGroupInner getByResourceGroup( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -737,7 +925,8 @@ public Mono> listSinglePageAsync() { final String apiVersion = "2019-03-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context)) + context -> + service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -761,9 +950,11 @@ public Mono> listSinglePageAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -773,7 +964,7 @@ public Mono> listSinglePageAsync(Con } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -825,6 +1016,20 @@ public PagedIterable list() { return new PagedIterable<>(listAsync()); } + /** + * Lists all proximity placement groups 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 the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Lists all proximity placement groups in a resource group. * @@ -837,9 +1042,11 @@ public PagedIterable list() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -857,7 +1064,7 @@ public Mono> listByResourceGroupSing context -> service .listByResourceGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), @@ -887,9 +1094,11 @@ public Mono> listByResourceGroupSing @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -904,7 +1113,7 @@ public Mono> listByResourceGroupSing final String apiVersion = "2019-03-01"; return service .listByResourceGroup( - this.client.getHost(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -963,6 +1172,21 @@ public PagedIterable listByResourceGroup(String re return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } + /** + * Lists all proximity placement groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Proximity Placement Group operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + /** * Get the next page of items. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkusInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ResourceSkusClient.java similarity index 84% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkusInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ResourceSkusClient.java index d496354ca287..fab78ad9b850 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkusInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/ResourceSkusClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -19,30 +19,33 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.ResourceSkuInner; +import com.azure.management.compute.fluent.inner.ResourceSkusResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ResourceSkus. */ -public final class ResourceSkusInner { - private final ClientLogger logger = new ClientLogger(ResourceSkusInner.class); +public final class ResourceSkusClient { + private final ClientLogger logger = new ClientLogger(ResourceSkusClient.class); /** The proxy service used to perform REST calls. */ private final ResourceSkusService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of ResourceSkusInner. + * Initializes an instance of ResourceSkusClient. * * @param client the instance of the service client containing this operation class. */ - ResourceSkusInner(ComputeManagementClientImpl client) { + public ResourceSkusClient(ComputeManagementClient client) { this.service = RestProxy.create(ResourceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -59,8 +62,8 @@ private interface ResourceSkusService { @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, @@ -70,7 +73,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -85,9 +88,11 @@ Mono> listNext( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String filter) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -99,7 +104,8 @@ public Mono> listSinglePageAsync(String filter) return FluxUtil .withContext( context -> - service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), filter, context)) + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, context)) .>map( res -> new PagedResponseBase<>( @@ -124,9 +130,11 @@ public Mono> listSinglePageAsync(String filter) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -136,7 +144,7 @@ public Mono> listSinglePageAsync(String filter, } final String apiVersion = "2019-04-01"; return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), filter, context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, context) .map( res -> new PagedResponseBase<>( @@ -206,6 +214,21 @@ public PagedIterable list(String filter) { return new PagedIterable<>(listAsync(filter)); } + /** + * Gets the list of Microsoft.Compute SKUs available for your Subscription. + * + * @param filter The filter to apply on the operation. Only **location** filter is supported currently. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } + /** * Gets the list of Microsoft.Compute SKUs available for your Subscription. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/SnapshotsClient.java similarity index 56% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/SnapshotsClient.java index fd2f4c789ad4..c36516c35e2f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/SnapshotsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -26,14 +26,19 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.GrantAccessData; -import com.azure.management.compute.SnapshotUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.AccessUriInner; +import com.azure.management.compute.fluent.inner.SnapshotInner; +import com.azure.management.compute.fluent.inner.SnapshotListInner; +import com.azure.management.compute.models.GrantAccessData; +import com.azure.management.compute.models.SnapshotUpdate; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -42,22 +47,22 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in Snapshots. */ -public final class SnapshotsInner +public final class SnapshotsClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(SnapshotsInner.class); + private final ClientLogger logger = new ClientLogger(SnapshotsClient.class); /** The proxy service used to perform REST calls. */ private final SnapshotsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of SnapshotsInner. + * Initializes an instance of SnapshotsClient. * * @param client the instance of the service client containing this operation class. */ - SnapshotsInner(ComputeManagementClientImpl client) { + public SnapshotsClient(ComputeManagementClient client) { this.service = RestProxy.create(SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -76,8 +81,8 @@ private interface SnapshotsService { + "/{snapshotName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -91,8 +96,8 @@ Mono>> createOrUpdate( + "/{snapshotName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -106,8 +111,8 @@ Mono>> update( + "/{snapshotName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -120,8 +125,8 @@ Mono> getByResourceGroup( + "/{snapshotName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -132,8 +137,8 @@ Mono>> delete( @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -143,8 +148,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, Context context); @@ -155,8 +160,8 @@ Mono> list( + "/{snapshotName}/beginGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> grantAccess( - @HostParam("$host") String host, + Mono>> grantAccess( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -170,8 +175,8 @@ Mono>> grantAccess( + "/{snapshotName}/endGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> revokeAccess( - @HostParam("$host") String host, + Mono>> revokeAccess( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -184,8 +189,8 @@ Mono>> revokeAccess( + "/{snapshotName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -199,8 +204,8 @@ Mono> beginCreateOrUpdate( + "/{snapshotName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -214,8 +219,8 @@ Mono> beginUpdate( + "/{snapshotName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -228,8 +233,8 @@ Mono> beginDelete( + "/{snapshotName}/beginGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginGrantAccess( - @HostParam("$host") String host, + Mono> beginGrantAccessWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -243,8 +248,8 @@ Mono> beginGrantAccess( + "/{snapshotName}/endGetAccess") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRevokeAccess( - @HostParam("$host") String host, + Mono> beginRevokeAccessWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("snapshotName") String snapshotName, @@ -255,14 +260,14 @@ Mono> beginRevokeAccess( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -279,11 +284,13 @@ Mono> listNext( * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -309,7 +316,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -326,22 +333,72 @@ public Mono>> createOrUpdateWithResponseAsync( * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @param snapshot Snapshot 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 snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (snapshot == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + } else { + snapshot.validate(); + } + final String apiVersion = "2019-07-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + snapshot, + context); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot 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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, SnapshotInner> beginCreateOrUpdate( String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot); return this .client .getLroResultAsync( - mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class); } /** @@ -351,85 +408,66 @@ public Mono createOrUpdateAsync( * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @param snapshot Snapshot 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 snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner createOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return createOrUpdateAsync(resourceGroupName, snapshotName, snapshot).block(); + public PollerFlux, SnapshotInner> beginCreateOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class); } /** - * Updates (patches) a snapshot. + * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. + * @param snapshot Snapshot 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 snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono createOrUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Updates (patches) a snapshot. + * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. + * @param snapshot Snapshot 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 snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, snapshotName, snapshot); + public Mono createOrUpdateAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); return this .client .getLroResultAsync( @@ -439,39 +477,61 @@ public Mono updateAsync(String resourceGroupName, String snapshot } /** - * Updates (patches) a snapshot. + * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. + * @param snapshot Snapshot 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 snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return updateAsync(resourceGroupName, snapshotName, snapshot).block(); + public SnapshotInner createOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + return createOrUpdateAsync(resourceGroupName, snapshotName, snapshot).block(); } /** - * Gets information about a snapshot. + * Creates or updates a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot 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 information about a snapshot. + * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String snapshotName) { - if (this.client.getHost() == null) { + public SnapshotInner createOrUpdate( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + return createOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context).block(); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -486,39 +546,48 @@ public Mono> getByResourceGroupWithResponseAsync( if (snapshotName == null) { return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } + if (snapshot == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + } else { + snapshot.validate(); + } final String apiVersion = "2019-07-01"; return FluxUtil .withContext( context -> service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, apiVersion, + snapshot, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets information about a snapshot. + * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 information about a snapshot. + * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String snapshotName, Context context) { - if (this.client.getHost() == null) { + public Mono>> updateWithResponseAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -533,153 +602,173 @@ public Mono> getByResourceGroupWithResponseAsync( if (snapshotName == null) { return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } + if (snapshot == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); + } else { + snapshot.validate(); + } final String apiVersion = "2019-07-01"; return service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, apiVersion, + snapshot, context); } /** - * Gets information about a snapshot. + * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 information about a snapshot. + * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String snapshotName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, snapshotName, snapshot); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class); } /** - * Gets information about a snapshot. + * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 information about a snapshot. + * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName) { - return getByResourceGroupAsync(resourceGroupName, snapshotName).block(); + public PollerFlux, SnapshotInner> beginUpdate( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class); } /** - * Deletes a snapshot. + * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String snapshotName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, snapshotName, snapshot); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Deletes a snapshot. + * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 completion. + * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String snapshotName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName); + public Mono updateAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, snapshotName, snapshot, context); return this .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .getLroResultAsync( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class) .last() .flatMap(AsyncPollResponse::getFinalResult); } /** - * Deletes a snapshot. + * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String snapshotName) { - deleteAsync(resourceGroupName, snapshotName).block(); + public SnapshotInner update(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + return updateAsync(resourceGroupName, snapshotName, snapshot).block(); } /** - * Lists snapshots under a resource group. + * Updates (patches) a snapshot. * * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 List Snapshots operation response. + * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + public SnapshotInner update( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + return updateAsync(resourceGroupName, snapshotName, snapshot, context).block(); + } + + /** + * Gets information about a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String snapshotName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -691,45 +780,44 @@ public Mono> listByResourceGroupSinglePageAsync(Str return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return FluxUtil .withContext( context -> service - .listByResourceGroup( - this.client.getHost(), + .getByResourceGroup( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + snapshotName, apiVersion, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Lists snapshots under a resource group. + * Gets information about a snapshot. * * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return information about a snapshot. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String snapshotName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -741,80 +829,120 @@ public Mono> listByResourceGroupSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return service - .listByResourceGroup( - this.client.getHost(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context); } /** - * Lists snapshots under a resource group. + * Gets information about a snapshot. * * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return information about a snapshot. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String snapshotName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Lists snapshots under a resource group. + * Gets information about a snapshot. * * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return information about a snapshot. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String snapshotName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, snapshotName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Lists snapshots under a resource group. + * Gets information about a snapshot. * * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return information about a snapshot. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName) { + return getByResourceGroupAsync(resourceGroupName, snapshotName).block(); } /** - * Lists snapshots under a subscription. + * Gets information about a snapshot. * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return information about a snapshot. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + public SnapshotInner getByResourceGroup(String resourceGroupName, String snapshotName, Context context) { + return getByResourceGroupAsync(resourceGroupName, snapshotName, context).block(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String snapshotName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -822,36 +950,48 @@ public Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Lists snapshots under a subscription. + * Deletes a snapshot. * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String snapshotName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -859,76 +999,494 @@ public Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } final String apiVersion = "2019-07-01"; return service - .list(this.client.getHost(), this.client.getSubscriptionId(), apiVersion, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context); } /** - * Lists snapshots under a subscription. + * Deletes a snapshot. * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete(String resourceGroupName, String snapshotName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists snapshots under a subscription. + * Deletes a snapshot. * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String snapshotName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists snapshots under a subscription. + * Deletes a snapshot. * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Snapshots operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String snapshotName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Grants access to a snapshot. + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String snapshotName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, snapshotName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 snapshotName) { + deleteAsync(resourceGroupName, snapshotName).block(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 snapshotName, Context context) { + deleteAsync(resourceGroupName, snapshotName, context).block(); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return service + .listByResourceGroup( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists snapshots under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-07-01"; + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists snapshots under 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 the List Snapshots operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (grantAccessData == null) { + return Mono + .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); + } else { + grantAccessData.validate(); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + grantAccessData, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Grants access to a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> grantAccessWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - if (this.client.getHost() == null) { + public Mono>> grantAccessWithResponseAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -950,19 +1508,62 @@ public Mono>> grantAccessWithResponseAsync( grantAccessData.validate(); } final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .grantAccess( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - grantAccessData, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .grantAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + grantAccessData, + context); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AccessUriInner> beginGrantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class); } /** @@ -980,7 +1581,7 @@ public Mono>> grantAccessWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono grantAccessAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - Mono>> mono = + Mono>> mono = grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData); return this .client @@ -990,6 +1591,32 @@ public Mono grantAccessAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono grantAccessAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + Mono>> mono = + grantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AccessUriInner.class, AccessUriInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Grants access to a snapshot. * @@ -1007,50 +1634,195 @@ public AccessUriInner grantAccess(String resourceGroupName, String snapshotName, return grantAccessAsync(resourceGroupName, snapshotName, grantAccessData).block(); } + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner grantAccess( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + return grantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context).block(); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, String snapshotName) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return FluxUtil + .withContext( + context -> + service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> revokeAccessWithResponseAsync( + String resourceGroupName, String snapshotName, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String apiVersion = "2019-07-01"; + return service + .revokeAccess( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + snapshotName, + apiVersion, + context); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRevokeAccess(String resourceGroupName, String snapshotName) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRevokeAccess( + String resourceGroupName, String snapshotName, Context context) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono revokeAccessAsync(String resourceGroupName, String snapshotName) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Revokes access to a snapshot. * * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> revokeAccessWithResponseAsync( - String resourceGroupName, String snapshotName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-07-01"; - return FluxUtil - .withContext( - context -> - service - .revokeAccess( - this.client.getHost(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono revokeAccessAsync(String resourceGroupName, String snapshotName, Context context) { + Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -1062,16 +1834,10 @@ public Mono>> revokeAccessWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono revokeAccessAsync(String resourceGroupName, String snapshotName) { - Mono>> mono = revokeAccessWithResponseAsync(resourceGroupName, snapshotName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public void revokeAccess(String resourceGroupName, String snapshotName) { + revokeAccessAsync(resourceGroupName, snapshotName).block(); } /** @@ -1080,13 +1846,14 @@ public Mono revokeAccessAsync(String resourceGroupName, String snapshotNam * @param resourceGroupName The name of the resource group. * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 revokeAccess(String resourceGroupName, String snapshotName) { - revokeAccessAsync(resourceGroupName, snapshotName).block(); + public void revokeAccess(String resourceGroupName, String snapshotName, Context context) { + revokeAccessAsync(resourceGroupName, snapshotName, context).block(); } /** @@ -1102,11 +1869,13 @@ public void revokeAccess(String resourceGroupName, String snapshotName) { * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1131,8 +1900,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1156,11 +1925,13 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1182,8 +1953,8 @@ public Mono> beginCreateOrUpdateWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1205,11 +1976,38 @@ public Mono> beginCreateOrUpdateWithResponseAsync( * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot) + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot 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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1231,8 +2029,28 @@ public Mono beginCreateOrUpdateAsync( * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginCreateOrUpdate(String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot).block(); + public SnapshotInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String snapshotName, SnapshotInner snapshot) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot).block(); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot 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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot, context).block(); } /** @@ -1248,11 +2066,13 @@ public SnapshotInner beginCreateOrUpdate(String resourceGroupName, String snapsh * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1277,8 +2097,8 @@ public Mono> beginUpdateWithResponseAsync( .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1302,11 +2122,13 @@ public Mono> beginUpdateWithResponseAsync( * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1328,8 +2150,8 @@ public Mono> beginUpdateWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1351,11 +2173,38 @@ public Mono> beginUpdateWithResponseAsync( * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateWithResponseAsync(resourceGroupName, snapshotName, snapshot) + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1377,8 +2226,28 @@ public Mono beginUpdateAsync( * @return snapshot resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateAsync(resourceGroupName, snapshotName, snapshot).block(); + public SnapshotInner beginUpdateWithoutPolling( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { + return beginUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot).block(); + } + + /** + * Updates (patches) a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param snapshot Snapshot update 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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner beginUpdateWithoutPolling( + String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot, context).block(); } /** @@ -1393,10 +2262,13 @@ public SnapshotInner beginUpdate(String resourceGroupName, String snapshotName, * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String snapshotName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync( + String resourceGroupName, String snapshotName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1416,8 +2288,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1439,11 +2311,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1460,8 +2334,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1481,8 +2355,26 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String snapshotName) { - return beginDeleteWithResponseAsync(resourceGroupName, snapshotName) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String snapshotName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, snapshotName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String snapshotName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1497,8 +2389,24 @@ public Mono beginDeleteAsync(String resourceGroupName, String snapshotName * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String snapshotName) { - beginDeleteAsync(resourceGroupName, snapshotName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String snapshotName) { + beginDeleteWithoutPollingAsync(resourceGroupName, snapshotName).block(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginDeleteWithoutPolling(String resourceGroupName, String snapshotName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, snapshotName, context).block(); } /** @@ -1514,11 +2422,13 @@ public void beginDelete(String resourceGroupName, String snapshotName) { * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithResponseAsync( + public Mono> beginGrantAccessWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1544,8 +2454,8 @@ public Mono> beginGrantAccessWithResponseAsync( .withContext( context -> service - .beginGrantAccess( - this.client.getHost(), + .beginGrantAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1569,11 +2479,13 @@ public Mono> beginGrantAccessWithResponseAsync( * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithResponseAsync( + public Mono> beginGrantAccessWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1596,8 +2508,8 @@ public Mono> beginGrantAccessWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginGrantAccess( - this.client.getHost(), + .beginGrantAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1619,11 +2531,39 @@ public Mono> beginGrantAccessWithResponseAsync( * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessAsync( + public Mono beginGrantAccessWithoutPollingAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessWithResponseAsync(resourceGroupName, snapshotName, grantAccessData) + return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, grantAccessData) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginGrantAccessWithoutPollingAsync( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessWithoutPollingWithResponseAsync( + resourceGroupName, snapshotName, grantAccessData, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1645,9 +2585,28 @@ public Mono beginGrantAccessAsync( * @return a disk access SAS uri. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccess( + public AccessUriInner beginGrantAccessWithoutPolling( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData).block(); + return beginGrantAccessWithoutPollingAsync(resourceGroupName, snapshotName, grantAccessData).block(); + } + + /** + * Grants access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param grantAccessData Data used for requesting a SAS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disk access SAS uri. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessUriInner beginGrantAccessWithoutPolling( + String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { + return beginGrantAccessWithoutPollingAsync(resourceGroupName, snapshotName, grantAccessData, context).block(); } /** @@ -1662,10 +2621,13 @@ public AccessUriInner beginGrantAccess( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithResponseAsync(String resourceGroupName, String snapshotName) { - if (this.client.getHost() == null) { + public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( + String resourceGroupName, String snapshotName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1685,8 +2647,8 @@ public Mono> beginRevokeAccessWithResponseAsync(String resourceGr .withContext( context -> service - .beginRevokeAccess( - this.client.getHost(), + .beginRevokeAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1708,11 +2670,13 @@ public Mono> beginRevokeAccessWithResponseAsync(String resourceGr * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithResponseAsync( + public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( String resourceGroupName, String snapshotName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1729,8 +2693,8 @@ public Mono> beginRevokeAccessWithResponseAsync( } final String apiVersion = "2019-07-01"; return service - .beginRevokeAccess( - this.client.getHost(), + .beginRevokeAccessWithoutPolling( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, snapshotName, @@ -1750,8 +2714,27 @@ public Mono> beginRevokeAccessWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRevokeAccessAsync(String resourceGroupName, String snapshotName) { - return beginRevokeAccessWithResponseAsync(resourceGroupName, snapshotName) + public Mono beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String snapshotName) { + return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRevokeAccessWithoutPollingAsync( + String resourceGroupName, String snapshotName, Context context) { + return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, context) .flatMap((Response res) -> Mono.empty()); } @@ -1766,8 +2749,24 @@ public Mono beginRevokeAccessAsync(String resourceGroupName, String snapsh * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRevokeAccess(String resourceGroupName, String snapshotName) { - beginRevokeAccessAsync(resourceGroupName, snapshotName).block(); + public void beginRevokeAccessWithoutPolling(String resourceGroupName, String snapshotName) { + beginRevokeAccessWithoutPollingAsync(resourceGroupName, snapshotName).block(); + } + + /** + * Revokes access to a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot + * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginRevokeAccessWithoutPolling(String resourceGroupName, String snapshotName, Context context) { + beginRevokeAccessWithoutPollingAsync(resourceGroupName, snapshotName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsagesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/UsagesClient.java similarity index 83% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsagesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/UsagesClient.java index 8b08eab1df33..b82a449a344f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsagesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/UsagesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -19,30 +19,33 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.ListUsagesResultInner; +import com.azure.management.compute.fluent.inner.UsageInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in Usages. */ -public final class UsagesInner { - private final ClientLogger logger = new ClientLogger(UsagesInner.class); +public final class UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClient.class); /** The proxy service used to perform REST calls. */ private final UsagesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of UsagesInner. + * Initializes an instance of UsagesClient. * * @param client the instance of the service client containing this operation class. */ - UsagesInner(ComputeManagementClientImpl client) { + public UsagesClient(ComputeManagementClient client) { this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,8 +61,8 @@ private interface UsagesService { @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -69,7 +72,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -85,9 +88,11 @@ Mono> listNext( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String location) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -102,7 +107,9 @@ public Mono> listSinglePageAsync(String location) { return FluxUtil .withContext( context -> - service.list(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context)) + service + .list( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -128,9 +135,11 @@ public Mono> listSinglePageAsync(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -143,7 +152,7 @@ public Mono> listSinglePageAsync(String location, Cont } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -202,6 +211,22 @@ public PagedIterable list(String location) { return new PagedIterable<>(listAsync(location)); } + /** + * Gets, for the specified location, the current compute resource usage information as well as the limits for + * compute resources under the subscription. + * + * @param location The location for which resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + /** * Get the next page of items. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImagesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineExtensionImagesClient.java similarity index 70% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImagesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineExtensionImagesClient.java index cb9ef3ef5c3a..a9ac431895b4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImagesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineExtensionImagesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -15,31 +15,33 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; import java.util.List; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in VirtualMachineExtensionImages. */ -public final class VirtualMachineExtensionImagesInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImagesInner.class); +public final class VirtualMachineExtensionImagesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionImagesClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineExtensionImagesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineExtensionImagesInner. + * Initializes an instance of VirtualMachineExtensionImagesClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineExtensionImagesInner(ComputeManagementClientImpl client) { + public VirtualMachineExtensionImagesClient(ComputeManagementClient client) { this.service = RestProxy .create( @@ -62,8 +64,8 @@ private interface VirtualMachineExtensionImagesService { + "/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("publisherName") String publisherName, @PathParam("type") String type, @@ -78,8 +80,8 @@ Mono> get( + "/{publisherName}/artifacttypes/vmextension/types") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listTypes( - @HostParam("$host") String host, + Mono>> listTypes( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("publisherName") String publisherName, @QueryParam("api-version") String apiVersion, @@ -92,8 +94,8 @@ Mono>> listTypes( + "/{publisherName}/artifacttypes/vmextension/types/{type}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listVersions( - @HostParam("$host") String host, + Mono>> listVersions( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("publisherName") String publisherName, @PathParam("type") String type, @@ -118,11 +120,13 @@ Mono>> listVersions( * @return a virtual machine extension image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String location, String publisherName, String type, String version) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -148,7 +152,7 @@ public Mono> getWithResponseAs context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, type, @@ -173,11 +177,13 @@ public Mono> getWithResponseAs * @return a virtual machine extension image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String location, String publisherName, String type, String version, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -200,7 +206,7 @@ public Mono> getWithResponseAs final String apiVersion = "2019-03-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, type, @@ -227,7 +233,34 @@ public Mono getAsync( String location, String publisherName, String type, String version) { return getWithResponseAsync(location, publisherName, type, version) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String location, String publisherName, String type, String version, Context context) { + return getWithResponseAsync(location, publisherName, type, version, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -253,6 +286,25 @@ public VirtualMachineExtensionImageInner get(String location, String publisherNa return getAsync(location, publisherName, type, version).block(); } + /** + * Gets a virtual machine extension image. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param version The version parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine extension image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionImageInner get( + String location, String publisherName, String type, String version, Context context) { + return getAsync(location, publisherName, type, version, context).block(); + } + /** * Gets a list of virtual machine extension image types. * @@ -264,11 +316,13 @@ public VirtualMachineExtensionImageInner get(String location, String publisherNa * @return a list of virtual machine extension image types. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listTypesWithResponseAsync( + public Mono>> listTypesWithResponseAsync( String location, String publisherName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -288,7 +342,7 @@ public Mono>> listTypesWi context -> service .listTypes( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, apiVersion, @@ -309,11 +363,13 @@ public Mono>> listTypesWi * @return a list of virtual machine extension image types. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listTypesWithResponseAsync( + public Mono>> listTypesWithResponseAsync( String location, String publisherName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -330,7 +386,12 @@ public Mono>> listTypesWi final String apiVersion = "2019-03-01"; return service .listTypes( - this.client.getHost(), location, publisherName, apiVersion, this.client.getSubscriptionId(), context); + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + context); } /** @@ -347,7 +408,32 @@ public Mono>> listTypesWi public Mono> listTypesAsync(String location, String publisherName) { return listTypesWithResponseAsync(location, publisherName) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTypesAsync( + String location, String publisherName, Context context) { + return listTypesWithResponseAsync(location, publisherName, context) + .flatMap( + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -371,6 +457,22 @@ public List listTypes(String location, String return listTypesAsync(location, publisherName).block(); } + /** + * Gets a list of virtual machine extension image types. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listTypes(String location, String publisherName, Context context) { + return listTypesAsync(location, publisherName, context).block(); + } + /** * Gets a list of virtual machine extension image versions. * @@ -386,11 +488,13 @@ public List listTypes(String location, String * @return a list of virtual machine extension image versions. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listVersionsWithResponseAsync( + public Mono>> listVersionsWithResponseAsync( String location, String publisherName, String type, String filter, Integer top, String orderby) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -413,7 +517,7 @@ public Mono>> listVersion context -> service .listVersions( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, type, @@ -442,7 +546,7 @@ public Mono>> listVersion * @return a list of virtual machine extension image versions. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listVersionsWithResponseAsync( + public Mono>> listVersionsWithResponseAsync( String location, String publisherName, String type, @@ -450,9 +554,11 @@ public Mono>> listVersion Integer top, String orderby, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -472,7 +578,7 @@ public Mono>> listVersion final String apiVersion = "2019-03-01"; return service .listVersions( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, type, @@ -503,7 +609,42 @@ public Mono> listVersionsAsync( String location, String publisherName, String type, String filter, Integer top, String orderby) { return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listVersionsAsync( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + Context context) { + return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby, context) + .flatMap( + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -532,7 +673,7 @@ public Mono> listVersionsAsync( final Context context = null; return listVersionsWithResponseAsync(location, publisherName, type, filter, top, orderby) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -561,6 +702,33 @@ public List listVersions( return listVersionsAsync(location, publisherName, type, filter, top, orderby).block(); } + /** + * Gets a list of virtual machine extension image versions. + * + * @param location The name of a supported Azure region. + * @param publisherName The publisherName parameter. + * @param type The type parameter. + * @param filter The filter to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine extension image versions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listVersions( + String location, + String publisherName, + String type, + String filter, + Integer top, + String orderby, + Context context) { + return listVersionsAsync(location, publisherName, type, filter, top, orderby, context).block(); + } + /** * Gets a list of virtual machine extension image versions. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineExtensionsClient.java similarity index 56% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineExtensionsClient.java index 6874de5d4697..f18e711b8023 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineExtensionsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -21,33 +21,37 @@ import com.azure.core.annotation.UnexpectedResponseExceptionType; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.VirtualMachineExtensionUpdate; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionsListResultInner; +import com.azure.management.compute.models.VirtualMachineExtensionUpdate; 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 VirtualMachineExtensions. */ -public final class VirtualMachineExtensionsInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionsInner.class); +public final class VirtualMachineExtensionsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineExtensionsClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineExtensionsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineExtensionsInner. + * Initializes an instance of VirtualMachineExtensionsClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineExtensionsInner(ComputeManagementClientImpl client) { + public VirtualMachineExtensionsClient(ComputeManagementClient client) { this.service = RestProxy .create(VirtualMachineExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -67,8 +71,8 @@ private interface VirtualMachineExtensionsService { + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @PathParam("vmExtensionName") String vmExtensionName, @@ -83,8 +87,8 @@ Mono>> createOrUpdate( + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @PathParam("vmExtensionName") String vmExtensionName, @@ -99,8 +103,8 @@ Mono>> update( + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @PathParam("vmExtensionName") String vmExtensionName, @@ -114,8 +118,8 @@ Mono>> delete( + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @PathParam("vmExtensionName") String vmExtensionName, @@ -130,8 +134,8 @@ Mono> get( + "/virtualMachines/{vmName}/extensions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("$expand") String expand, @@ -145,8 +149,8 @@ Mono> list( + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @PathParam("vmExtensionName") String vmExtensionName, @@ -161,8 +165,8 @@ Mono> beginCreateOrUpdate( + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @PathParam("vmExtensionName") String vmExtensionName, @@ -177,8 +181,8 @@ Mono> beginUpdate( + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @PathParam("vmExtensionName") String vmExtensionName, @@ -200,14 +204,16 @@ Mono> beginDelete( * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -238,7 +244,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -249,6 +255,128 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + context); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineExtensionInner> beginCreateOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class); + } + /** * The operation to create or update the extension. * @@ -267,7 +395,7 @@ public Mono createOrUpdateAsync( String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); return this .client @@ -280,6 +408,39 @@ public Mono createOrUpdateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * The operation to create or update the extension. * @@ -301,6 +462,29 @@ public VirtualMachineExtensionInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); } + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner createOrUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context).block(); + } + /** * The operation to update the extension. * @@ -314,14 +498,16 @@ public VirtualMachineExtensionInner createOrUpdate( * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( + public Mono>> updateWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -352,7 +538,7 @@ public Mono>> updateWithResponseAsync( context -> service .update( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -363,6 +549,128 @@ public Mono>> updateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + context); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineExtensionInner> beginUpdate( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class); + } + /** * The operation to update the extension. * @@ -381,7 +689,7 @@ public Mono updateAsync( String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { - Mono>> mono = + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters); return this .client @@ -394,6 +702,39 @@ public Mono updateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineExtensionInner.class, + VirtualMachineExtensionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * The operation to update the extension. * @@ -415,6 +756,29 @@ public VirtualMachineExtensionInner update( return updateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); } + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner update( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + return updateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context).block(); + } + /** * The operation to delete the extension. * @@ -427,11 +791,13 @@ public VirtualMachineExtensionInner update( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -456,7 +822,7 @@ public Mono>> deleteWithResponseAsync( context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -472,15 +838,125 @@ public Mono>> deleteWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine where the extension should be deleted. * @param vmExtensionName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmName, String vmExtensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } + if (vmExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmExtensionName 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 apiVersion = "2019-03-01"; + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + vmExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String vmName, String vmExtensionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String vmName, String vmExtensionName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName); + public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -503,6 +979,22 @@ public void delete(String resourceGroupName, String vmName, String vmExtensionNa deleteAsync(resourceGroupName, vmName, vmExtensionName).block(); } + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual 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 vmName, String vmExtensionName, Context context) { + deleteAsync(resourceGroupName, vmName, vmExtensionName, context).block(); + } + /** * The operation to get the extension. * @@ -516,11 +1008,13 @@ public void delete(String resourceGroupName, String vmName, String vmExtensionNa * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, String expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -545,7 +1039,7 @@ public Mono> getWithResponseAsync( context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -570,11 +1064,13 @@ public Mono> getWithResponseAsync( * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -596,7 +1092,7 @@ public Mono> getWithResponseAsync( final String apiVersion = "2019-03-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -623,7 +1119,34 @@ public Mono getAsync( String resourceGroupName, String vmName, String vmExtensionName, String expand) { return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine 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 a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -650,7 +1173,7 @@ public Mono getAsync( final Context context = null; return getWithResponseAsync(resourceGroupName, vmName, vmExtensionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -677,6 +1200,25 @@ public VirtualMachineExtensionInner get( return getAsync(resourceGroupName, vmName, vmExtensionName, expand).block(); } + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine 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 a Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner get( + String resourceGroupName, String vmName, String vmExtensionName, String expand, Context context) { + return getAsync(resourceGroupName, vmName, vmExtensionName, expand, context).block(); + } + /** * The operation to get the extension. * @@ -707,11 +1249,13 @@ public VirtualMachineExtensionInner get(String resourceGroupName, String vmName, * @return the List Extension operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( + public Mono> listWithResponseAsync( String resourceGroupName, String vmName, String expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -732,7 +1276,7 @@ public Mono> listWithRes context -> service .list( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, expand, @@ -755,11 +1299,13 @@ public Mono> listWithRes * @return the List Extension operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listWithResponseAsync( + public Mono> listWithResponseAsync( String resourceGroupName, String vmName, String expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -777,7 +1323,7 @@ public Mono> listWithRes final String apiVersion = "2019-03-01"; return service .list( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, expand, @@ -802,7 +1348,33 @@ public Mono listAsync( String resourceGroupName, String vmName, String expand) { return listWithResponseAsync(resourceGroupName, vmName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAsync( + String resourceGroupName, String vmName, String expand, Context context) { + return listWithResponseAsync(resourceGroupName, vmName, expand, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -827,7 +1399,7 @@ public Mono listAsync(String resourceGr final Context context = null; return listWithResponseAsync(resourceGroupName, vmName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -852,6 +1424,24 @@ public VirtualMachineExtensionsListResultInner list(String resourceGroupName, St return listAsync(resourceGroupName, vmName, expand).block(); } + /** + * The operation to get all extensions of a Virtual Machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 the List Extension operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionsListResultInner list( + String resourceGroupName, String vmName, String expand, Context context) { + return listAsync(resourceGroupName, vmName, expand, context).block(); + } + /** * The operation to get all extensions of a Virtual Machine. * @@ -882,14 +1472,16 @@ public VirtualMachineExtensionsListResultInner list(String resourceGroupName, St * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -919,8 +1511,8 @@ public Mono> beginCreateOrUpdateWit .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -945,15 +1537,17 @@ public Mono> beginCreateOrUpdateWit * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -980,8 +1574,8 @@ public Mono> beginCreateOrUpdateWit } final String apiVersion = "2019-03-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -1004,14 +1598,47 @@ public Mono> beginCreateOrUpdateWit * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, vmName, vmExtensionName, extensionParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, vmName, vmExtensionName, extensionParameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1033,12 +1660,38 @@ public Mono beginCreateOrUpdateAsync( * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdate( + public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) + .block(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be created or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, vmName, vmExtensionName, extensionParameters, context) + .block(); } /** @@ -1054,14 +1707,16 @@ public VirtualMachineExtensionInner beginCreateOrUpdate( * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1091,8 +1746,8 @@ public Mono> beginUpdateWithRespons .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -1117,15 +1772,17 @@ public Mono> beginUpdateWithRespons * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1152,8 +1809,8 @@ public Mono> beginUpdateWithRespons } final String apiVersion = "2019-03-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -1176,14 +1833,47 @@ public Mono> beginUpdateWithRespons * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, vmName, vmExtensionName, extensionParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, vmName, vmExtensionName, extensionParameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1205,12 +1895,36 @@ public Mono beginUpdateAsync( * @return describes a Virtual Machine Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdate( + public VirtualMachineExtensionInner beginUpdateWithoutPolling( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); + return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); + } + + /** + * The operation to update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Describes a Virtual 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 Virtual Machine Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineExtensionInner beginUpdateWithoutPolling( + String resourceGroupName, + String vmName, + String vmExtensionName, + VirtualMachineExtensionUpdate extensionParameters, + Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) + .block(); } /** @@ -1225,11 +1939,13 @@ public VirtualMachineExtensionInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1253,8 +1969,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -1277,11 +1993,13 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, String vmExtensionName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1302,8 +2020,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, vmExtensionName, @@ -1324,8 +2042,8 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { - return beginDeleteWithResponseAsync(resourceGroupName, vmName, vmExtensionName) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName, String vmExtensionName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, vmExtensionName) .flatMap((Response res) -> Mono.empty()); } @@ -1335,12 +2053,48 @@ public Mono beginDeleteAsync(String resourceGroupName, String vmName, Stri * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine where the extension should be deleted. * @param vmExtensionName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String vmName, String vmExtensionName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, vmExtensionName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual 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 beginDeleteWithoutPolling(String resourceGroupName, String vmName, String vmExtensionName) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName).block(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual 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 beginDelete(String resourceGroupName, String vmName, String vmExtensionName) { - beginDeleteAsync(resourceGroupName, vmName, vmExtensionName).block(); + public void beginDeleteWithoutPolling( + String resourceGroupName, String vmName, String vmExtensionName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, context).block(); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImagesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineImagesClient.java similarity index 68% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImagesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineImagesClient.java index b0853429f6ff..2d45b850a49a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImagesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineImagesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -15,31 +15,34 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.VirtualMachineImageInner; +import com.azure.management.compute.fluent.inner.VirtualMachineImageResourceInner; import java.util.List; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in VirtualMachineImages. */ -public final class VirtualMachineImagesInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineImagesInner.class); +public final class VirtualMachineImagesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineImagesClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineImagesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineImagesInner. + * Initializes an instance of VirtualMachineImagesClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineImagesInner(ComputeManagementClientImpl client) { + public VirtualMachineImagesClient(ComputeManagementClient client) { this.service = RestProxy .create(VirtualMachineImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -59,8 +62,8 @@ private interface VirtualMachineImagesService { + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("publisherName") String publisherName, @PathParam("offer") String offer, @@ -76,8 +79,8 @@ Mono> get( + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> list( - @HostParam("$host") String host, + Mono>> list( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("publisherName") String publisherName, @PathParam("offer") String offer, @@ -95,8 +98,8 @@ Mono>> list( + "/{publisherName}/artifacttypes/vmimage/offers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listOffers( - @HostParam("$host") String host, + Mono>> listOffers( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("publisherName") String publisherName, @QueryParam("api-version") String apiVersion, @@ -107,8 +110,8 @@ Mono>> listOffers( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listPublishers( - @HostParam("$host") String host, + Mono>> listPublishers( + @HostParam("$host") String endpoint, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -120,8 +123,8 @@ Mono>> listPublishers( + "/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> listSkus( - @HostParam("$host") String host, + Mono>> listSkus( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("publisherName") String publisherName, @PathParam("offer") String offer, @@ -144,11 +147,13 @@ Mono>> listSkus( * @return a virtual machine image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String location, String publisherName, String offer, String skus, String version) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -177,7 +182,7 @@ public Mono> getWithResponseAsync( context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, offer, @@ -204,11 +209,13 @@ public Mono> getWithResponseAsync( * @return a virtual machine image. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String location, String publisherName, String offer, String skus, String version, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -234,7 +241,7 @@ public Mono> getWithResponseAsync( final String apiVersion = "2019-03-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, offer, @@ -263,7 +270,35 @@ public Mono getAsync( String location, String publisherName, String offer, String skus, String version) { return getWithResponseAsync(location, publisherName, offer, skus, version) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String location, String publisherName, String offer, String skus, String version, Context context) { + return getWithResponseAsync(location, publisherName, offer, skus, version, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -291,6 +326,26 @@ public VirtualMachineImageInner get( return getAsync(location, publisherName, offer, skus, version).block(); } + /** + * Gets a virtual machine image. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param version A valid image SKU version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineImageInner get( + String location, String publisherName, String offer, String skus, String version, Context context) { + return getAsync(location, publisherName, offer, skus, version, context).block(); + } + /** * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. * @@ -307,11 +362,13 @@ public VirtualMachineImageInner get( * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listWithResponseAsync( + public Mono>> listWithResponseAsync( String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -337,7 +394,7 @@ public Mono>> listWithResp context -> service .list( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, offer, @@ -368,7 +425,7 @@ public Mono>> listWithResp * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listWithResponseAsync( + public Mono>> listWithResponseAsync( String location, String publisherName, String offer, @@ -377,9 +434,11 @@ public Mono>> listWithResp Integer top, String orderby, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -402,7 +461,7 @@ public Mono>> listWithResp final String apiVersion = "2019-03-01"; return service .list( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, offer, @@ -435,7 +494,44 @@ public Mono> listAsync( String location, String publisherName, String offer, String skus, String expand, Integer top, String orderby) { return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAsync( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby, context) + .flatMap( + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -465,7 +561,7 @@ public Mono> listAsync( final Context context = null; return listWithResponseAsync(location, publisherName, offer, skus, expand, top, orderby) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -495,6 +591,35 @@ public List list( return listAsync(location, publisherName, offer, skus, expand, top, orderby).block(); } + /** + * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param skus A valid image SKU. + * @param expand The expand expression to apply on the operation. + * @param top The top parameter. + * @param orderby The orderby parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List list( + String location, + String publisherName, + String offer, + String skus, + String expand, + Integer top, + String orderby, + Context context) { + return listAsync(location, publisherName, offer, skus, expand, top, orderby, context).block(); + } + /** * Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. * @@ -528,11 +653,13 @@ public List list( * @return a list of virtual machine image offers for the specified location and publisher. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listOffersWithResponseAsync( + public Mono>> listOffersWithResponseAsync( String location, String publisherName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -552,7 +679,7 @@ public Mono>> listOffersWi context -> service .listOffers( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, apiVersion, @@ -573,11 +700,13 @@ public Mono>> listOffersWi * @return a list of virtual machine image offers for the specified location and publisher. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listOffersWithResponseAsync( + public Mono>> listOffersWithResponseAsync( String location, String publisherName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -594,7 +723,12 @@ public Mono>> listOffersWi final String apiVersion = "2019-03-01"; return service .listOffers( - this.client.getHost(), location, publisherName, apiVersion, this.client.getSubscriptionId(), context); + this.client.getEndpoint(), + location, + publisherName, + apiVersion, + this.client.getSubscriptionId(), + context); } /** @@ -611,7 +745,32 @@ public Mono>> listOffersWi public Mono> listOffersAsync(String location, String publisherName) { return listOffersWithResponseAsync(location, publisherName) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOffersAsync( + String location, String publisherName, Context context) { + return listOffersWithResponseAsync(location, publisherName, context) + .flatMap( + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -635,6 +794,22 @@ public List listOffers(String location, String return listOffersAsync(location, publisherName).block(); } + /** + * Gets a list of virtual machine image offers for the specified location and publisher. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image offers for the specified location and publisher. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listOffers(String location, String publisherName, Context context) { + return listOffersAsync(location, publisherName, context).block(); + } + /** * Gets a list of virtual machine image publishers for the specified Azure location. * @@ -645,11 +820,12 @@ public List listOffers(String location, String * @return a list of virtual machine image publishers for the specified Azure location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listPublishersWithResponseAsync( - String location) { - if (this.client.getHost() == null) { + public Mono>> listPublishersWithResponseAsync(String location) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -666,7 +842,7 @@ public Mono>> listPublishe context -> service .listPublishers( - this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context)) + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } @@ -681,11 +857,13 @@ public Mono>> listPublishe * @return a list of virtual machine image publishers for the specified Azure location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listPublishersWithResponseAsync( + public Mono>> listPublishersWithResponseAsync( String location, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -698,7 +876,7 @@ public Mono>> listPublishe } final String apiVersion = "2019-03-01"; return service - .listPublishers(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context); + .listPublishers(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context); } /** @@ -714,7 +892,30 @@ public Mono>> listPublishe public Mono> listPublishersAsync(String location) { return listPublishersWithResponseAsync(location) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listPublishersAsync(String location, Context context) { + return listPublishersWithResponseAsync(location, context) + .flatMap( + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -737,6 +938,21 @@ public List listPublishers(String location) { return listPublishersAsync(location).block(); } + /** + * Gets a list of virtual machine image publishers for the specified Azure location. + * + * @param location The name of a supported Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image publishers for the specified Azure location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listPublishers(String location, Context context) { + return listPublishersAsync(location, context).block(); + } + /** * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. * @@ -749,11 +965,13 @@ public List listPublishers(String location) { * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listSkusWithResponseAsync( + public Mono>> listSkusWithResponseAsync( String location, String publisherName, String offer) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -776,7 +994,7 @@ public Mono>> listSkusWith context -> service .listSkus( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, offer, @@ -799,11 +1017,13 @@ public Mono>> listSkusWith * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> listSkusWithResponseAsync( + public Mono>> listSkusWithResponseAsync( String location, String publisherName, String offer, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -823,7 +1043,7 @@ public Mono>> listSkusWith final String apiVersion = "2019-03-01"; return service .listSkus( - this.client.getHost(), + this.client.getEndpoint(), location, publisherName, offer, @@ -848,7 +1068,33 @@ public Mono> listSkusAsync( String location, String publisherName, String offer) { return listSkusWithResponseAsync(location, publisherName, offer) .flatMap( - (SimpleResponse> res) -> { + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSkusAsync( + String location, String publisherName, String offer, Context context) { + return listSkusWithResponseAsync(location, publisherName, offer, context) + .flatMap( + (Response> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -872,4 +1118,22 @@ public Mono> listSkusAsync( public List listSkus(String location, String publisherName, String offer) { return listSkusAsync(location, publisherName, offer).block(); } + + /** + * Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. + * + * @param location The name of a supported Azure region. + * @param publisherName A valid image publisher. + * @param offer A valid image publisher offer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of virtual machine image SKUs for the specified location, publisher, and offer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listSkus( + String location, String publisherName, String offer, Context context) { + return listSkusAsync(location, publisherName, offer, context).block(); + } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineRunCommandsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineRunCommandsClient.java similarity index 75% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineRunCommandsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineRunCommandsClient.java index 6a3cc0d580ea..b0a67dea7f81 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineRunCommandsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineRunCommandsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -19,30 +19,34 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.RunCommandDocumentBaseInner; +import com.azure.management.compute.fluent.inner.RunCommandDocumentInner; +import com.azure.management.compute.fluent.inner.RunCommandListResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in VirtualMachineRunCommands. */ -public final class VirtualMachineRunCommandsInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandsInner.class); +public final class VirtualMachineRunCommandsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineRunCommandsClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineRunCommandsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineRunCommandsInner. + * Initializes an instance of VirtualMachineRunCommandsClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineRunCommandsInner(ComputeManagementClientImpl client) { + public VirtualMachineRunCommandsClient(ComputeManagementClient client) { this.service = RestProxy .create( @@ -61,8 +65,8 @@ private interface VirtualMachineRunCommandsService { @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -72,8 +76,8 @@ Mono> list( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("commandId") String commandId, @QueryParam("api-version") String apiVersion, @@ -84,7 +88,7 @@ Mono> get( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -99,9 +103,11 @@ Mono> listNext( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String location) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -116,7 +122,9 @@ public Mono> listSinglePageAsync(Stri return FluxUtil .withContext( context -> - service.list(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context)) + service + .list( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -141,9 +149,11 @@ public Mono> listSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -156,7 +166,7 @@ public Mono> listSinglePageAsync(Stri } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -212,6 +222,21 @@ public PagedIterable list(String location) { return new PagedIterable<>(listAsync(location)); } + /** + * Lists all available run commands for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + /** * Gets specific run command for a subscription in a location. * @@ -223,10 +248,12 @@ public PagedIterable list(String location) { * @return specific run command for a subscription in a location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String location, String commandId) { - if (this.client.getHost() == null) { + public Mono> getWithResponseAsync(String location, String commandId) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -246,7 +273,7 @@ public Mono> getWithResponseAsync(String context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), location, commandId, apiVersion, @@ -267,11 +294,13 @@ public Mono> getWithResponseAsync(String * @return specific run command for a subscription in a location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String location, String commandId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -287,7 +316,7 @@ public Mono> getWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .get(this.client.getHost(), location, commandId, apiVersion, this.client.getSubscriptionId(), context); + .get(this.client.getEndpoint(), location, commandId, apiVersion, this.client.getSubscriptionId(), context); } /** @@ -304,7 +333,31 @@ public Mono> getWithResponseAsync( public Mono getAsync(String location, String commandId) { return getWithResponseAsync(location, commandId) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String location, String commandId, Context context) { + return getWithResponseAsync(location, commandId, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -328,6 +381,22 @@ public RunCommandDocumentInner get(String location, String commandId) { return getAsync(location, commandId).block(); } + /** + * Gets specific run command for a subscription in a location. + * + * @param location The location upon which run commands is queried. + * @param commandId The command id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific run command for a subscription in a location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandDocumentInner get(String location, String commandId, Context context) { + return getAsync(location, commandId, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetExtensionsClient.java similarity index 61% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetExtensionsClient.java index 261b9ff2b42b..808278c54816 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetExtensionsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -24,32 +24,36 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetExtensionListResultInner; 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 VirtualMachineScaleSetExtensions. */ -public final class VirtualMachineScaleSetExtensionsInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionsInner.class); +public final class VirtualMachineScaleSetExtensionsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetExtensionsClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineScaleSetExtensionsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineScaleSetExtensionsInner. + * Initializes an instance of VirtualMachineScaleSetExtensionsClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineScaleSetExtensionsInner(ComputeManagementClientImpl client) { + public VirtualMachineScaleSetExtensionsClient(ComputeManagementClient client) { this.service = RestProxy .create( @@ -72,8 +76,8 @@ private interface VirtualMachineScaleSetExtensionsService { + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("vmssExtensionName") String vmssExtensionName, @@ -88,8 +92,8 @@ Mono>> createOrUpdate( + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("vmssExtensionName") String vmssExtensionName, @@ -103,8 +107,8 @@ Mono>> delete( + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("vmssExtensionName") String vmssExtensionName, @@ -119,8 +123,8 @@ Mono> get( + "/virtualMachineScaleSets/{vmScaleSetName}/extensions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -133,8 +137,8 @@ Mono> list( + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("vmssExtensionName") String vmssExtensionName, @@ -149,8 +153,8 @@ Mono> beginCreateOrUpdate( + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("vmssExtensionName") String vmssExtensionName, @@ -162,7 +166,7 @@ Mono> beginDelete( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -179,14 +183,16 @@ Mono> listNext( * @return describes a Virtual Machine Scale Set Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -217,7 +223,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -228,6 +234,131 @@ public Mono>> createOrUpdateWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Describes a Virtual Machine Scale Set 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 Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); + } else { + extensionParameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + extensionParameters, + context); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Describes a Virtual Machine Scale Set 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 Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetExtensionInner.class, + VirtualMachineScaleSetExtensionInner.class); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Describes a Virtual Machine Scale Set 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 Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineScaleSetExtensionInner> + beginCreateOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetExtensionInner.class, + VirtualMachineScaleSetExtensionInner.class); + } + /** * The operation to create or update an extension. * @@ -246,7 +377,7 @@ public Mono createOrUpdateAsync( String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) { - Mono>> mono = + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters); return this .client @@ -259,6 +390,40 @@ public Mono createOrUpdateAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Describes a Virtual Machine Scale Set 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 Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetExtensionInner.class, + VirtualMachineScaleSetExtensionInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * The operation to create or update an extension. * @@ -280,6 +445,30 @@ public VirtualMachineScaleSetExtensionInner createOrUpdate( return createOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters).block(); } + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Describes a Virtual Machine Scale Set 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 Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner createOrUpdate( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) + .block(); + } + /** * The operation to delete the extension. * @@ -292,11 +481,13 @@ public VirtualMachineScaleSetExtensionInner createOrUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -321,7 +512,7 @@ public Mono>> deleteWithResponseAsync( context -> service .delete( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -331,6 +522,95 @@ public Mono>> deleteWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (vmssExtensionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter vmssExtensionName 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 apiVersion = "2019-03-01"; + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + vmssExtensionName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * The operation to delete the extension. * @@ -344,7 +624,7 @@ public Mono>> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - Mono>> mono = + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName); return this .client @@ -353,6 +633,30 @@ public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, S .flatMap(AsyncPollResponse::getFinalResult); } + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * The operation to delete the extension. * @@ -368,6 +672,22 @@ public void delete(String resourceGroupName, String vmScaleSetName, String vmssE deleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).block(); } + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set 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 vmScaleSetName, String vmssExtensionName, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).block(); + } + /** * The operation to get the extension. * @@ -381,11 +701,13 @@ public void delete(String resourceGroupName, String vmScaleSetName, String vmssE * @return describes a Virtual Machine Scale Set Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -410,7 +732,7 @@ public Mono> getWithRespons context -> service .get( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -435,11 +757,13 @@ public Mono> getWithRespons * @return describes a Virtual Machine Scale Set Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( + public Mono> getWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -461,7 +785,7 @@ public Mono> getWithRespons final String apiVersion = "2019-03-01"; return service .get( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -488,7 +812,34 @@ public Mono getAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand) { return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set 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 a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -515,7 +866,7 @@ public Mono getAsync( final Context context = null; return getWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -542,6 +893,25 @@ public VirtualMachineScaleSetExtensionInner get( return getAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand).block(); } + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the extension. + * @param vmssExtensionName The name of the VM scale set 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 a Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner get( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, String expand, Context context) { + return getAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, expand, context).block(); + } + /** * The operation to get the extension. * @@ -574,9 +944,11 @@ public VirtualMachineScaleSetExtensionInner get( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync( String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -597,7 +969,7 @@ public Mono> listSinglePageA context -> service .list( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -629,9 +1001,11 @@ public Mono> listSinglePageA @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync( String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -649,7 +1023,7 @@ public Mono> listSinglePageA final String apiVersion = "2019-03-01"; return service .list( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -717,6 +1091,23 @@ public PagedIterable list(String resourceG return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName)); } + /** + * Gets a list of all extensions in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set containing the 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 list of all extensions in a VM scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, context)); + } + /** * The operation to create or update an extension. * @@ -730,14 +1121,16 @@ public PagedIterable list(String resourceG * @return describes a Virtual Machine Scale Set Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -767,8 +1160,8 @@ public Mono> beginCreateOrU .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -793,15 +1186,17 @@ public Mono> beginCreateOrU * @return describes a Virtual Machine Scale Set Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -828,8 +1223,8 @@ public Mono> beginCreateOrU } final String apiVersion = "2019-03-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -852,15 +1247,47 @@ public Mono> beginCreateOrU * @return describes a Virtual Machine Scale Set Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateWithResponseAsync( + return beginCreateOrUpdateWithoutPollingWithResponseAsync( resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Describes a Virtual Machine Scale Set 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 Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -882,12 +1309,38 @@ public Mono beginCreateOrUpdateAsync( * @return describes a Virtual Machine Scale Set Extension. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginCreateOrUpdate( + public VirtualMachineScaleSetExtensionInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) + .block(); + } + + /** + * The operation to create or update an extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmssExtensionName The name of the VM scale set extension. + * @param extensionParameters Describes a Virtual Machine Scale Set 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 Virtual Machine Scale Set Extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetExtensionInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, + String vmScaleSetName, + String vmssExtensionName, + VirtualMachineScaleSetExtensionInner extensionParameters, + Context context) { + return beginCreateOrUpdateWithoutPollingAsync( + resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) .block(); } @@ -903,11 +1356,13 @@ public VirtualMachineScaleSetExtensionInner beginCreateOrUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -931,8 +1386,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -955,11 +1410,13 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -980,8 +1437,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, vmssExtensionName, @@ -1002,8 +1459,9 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return beginDeleteWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) .flatMap((Response res) -> Mono.empty()); } @@ -1013,13 +1471,49 @@ public Mono beginDeleteAsync(String resourceGroupName, String vmScaleSetNa * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. * @param vmssExtensionName The name of the VM scale set 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).block(); + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set 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 beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).block(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. + * @param vmssExtensionName The name of the VM scale set 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 beginDeleteWithoutPolling( + String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetRollingUpgradesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java similarity index 53% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetRollingUpgradesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java index 4d57be44216c..16f7ed2cdeb2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetRollingUpgradesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -18,32 +18,35 @@ import com.azure.core.annotation.UnexpectedResponseExceptionType; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.RollingUpgradeStatusInfoInner; 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 VirtualMachineScaleSetRollingUpgrades. */ -public final class VirtualMachineScaleSetRollingUpgradesInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetRollingUpgradesInner.class); +public final class VirtualMachineScaleSetRollingUpgradesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetRollingUpgradesClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineScaleSetRollingUpgradesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineScaleSetRollingUpgradesInner. + * Initializes an instance of VirtualMachineScaleSetRollingUpgradesClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineScaleSetRollingUpgradesInner(ComputeManagementClientImpl client) { + public VirtualMachineScaleSetRollingUpgradesClient(ComputeManagementClient client) { this.service = RestProxy .create( @@ -66,8 +69,8 @@ private interface VirtualMachineScaleSetRollingUpgradesService { + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cancel( - @HostParam("$host") String host, + Mono>> cancel( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -80,8 +83,8 @@ Mono>> cancel( + "/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startOSUpgrade( - @HostParam("$host") String host, + Mono>> startOSUpgrade( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -94,8 +97,8 @@ Mono>> startOSUpgrade( + "/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startExtensionUpgrade( - @HostParam("$host") String host, + Mono>> startExtensionUpgrade( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -108,8 +111,8 @@ Mono>> startExtensionUpgrade( + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getLatest( - @HostParam("$host") String host, + Mono> getLatest( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -122,8 +125,8 @@ Mono> getLatest( + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCancel( - @HostParam("$host") String host, + Mono> beginCancelWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -136,8 +139,8 @@ Mono> beginCancel( + "/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartOSUpgrade( - @HostParam("$host") String host, + Mono> beginStartOSUpgradeWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -150,8 +153,8 @@ Mono> beginStartOSUpgrade( + "/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartExtensionUpgrade( - @HostParam("$host") String host, + Mono> beginStartExtensionUpgradeWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -170,11 +173,12 @@ Mono> beginStartExtensionUpgrade( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> cancelWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + public Mono>> cancelWithResponseAsync(String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -195,7 +199,7 @@ public Mono>> cancelWithResponseAsync( context -> service .cancel( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -204,6 +208,84 @@ public Mono>> cancelWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> cancelWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginCancel(String resourceGroupName, String vmScaleSetName) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginCancel( + String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Cancels the current virtual machine scale set rolling upgrade. * @@ -216,7 +298,28 @@ public Mono>> cancelWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAsync(String resourceGroupName, String vmScaleSetName) { - Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName); + Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelAsync(String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, vmScaleSetName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -238,6 +341,21 @@ public void cancel(String resourceGroupName, String vmScaleSetName) { cancelAsync(resourceGroupName, vmScaleSetName).block(); } + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String vmScaleSetName, Context context) { + cancelAsync(resourceGroupName, vmScaleSetName, context).block(); + } + /** * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image * OS version. Instances which are already running the latest available OS version are not affected. @@ -250,11 +368,13 @@ public void cancel(String resourceGroupName, String vmScaleSetName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startOSUpgradeWithResponseAsync( + public Mono>> startOSUpgradeWithResponseAsync( String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -275,7 +395,7 @@ public Mono>> startOSUpgradeWithResponseAsync( context -> service .startOSUpgrade( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -284,6 +404,88 @@ public Mono>> startOSUpgradeWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startOSUpgradeWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return service + .startOSUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) { + Mono>> mono = startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartOSUpgrade( + String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = + startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image * OS version. Instances which are already running the latest available OS version are not affected. @@ -297,8 +499,30 @@ public Mono>> startOSUpgradeWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - Mono>> mono = - startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + Mono>> mono = startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = + startOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -321,6 +545,22 @@ public void startOSUpgrade(String resourceGroupName, String vmScaleSetName) { startOSUpgradeAsync(resourceGroupName, vmScaleSetName).block(); } + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 startOSUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { + startOSUpgradeAsync(resourceGroupName, vmScaleSetName, context).block(); + } + /** * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest * available extension version. Instances which are already running the latest extension versions are not affected. @@ -333,11 +573,13 @@ public void startOSUpgrade(String resourceGroupName, String vmScaleSetName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startExtensionUpgradeWithResponseAsync( + public Mono>> startExtensionUpgradeWithResponseAsync( String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -358,7 +600,7 @@ public Mono>> startExtensionUpgradeWithResponseA context -> service .startExtensionUpgrade( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -367,6 +609,90 @@ public Mono>> startExtensionUpgradeWithResponseA .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startExtensionUpgradeWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return service + .startExtensionUpgrade( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartExtensionUpgrade( + String resourceGroupName, String vmScaleSetName) { + Mono>> mono = + startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartExtensionUpgrade( + String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = + startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest * available extension version. Instances which are already running the latest extension versions are not affected. @@ -380,7 +706,7 @@ public Mono>> startExtensionUpgradeWithResponseA */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - Mono>> mono = + Mono>> mono = startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName); return this .client @@ -389,6 +715,29 @@ public Mono startExtensionUpgradeAsync(String resourceGroupName, String vm .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = + startExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest * available extension version. Instances which are already running the latest extension versions are not affected. @@ -404,6 +753,22 @@ public void startExtensionUpgrade(String resourceGroupName, String vmScaleSetNam startExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).block(); } + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 startExtensionUpgrade(String resourceGroupName, String vmScaleSetName, Context context) { + startExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context).block(); + } + /** * Gets the status of the latest virtual machine scale set rolling upgrade. * @@ -415,11 +780,13 @@ public void startExtensionUpgrade(String resourceGroupName, String vmScaleSetNam * @return the status of the latest virtual machine scale set rolling upgrade. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLatestWithResponseAsync( + public Mono> getLatestWithResponseAsync( String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -440,7 +807,7 @@ public Mono> getLatestWithResponse context -> service .getLatest( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -461,11 +828,13 @@ public Mono> getLatestWithResponse * @return the status of the latest virtual machine scale set rolling upgrade. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLatestWithResponseAsync( + public Mono> getLatestWithResponseAsync( String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -483,7 +852,7 @@ public Mono> getLatestWithResponse final String apiVersion = "2019-03-01"; return service .getLatest( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -505,7 +874,32 @@ public Mono> getLatestWithResponse public Mono getLatestAsync(String resourceGroupName, String vmScaleSetName) { return getLatestWithResponseAsync(resourceGroupName, vmScaleSetName) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLatestAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return getLatestWithResponseAsync(resourceGroupName, vmScaleSetName, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -529,6 +923,22 @@ public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String return getLatestAsync(resourceGroupName, vmScaleSetName).block(); } + /** + * Gets the status of the latest virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the latest virtual machine scale set rolling upgrade. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String vmScaleSetName, Context context) { + return getLatestAsync(resourceGroupName, vmScaleSetName, context).block(); + } + /** * Cancels the current virtual machine scale set rolling upgrade. * @@ -540,10 +950,13 @@ public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCancelWithResponseAsync(String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + public Mono> beginCancelWithoutPollingWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -563,8 +976,8 @@ public Mono> beginCancelWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginCancel( - this.client.getHost(), + .beginCancelWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -585,11 +998,13 @@ public Mono> beginCancelWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCancelWithResponseAsync( + public Mono> beginCancelWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -606,8 +1021,8 @@ public Mono> beginCancelWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginCancel( - this.client.getHost(), + .beginCancelWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -626,8 +1041,25 @@ public Mono> beginCancelWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCancelAsync(String resourceGroupName, String vmScaleSetName) { - return beginCancelWithResponseAsync(resourceGroupName, vmScaleSetName) + public Mono beginCancelWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { + return beginCancelWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCancelWithoutPollingAsync(String resourceGroupName, String vmScaleSetName, Context context) { + return beginCancelWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) .flatMap((Response res) -> Mono.empty()); } @@ -641,8 +1073,23 @@ public Mono beginCancelAsync(String resourceGroupName, String vmScaleSetNa * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginCancel(String resourceGroupName, String vmScaleSetName) { - beginCancelAsync(resourceGroupName, vmScaleSetName).block(); + public void beginCancelWithoutPolling(String resourceGroupName, String vmScaleSetName) { + beginCancelWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Cancels the current virtual machine scale set rolling upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginCancelWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { + beginCancelWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); } /** @@ -657,10 +1104,13 @@ public void beginCancel(String resourceGroupName, String vmScaleSetName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartOSUpgradeWithResponseAsync(String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + public Mono> beginStartOSUpgradeWithoutPollingWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -680,8 +1130,8 @@ public Mono> beginStartOSUpgradeWithResponseAsync(String resource .withContext( context -> service - .beginStartOSUpgrade( - this.client.getHost(), + .beginStartOSUpgradeWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -703,11 +1153,13 @@ public Mono> beginStartOSUpgradeWithResponseAsync(String resource * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartOSUpgradeWithResponseAsync( + public Mono> beginStartOSUpgradeWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -724,8 +1176,8 @@ public Mono> beginStartOSUpgradeWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginStartOSUpgrade( - this.client.getHost(), + .beginStartOSUpgradeWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -745,8 +1197,8 @@ public Mono> beginStartOSUpgradeWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartOSUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName) + public Mono beginStartOSUpgradeWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { + return beginStartOSUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) .flatMap((Response res) -> Mono.empty()); } @@ -756,13 +1208,48 @@ public Mono beginStartOSUpgradeAsync(String resourceGroupName, String vmSc * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) { - beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName).block(); + public Mono beginStartOSUpgradeWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return beginStartOSUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginStartOSUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName) { + beginStartOSUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image + * OS version. Instances which are already running the latest available OS version are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginStartOSUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { + beginStartOSUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); } /** @@ -777,11 +1264,13 @@ public void beginStartOSUpgrade(String resourceGroupName, String vmScaleSetName) * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartExtensionUpgradeWithResponseAsync( + public Mono> beginStartExtensionUpgradeWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -801,8 +1290,8 @@ public Mono> beginStartExtensionUpgradeWithResponseAsync( .withContext( context -> service - .beginStartExtensionUpgrade( - this.client.getHost(), + .beginStartExtensionUpgradeWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -824,11 +1313,13 @@ public Mono> beginStartExtensionUpgradeWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartExtensionUpgradeWithResponseAsync( + public Mono> beginStartExtensionUpgradeWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -845,8 +1336,8 @@ public Mono> beginStartExtensionUpgradeWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginStartExtensionUpgrade( - this.client.getHost(), + .beginStartExtensionUpgradeWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -866,8 +1357,8 @@ public Mono> beginStartExtensionUpgradeWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartExtensionUpgradeWithResponseAsync(resourceGroupName, vmScaleSetName) + public Mono beginStartExtensionUpgradeWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { + return beginStartExtensionUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) .flatMap((Response res) -> Mono.empty()); } @@ -877,12 +1368,48 @@ public Mono beginStartExtensionUpgradeAsync(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartExtensionUpgrade(String resourceGroupName, String vmScaleSetName) { - beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName).block(); + public Mono beginStartExtensionUpgradeWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return beginStartExtensionUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginStartExtensionUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName) { + beginStartExtensionUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest + * available extension version. Instances which are already running the latest extension versions are not affected. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginStartExtensionUpgradeWithoutPolling( + String resourceGroupName, String vmScaleSetName, Context context) { + beginStartExtensionUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetVMsClient.java similarity index 55% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetVMsClient.java index 49cd15913901..0f0caa0a8b2f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetVMsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -25,35 +25,41 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.InstanceViewTypes; -import com.azure.management.compute.RunCommandInput; -import com.azure.management.compute.VirtualMachineReimageParameters; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.RunCommandResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetVMInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetVMListResultInner; +import com.azure.management.compute.models.InstanceViewTypes; +import com.azure.management.compute.models.RunCommandInput; +import com.azure.management.compute.models.VirtualMachineReimageParameters; 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 VirtualMachineScaleSetVMs. */ -public final class VirtualMachineScaleSetVMsInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMsInner.class); +public final class VirtualMachineScaleSetVMsClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMsClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineScaleSetVMsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineScaleSetVMsInner. + * Initializes an instance of VirtualMachineScaleSetVMsClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineScaleSetVMsInner(ComputeManagementClientImpl client) { + public VirtualMachineScaleSetVMsClient(ComputeManagementClient client) { this.service = RestProxy .create( @@ -74,8 +80,8 @@ private interface VirtualMachineScaleSetVMsService { + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimage( - @HostParam("$host") String host, + Mono>> reimage( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -90,8 +96,8 @@ Mono>> reimage( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimageAll( - @HostParam("$host") String host, + Mono>> reimageAll( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -105,8 +111,8 @@ Mono>> reimageAll( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deallocate( - @HostParam("$host") String host, + Mono>> deallocate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -120,8 +126,8 @@ Mono>> deallocate( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -136,8 +142,8 @@ Mono>> update( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -151,8 +157,8 @@ Mono>> delete( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String host, + Mono> get( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -167,8 +173,8 @@ Mono> get( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceView( - @HostParam("$host") String host, + Mono> getInstanceView( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -182,8 +188,8 @@ Mono> getInstanceView( + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, @QueryParam("$filter") String filter, @@ -199,8 +205,8 @@ Mono> list( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> powerOff( - @HostParam("$host") String host, + Mono>> powerOff( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -215,8 +221,8 @@ Mono>> powerOff( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String host, + Mono>> restart( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -230,8 +236,8 @@ Mono>> restart( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String host, + Mono>> start( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -245,8 +251,8 @@ Mono>> start( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String host, + Mono>> redeploy( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -260,8 +266,8 @@ Mono>> redeploy( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> performMaintenance( - @HostParam("$host") String host, + Mono>> performMaintenance( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -275,8 +281,8 @@ Mono>> performMaintenance( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> runCommand( - @HostParam("$host") String host, + Mono>> runCommand( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -291,8 +297,8 @@ Mono>> runCommand( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimage( - @HostParam("$host") String host, + Mono> beginReimageWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -307,8 +313,8 @@ Mono> beginReimage( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageAll( - @HostParam("$host") String host, + Mono> beginReimageAllWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -322,8 +328,8 @@ Mono> beginReimageAll( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocate( - @HostParam("$host") String host, + Mono> beginDeallocateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -337,8 +343,8 @@ Mono> beginDeallocate( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -353,8 +359,8 @@ Mono> beginUpdate( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -368,8 +374,8 @@ Mono> beginDelete( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOff( - @HostParam("$host") String host, + Mono> beginPowerOffWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -384,8 +390,8 @@ Mono> beginPowerOff( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestart( - @HostParam("$host") String host, + Mono> beginRestartWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -399,8 +405,8 @@ Mono> beginRestart( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStart( - @HostParam("$host") String host, + Mono> beginStartWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -414,8 +420,8 @@ Mono> beginStart( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeploy( - @HostParam("$host") String host, + Mono> beginRedeployWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -429,8 +435,8 @@ Mono> beginRedeploy( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenance( - @HostParam("$host") String host, + Mono> beginPerformMaintenanceWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -444,8 +450,8 @@ Mono> beginPerformMaintenance( + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRunCommand( - @HostParam("$host") String host, + Mono> beginRunCommandWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @PathParam("instanceId") String instanceId, @@ -458,7 +464,7 @@ Mono> beginRunCommand( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -476,11 +482,13 @@ Mono> listNext( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageWithResponseAsync( + public Mono>> reimageWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -510,7 +518,7 @@ public Mono>> reimageWithResponseAsync( context -> service .reimage( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -521,6 +529,107 @@ public Mono>> reimageWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> reimageWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + VirtualMachineReimageParameters vmScaleSetVMReimageInputInternal = null; + if (tempDisk != null) { + vmScaleSetVMReimageInputInternal = new VirtualMachineReimageParameters(); + vmScaleSetVMReimageInputInternal.withTempDisk(tempDisk); + } + VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetVMReimageInput, + context); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginReimage( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginReimage( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. * @@ -537,7 +646,7 @@ public Mono>> reimageWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono reimageAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - Mono>> mono = + Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk); return this .client @@ -546,6 +655,32 @@ public Mono reimageAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono reimageAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. * @@ -563,6 +698,25 @@ public void reimage(String resourceGroupName, String vmScaleSetName, String inst reimageAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk).block(); } + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reimage( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { + reimageAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context).block(); + } + /** * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is * only supported for managed disks. @@ -576,11 +730,13 @@ public void reimage(String resourceGroupName, String vmScaleSetName, String inst * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageAllWithResponseAsync( + public Mono>> reimageAllWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -604,7 +760,7 @@ public Mono>> reimageAllWithResponseAsync( context -> service .reimageAll( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -614,6 +770,97 @@ public Mono>> reimageAllWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> reimageAllWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + /** * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is * only supported for managed disks. @@ -628,7 +875,7 @@ public Mono>> reimageAllWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = + Mono>> mono = reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); return this .client @@ -637,6 +884,31 @@ public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetNam .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono reimageAllAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is * only supported for managed disks. @@ -653,6 +925,23 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, String i reimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).block(); } + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimageAll(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + reimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + /** * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -666,11 +955,13 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, String i * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deallocateWithResponseAsync( + public Mono>> deallocateWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -694,7 +985,7 @@ public Mono>> deallocateWithResponseAsync( context -> service .deallocate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -711,56 +1002,20 @@ public Mono>> deallocateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { - deallocateAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - if (this.client.getHost() == null) { + public Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -778,76 +1033,62 @@ public Mono>> updateWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Updates a virtual machine of a VM scale set. + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetVMInner.class, - VirtualMachineScaleSetVMInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public PollerFlux, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Updates a virtual machine of a VM scale set. + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine scale set virtual machine. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner update( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return updateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + public PollerFlux, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Deletes a virtual machine from a VM scale set. + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -858,59 +1099,34 @@ public VirtualMachineScaleSetVMInner update( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Deletes a virtual machine from a VM scale set. + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + public Mono deallocateAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -919,7 +1135,8 @@ public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, S } /** - * Deletes a virtual machine from a VM scale set. + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -929,28 +1146,47 @@ public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, S * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName, String instanceId) { - deleteAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { + deallocateAsync(resourceGroupName, vmScaleSetName, instanceId).block(); } /** - * Gets a virtual machine from a VM scale set. + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine from a VM scale set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { - if (this.client.getHost() == null) { + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + deallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Describes a virtual machine scale set virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -968,42 +1204,53 @@ public Mono> getWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String apiVersion = "2019-03-01"; return FluxUtil .withContext( context -> service - .get( - this.client.getHost(), + .update( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, - expand, apiVersion, this.client.getSubscriptionId(), + parameters, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets a virtual machine from a VM scale set. + * Updates a virtual machine of a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine from a VM scale set. + * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { - if (this.client.getHost() == null) { + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1021,110 +1268,185 @@ public Mono> getWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String apiVersion = "2019-03-01"; return service - .get( - this.client.getHost(), + .update( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, - expand, apiVersion, this.client.getSubscriptionId(), + parameters, context); } /** - * Gets a virtual machine from a VM scale set. + * Updates a virtual machine of a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine from a VM scale set. + * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMInner.class, + VirtualMachineScaleSetVMInner.class); } /** - * Gets a virtual machine from a VM scale set. + * Updates a virtual machine of a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. * @param instanceId The instance ID of the virtual machine. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine from a VM scale set. + * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final InstanceViewTypes expand = null; - final Context context = null; - return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, VirtualMachineScaleSetVMInner> beginUpdate( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMInner.class, + VirtualMachineScaleSetVMInner.class); } /** - * Gets a virtual machine from a VM scale set. + * Updates a virtual machine of a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. * @param instanceId The instance ID of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine from a VM scale set. + * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner get( - String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { - return getAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); + public Mono updateAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMInner.class, + VirtualMachineScaleSetVMInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets a virtual machine from a VM scale set. + * Updates a virtual machine of a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. * @param instanceId The instance ID of the virtual machine. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine from a VM scale set. + * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScaleSetName, String instanceId) { - final InstanceViewTypes expand = null; - final Context context = null; - return getAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); + public Mono updateAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetVMInner.class, + VirtualMachineScaleSetVMInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets the status of a virtual machine from a VM scale set. + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Describes a virtual machine scale set virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner update( + String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner update( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + return updateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); + } + + /** + * Deletes a virtual machine from a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1132,14 +1454,16 @@ public VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScal * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceViewWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1162,8 +1486,8 @@ public Mono> getInstan .withContext( context -> service - .getInstanceView( - this.client.getHost(), + .delete( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -1174,7 +1498,7 @@ public Mono> getInstan } /** - * Gets the status of a virtual machine from a VM scale set. + * Deletes a virtual machine from a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1183,14 +1507,16 @@ public Mono> getInstan * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceViewWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1210,8 +1536,8 @@ public Mono> getInstan } final String apiVersion = "2019-03-01"; return service - .getInstanceView( - this.client.getHost(), + .delete( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -1221,7 +1547,7 @@ public Mono> getInstan } /** - * Gets the status of a virtual machine from a VM scale set. + * Deletes a virtual machine from a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1229,68 +1555,140 @@ public Mono> getInstan * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a virtual machine from a VM scale set. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceViewAsync( + public PollerFlux, Void> beginDelete( String resourceGroupName, String vmScaleSetName, String instanceId) { - return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets the status of a virtual machine from a VM scale set. + * Deletes a virtual machine from a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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 status of a virtual machine from a VM scale set. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInstanceViewInner getInstanceView( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return getInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public PollerFlux, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets a list of all virtual machines in a VM scale sets. + * Deletes a virtual machine from a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. - * @param select The list parameters. - * @param expand The expand expression to apply to the operation. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a list of all virtual machines in a VM scale sets. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync( - String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { - if (this.client.getHost() == null) { + public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (virtualMachineScaleSetName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1303,63 +1701,1251 @@ public Mono> listSinglePageAsync( .withContext( context -> service - .list( - this.client.getHost(), + .get( + this.client.getEndpoint(), resourceGroupName, - virtualMachineScaleSetName, - filter, - select, + vmScaleSetName, + instanceId, expand, apiVersion, this.client.getSubscriptionId(), context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets a list of all virtual machines in a VM scale sets. + * Gets a virtual machine from a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. - * @param select The list parameters. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + expand, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + final InstanceViewTypes expand = null; + final Context context = null; + return getWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner get( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand) { + return getAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner get( + String resourceGroupName, String vmScaleSetName, String instanceId, InstanceViewTypes expand, Context context) { + return getAsync(resourceGroupName, vmScaleSetName, instanceId, expand, context).block(); + } + + /** + * Gets a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScaleSetName, String instanceId) { + final InstanceViewTypes expand = null; + final Context context = null; + return getAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInstanceViewInner getInstanceView( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return getInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Gets the status of a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 status of a virtual machine from a VM scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInstanceViewInner getInstanceView( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return getInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. + * @param select The list parameters. + * @param expand The expand expression to apply to 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 a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + filter, + select, + expand, + apiVersion, + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. + * @param select The list parameters. + * @param expand The expand expression to apply to 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 a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (virtualMachineScaleSetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineScaleSetName 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 apiVersion = "2019-03-01"; + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualMachineScaleSetName, + filter, + select, + expand, + apiVersion, + this.client.getSubscriptionId(), + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. + * @param select The list parameters. + * @param expand The expand expression to apply to 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 a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. + * @param select The list parameters. + * @param expand The expand expression to apply to 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 a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + final String filter = null; + final String select = null; + final String expand = null; + final Context context = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. + * @param select The list parameters. + * @param expand The expand expression to apply to 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 a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @param filter The filter to apply to the operation. + * @param select The list parameters. * @param expand The expand expression to apply to 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 a list of all virtual machines in a VM scale sets. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String virtualMachineScaleSetName, + String filter, + String select, + String expand, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context)); + } + + /** + * Gets a list of all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all virtual machines in a VM scale sets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualMachineScaleSetName) { + final String filter = null; + final String select = null; + final String expand = null; + final Context context = null; + return new PagedIterable<>(listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand)); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean skipShutdown = null; + final Context context = null; + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { + powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 powerOff( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).block(); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { + final Boolean skipShutdown = null; + final Context context = null; + powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String filter, - String select, - String expand, - Context context) { - if (this.client.getHost() == null) { + public Mono>> restartWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (virtualMachineScaleSetName == null) { + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( - "Parameter virtualMachineScaleSetName is required and cannot be null.")); + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2019-03-01"; + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId) { + restartAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + restartAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1369,157 +2955,148 @@ public Mono> listSinglePageAsync( } final String apiVersion = "2019-03-01"; return service - .list( - this.client.getHost(), + .start( + this.client.getEndpoint(), resourceGroupName, - virtualMachineScaleSetName, - filter, - select, - expand, + vmScaleSetName, + instanceId, apiVersion, this.client.getSubscriptionId(), - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStart( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets a list of all virtual machines in a VM scale sets. + * Starts a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. - * @param select The list parameters. - * @param expand The expand expression to apply to the operation. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a list of all virtual machines in a VM scale sets. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStart( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets a list of all virtual machines in a VM scale sets. + * Starts a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. - * @param select The list parameters. - * @param expand The expand expression to apply to the operation. - * @param context The context to associate with this operation. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a list of all virtual machines in a VM scale sets. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, - String virtualMachineScaleSetName, - String filter, - String select, - String expand, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand, context), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets a list of all virtual machines in a VM scale sets. + * Starts a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a list of all virtual machines in a VM scale sets. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String virtualMachineScaleSetName) { - final String filter = null; - final String select = null; - final String expand = null; - final Context context = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets a list of all virtual machines in a VM scale sets. + * Starts a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. - * @param filter The filter to apply to the operation. - * @param select The list parameters. - * @param expand The expand expression to apply to the operation. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a list of all virtual machines in a VM scale sets. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String virtualMachineScaleSetName, String filter, String select, String expand) { - return new PagedIterable<>(listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmScaleSetName, String instanceId) { + startAsync(resourceGroupName, vmScaleSetName, instanceId).block(); } /** - * Gets a list of all virtual machines in a VM scale sets. + * Starts a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param virtualMachineScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 a list of all virtual machines in a VM scale sets. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String virtualMachineScaleSetName) { - final String filter = null; - final String select = null; - final String expand = null; - final Context context = null; - return new PagedIterable<>(listAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + startAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - if (this.client.getHost() == null) { + public Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1542,12 +3119,11 @@ public Mono>> powerOffWithResponseAsync( .withContext( context -> service - .powerOff( - this.client.getHost(), + .redeploy( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, - skipShutdown, apiVersion, this.client.getSubscriptionId(), context)) @@ -1555,35 +3131,56 @@ public Mono>> powerOffWithResponseAsync( } /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; + return service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1594,40 +3191,35 @@ public Mono powerOffAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - final Context context = null; - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public PollerFlux, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + public PollerFlux, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1635,66 +3227,45 @@ public void powerOff(String resourceGroupName, String vmScaleSetName, String ins * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - final Context context = null; - powerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Restarts a virtual machine in a VM scale set. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restartWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono redeployAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Restarts a virtual machine in a VM scale set. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1702,36 +3273,30 @@ public Mono>> restartWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { + redeployAsync(resourceGroupName, vmScaleSetName, instanceId).block(); } /** - * Restarts a virtual machine in a VM scale set. + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmScaleSetName, String instanceId) { - restartAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + redeployAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** - * Starts a virtual machine in a VM scale set. + * Performs maintenance on a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1742,11 +3307,13 @@ public void restart(String resourceGroupName, String vmScaleSetName, String inst * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync( + public Mono>> performMaintenanceWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1769,8 +3336,8 @@ public Mono>> startWithResponseAsync( .withContext( context -> service - .start( - this.client.getHost(), + .performMaintenance( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -1781,59 +3348,25 @@ public Mono>> startWithResponseAsync( } /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String vmScaleSetName, String instanceId) { - startAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * Performs maintenance on a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + public Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1852,23 +3385,19 @@ public Mono>> redeployWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .redeploy( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * Performs maintenance on a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1879,29 +3408,31 @@ public Mono>> redeployWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public PollerFlux, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * Performs maintenance on a virtual machine in a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { - redeployAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public PollerFlux, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** @@ -1916,42 +3447,14 @@ public void redeploy(String resourceGroupName, String vmScaleSetName, String ins * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .performMaintenance( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -1960,15 +3463,17 @@ public Mono>> performMaintenanceWithResponseAsyn * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - Mono>> mono = - performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId); + public Mono performMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -1991,6 +3496,23 @@ public void performMaintenance(String resourceGroupName, String vmScaleSetName, performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).block(); } + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void performMaintenance( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); + } + /** * Run command on a virtual machine in a VM scale set. * @@ -2004,11 +3526,13 @@ public void performMaintenance(String resourceGroupName, String vmScaleSetName, * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> runCommandWithResponseAsync( + public Mono>> runCommandWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2037,7 +3561,7 @@ public Mono>> runCommandWithResponseAsync( context -> service .runCommand( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2048,6 +3572,117 @@ public Mono>> runCommandWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> runCommandWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + instanceId, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, RunCommandResultInner> beginRunCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class); + } + /** * Run command on a virtual machine in a VM scale set. * @@ -2063,7 +3698,7 @@ public Mono>> runCommandWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono runCommandAsync( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - Mono>> mono = + Mono>> mono = runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters); return this .client @@ -2073,6 +3708,36 @@ public Mono runCommandAsync( .flatMap(AsyncPollResponse::getFinalResult); } + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono runCommandAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + /** * Run command on a virtual machine in a VM scale set. * @@ -2091,6 +3756,29 @@ public RunCommandResultInner runCommand( return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); } + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); + } + /** * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. * @@ -2105,11 +3793,13 @@ public RunCommandResultInner runCommand( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithResponseAsync( + public Mono> beginReimageWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2138,8 +3828,8 @@ public Mono> beginReimageWithResponseAsync( .withContext( context -> service - .beginReimage( - this.client.getHost(), + .beginReimageWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2165,11 +3855,13 @@ public Mono> beginReimageWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithResponseAsync( + public Mono> beginReimageWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2195,8 +3887,8 @@ public Mono> beginReimageWithResponseAsync( } VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; return service - .beginReimage( - this.client.getHost(), + .beginReimageWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2220,9 +3912,31 @@ public Mono> beginReimageWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAsync( + public Mono beginReimageWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - return beginReimageWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk) + return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginReimageWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { + return beginReimageWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, tempDisk, context) .flatMap((Response res) -> Mono.empty()); } @@ -2239,8 +3953,28 @@ public Mono beginReimageAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimage(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk).block(); + public void beginReimageWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { + beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk).block(); + } + + /** + * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginReimageWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { + beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context).block(); } /** @@ -2256,11 +3990,13 @@ public void beginReimage(String resourceGroupName, String vmScaleSetName, String * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithResponseAsync( + public Mono> beginReimageAllWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2283,8 +4019,8 @@ public Mono> beginReimageAllWithResponseAsync( .withContext( context -> service - .beginReimageAll( - this.client.getHost(), + .beginReimageAllWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2308,11 +4044,13 @@ public Mono> beginReimageAllWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithResponseAsync( + public Mono> beginReimageAllWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2332,8 +4070,8 @@ public Mono> beginReimageAllWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginReimageAll( - this.client.getHost(), + .beginReimageAllWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2355,8 +4093,29 @@ public Mono> beginReimageAllWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + public Mono beginReimageAllWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginReimageAllWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) .flatMap((Response res) -> Mono.empty()); } @@ -2372,8 +4131,26 @@ public Mono beginReimageAllAsync(String resourceGroupName, String vmScaleS * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageAll(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void beginReimageAllWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is + * only supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginReimageAllWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** @@ -2389,11 +4166,13 @@ public void beginReimageAll(String resourceGroupName, String vmScaleSetName, Str * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithResponseAsync( + public Mono> beginDeallocateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2416,8 +4195,8 @@ public Mono> beginDeallocateWithResponseAsync( .withContext( context -> service - .beginDeallocate( - this.client.getHost(), + .beginDeallocateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2441,11 +4220,13 @@ public Mono> beginDeallocateWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithResponseAsync( + public Mono> beginDeallocateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2465,8 +4246,8 @@ public Mono> beginDeallocateWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDeallocate( - this.client.getHost(), + .beginDeallocateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2488,8 +4269,29 @@ public Mono> beginDeallocateWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + public Mono beginDeallocateWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeallocateWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) .flatMap((Response res) -> Mono.empty()); } @@ -2505,8 +4307,26 @@ public Mono beginDeallocateAsync(String resourceGroupName, String vmScaleS * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocate(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void beginDeallocateWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute + * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginDeallocateWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** @@ -2522,11 +4342,13 @@ public void beginDeallocate(String resourceGroupName, String vmScaleSetName, Str * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2554,8 +4376,8 @@ public Mono> beginUpdateWithRespon .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2580,15 +4402,17 @@ public Mono> beginUpdateWithRespon * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2613,8 +4437,8 @@ public Mono> beginUpdateWithRespon } final String apiVersion = "2019-03-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2637,11 +4461,43 @@ public Mono> beginUpdateWithRespon * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + return beginUpdateWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -2663,9 +4519,33 @@ public Mono beginUpdateAsync( * @return describes a virtual machine scale set virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner beginUpdate( + public VirtualMachineScaleSetVMInner beginUpdateWithoutPolling( String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + } + + /** + * Updates a virtual machine of a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Describes a virtual machine scale set virtual 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 a virtual machine scale set virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetVMInner beginUpdateWithoutPolling( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + VirtualMachineScaleSetVMInner parameters, + Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) + .block(); } /** @@ -2680,11 +4560,13 @@ public VirtualMachineScaleSetVMInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2707,8 +4589,8 @@ public Mono> beginDeleteWithResponseAsync( .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2731,11 +4613,13 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2755,8 +4639,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2774,12 +4658,47 @@ public Mono> beginDeleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a virtual machine from a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeleteWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); + public void beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); } /** @@ -2788,13 +4707,15 @@ public Mono beginDeleteAsync(String resourceGroupName, String vmScaleSetNa * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void beginDeleteWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** @@ -2813,11 +4734,13 @@ public void beginDelete(String resourceGroupName, String vmScaleSetName, String * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithResponseAsync( + public Mono> beginPowerOffWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2840,8 +4763,8 @@ public Mono> beginPowerOffWithResponseAsync( .withContext( context -> service - .beginPowerOff( - this.client.getHost(), + .beginPowerOffWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2869,11 +4792,13 @@ public Mono> beginPowerOffWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithResponseAsync( + public Mono> beginPowerOffWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2893,8 +4818,8 @@ public Mono> beginPowerOffWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginPowerOff( - this.client.getHost(), + .beginPowerOffWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -2920,9 +4845,33 @@ public Mono> beginPowerOffWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffAsync( + public Mono beginPowerOffWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - return beginPowerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) + return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginPowerOffWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + return beginPowerOffWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context) .flatMap((Response res) -> Mono.empty()); } @@ -2939,10 +4888,11 @@ public Mono beginPowerOffAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Mono beginPowerOffWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { final Boolean skipShutdown = null; final Context context = null; - return beginPowerOffWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) + return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) .flatMap((Response res) -> Mono.empty()); } @@ -2961,9 +4911,30 @@ public Mono beginPowerOffAsync(String resourceGroupName, String vmScaleSet * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOff( + public void beginPowerOffWithoutPolling( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + } + + /** + * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting + * charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 beginPowerOffWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { + beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).block(); } /** @@ -2978,10 +4949,10 @@ public void beginPowerOff( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOff(String resourceGroupName, String vmScaleSetName, String instanceId) { + public void beginPowerOffWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { final Boolean skipShutdown = null; final Context context = null; - beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); + beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); } /** @@ -2996,11 +4967,13 @@ public void beginPowerOff(String resourceGroupName, String vmScaleSetName, Strin * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithResponseAsync( + public Mono> beginRestartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3023,8 +4996,8 @@ public Mono> beginRestartWithResponseAsync( .withContext( context -> service - .beginRestart( - this.client.getHost(), + .beginRestartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3047,11 +5020,13 @@ public Mono> beginRestartWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithResponseAsync( + public Mono> beginRestartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3071,8 +5046,8 @@ public Mono> beginRestartWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginRestart( - this.client.getHost(), + .beginRestartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3093,8 +5068,28 @@ public Mono> beginRestartWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRestartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + public Mono beginRestartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRestartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) .flatMap((Response res) -> Mono.empty()); } @@ -3109,8 +5104,25 @@ public Mono beginRestartAsync(String resourceGroupName, String vmScaleSetN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestart(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void beginRestartWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Restarts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginRestartWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** @@ -3125,11 +5137,13 @@ public void beginRestart(String resourceGroupName, String vmScaleSetName, String * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithResponseAsync( + public Mono> beginStartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3152,8 +5166,8 @@ public Mono> beginStartWithResponseAsync( .withContext( context -> service - .beginStart( - this.client.getHost(), + .beginStartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3176,11 +5190,13 @@ public Mono> beginStartWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithResponseAsync( + public Mono> beginStartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3200,8 +5216,8 @@ public Mono> beginStartWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginStart( - this.client.getHost(), + .beginStartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3222,8 +5238,28 @@ public Mono> beginStartWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginStartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + public Mono beginStartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginStartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) .flatMap((Response res) -> Mono.empty()); } @@ -3238,8 +5274,25 @@ public Mono beginStartAsync(String resourceGroupName, String vmScaleSetNam * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStart(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginStartAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void beginStartWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Starts a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginStartWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** @@ -3254,11 +5307,13 @@ public void beginStart(String resourceGroupName, String vmScaleSetName, String i * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithResponseAsync( + public Mono> beginRedeployWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3281,8 +5336,8 @@ public Mono> beginRedeployWithResponseAsync( .withContext( context -> service - .beginRedeploy( - this.client.getHost(), + .beginRedeployWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3305,11 +5360,13 @@ public Mono> beginRedeployWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithResponseAsync( + public Mono> beginRedeployWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3329,8 +5386,8 @@ public Mono> beginRedeployWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginRedeploy( - this.client.getHost(), + .beginRedeployWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3351,8 +5408,28 @@ public Mono> beginRedeployWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRedeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + public Mono beginRedeployWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRedeployWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) .flatMap((Response res) -> Mono.empty()); } @@ -3367,8 +5444,25 @@ public Mono beginRedeployAsync(String resourceGroupName, String vmScaleSet * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeploy(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void beginRedeployWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { + beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginRedeployWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** @@ -3383,11 +5477,13 @@ public void beginRedeploy(String resourceGroupName, String vmScaleSetName, Strin * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithResponseAsync( + public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3410,8 +5506,8 @@ public Mono> beginPerformMaintenanceWithResponseAsync( .withContext( context -> service - .beginPerformMaintenance( - this.client.getHost(), + .beginPerformMaintenanceWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3434,11 +5530,13 @@ public Mono> beginPerformMaintenanceWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithResponseAsync( + public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3458,8 +5556,8 @@ public Mono> beginPerformMaintenanceWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginPerformMaintenance( - this.client.getHost(), + .beginPerformMaintenanceWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3480,8 +5578,29 @@ public Mono> beginPerformMaintenanceWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPerformMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + public Mono beginPerformMaintenanceWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginPerformMaintenanceWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + return beginPerformMaintenanceWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, context) .flatMap((Response res) -> Mono.empty()); } @@ -3496,8 +5615,26 @@ public Mono beginPerformMaintenanceAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + public void beginPerformMaintenanceWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId) { + beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); + } + + /** + * Performs maintenance on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginPerformMaintenanceWithoutPolling( + String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { + beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); } /** @@ -3513,11 +5650,13 @@ public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetN * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithResponseAsync( + public Mono> beginRunCommandWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3545,8 +5684,8 @@ public Mono> beginRunCommandWithResponseAs .withContext( context -> service - .beginRunCommand( - this.client.getHost(), + .beginRunCommandWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3571,15 +5710,17 @@ public Mono> beginRunCommandWithResponseAs * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithResponseAsync( + public Mono> beginRunCommandWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3604,8 +5745,8 @@ public Mono> beginRunCommandWithResponseAs } final String apiVersion = "2019-03-01"; return service - .beginRunCommand( - this.client.getHost(), + .beginRunCommandWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, @@ -3628,11 +5769,43 @@ public Mono> beginRunCommandWithResponseAs * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRunCommandAsync( + public Mono beginRunCommandWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) + return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRunCommandWithoutPollingAsync( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + return beginRunCommandWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceId, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -3654,9 +5827,33 @@ public Mono beginRunCommandAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner beginRunCommand( + public RunCommandResultInner beginRunCommandWithoutPolling( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + return beginRunCommandWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); + } + + /** + * Run command on a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceId The instance ID of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner beginRunCommandWithoutPolling( + String resourceGroupName, + String vmScaleSetName, + String instanceId, + RunCommandInput parameters, + Context context) { + return beginRunCommandWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) + .block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetsClient.java similarity index 57% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetsInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetsClient.java index 8a11c018c78d..c15b567c9085 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetsInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineScaleSetsClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -26,17 +26,28 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.VMScaleSetConvertToSinglePlacementGroupInput; -import com.azure.management.compute.VirtualMachineScaleSetReimageParameters; -import com.azure.management.compute.VirtualMachineScaleSetUpdate; -import com.azure.management.compute.VirtualMachineScaleSetVMInstanceIDs; -import com.azure.management.compute.VirtualMachineScaleSetVMInstanceRequiredIDs; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.RecoveryWalkResponseInner; +import com.azure.management.compute.fluent.inner.UpgradeOperationHistoricalStatusInfoInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetInstanceViewInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetListOSUpgradeHistoryInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetListResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetListSkusResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetListWithLinkResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetSkuInner; +import com.azure.management.compute.models.VMScaleSetConvertToSinglePlacementGroupInput; +import com.azure.management.compute.models.VirtualMachineScaleSetReimageParameters; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdate; +import com.azure.management.compute.models.VirtualMachineScaleSetVMInstanceIDs; +import com.azure.management.compute.models.VirtualMachineScaleSetVMInstanceRequiredIDs; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -46,24 +57,24 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in VirtualMachineScaleSets. */ -public final class VirtualMachineScaleSetsInner +public final class VirtualMachineScaleSetsClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetsInner.class); + private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetsClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineScaleSetsService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineScaleSetsInner. + * Initializes an instance of VirtualMachineScaleSetsClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineScaleSetsInner(ComputeManagementClientImpl client) { + public VirtualMachineScaleSetsClient(ComputeManagementClient client) { this.service = RestProxy .create(VirtualMachineScaleSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); @@ -83,8 +94,8 @@ private interface VirtualMachineScaleSetsService { + "/virtualMachineScaleSets/{vmScaleSetName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -98,8 +109,8 @@ Mono>> createOrUpdate( + "/virtualMachineScaleSets/{vmScaleSetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -113,8 +124,8 @@ Mono>> update( + "/virtualMachineScaleSets/{vmScaleSetName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -127,8 +138,8 @@ Mono>> delete( + "/virtualMachineScaleSets/{vmScaleSetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -141,8 +152,8 @@ Mono> getByResourceGroup( + "/virtualMachineScaleSets/{vmScaleSetName}/deallocate") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deallocate( - @HostParam("$host") String host, + Mono>> deallocate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -156,8 +167,8 @@ Mono>> deallocate( + "/virtualMachineScaleSets/{vmScaleSetName}/delete") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteInstances( - @HostParam("$host") String host, + Mono>> deleteInstances( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -171,8 +182,8 @@ Mono>> deleteInstances( + "/virtualMachineScaleSets/{vmScaleSetName}/instanceView") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInstanceView( - @HostParam("$host") String host, + Mono> getInstanceView( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -185,8 +196,8 @@ Mono> getInstanceView( + "/virtualMachineScaleSets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -196,8 +207,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); @@ -208,8 +219,8 @@ Mono> list( + "/virtualMachineScaleSets/{vmScaleSetName}/skus") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus( - @HostParam("$host") String host, + Mono> listSkus( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -222,8 +233,8 @@ Mono> listSkus( + "/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOSUpgradeHistory( - @HostParam("$host") String host, + Mono> getOSUpgradeHistory( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -236,8 +247,8 @@ Mono> getOSUpgra + "/virtualMachineScaleSets/{vmScaleSetName}/poweroff") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> powerOff( - @HostParam("$host") String host, + Mono>> powerOff( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("skipShutdown") Boolean skipShutdown, @@ -252,8 +263,8 @@ Mono>> powerOff( + "/virtualMachineScaleSets/{vmScaleSetName}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String host, + Mono>> restart( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -267,8 +278,8 @@ Mono>> restart( + "/virtualMachineScaleSets/{vmScaleSetName}/start") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String host, + Mono>> start( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -282,8 +293,8 @@ Mono>> start( + "/virtualMachineScaleSets/{vmScaleSetName}/redeploy") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String host, + Mono>> redeploy( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -297,8 +308,8 @@ Mono>> redeploy( + "/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> performMaintenance( - @HostParam("$host") String host, + Mono>> performMaintenance( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -312,8 +323,8 @@ Mono>> performMaintenance( + "/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateInstances( - @HostParam("$host") String host, + Mono>> updateInstances( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -327,8 +338,8 @@ Mono>> updateInstances( + "/virtualMachineScaleSets/{vmScaleSetName}/reimage") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimage( - @HostParam("$host") String host, + Mono>> reimage( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -342,8 +353,8 @@ Mono>> reimage( + "/virtualMachineScaleSets/{vmScaleSetName}/reimageall") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimageAll( - @HostParam("$host") String host, + Mono>> reimageAll( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -357,8 +368,8 @@ Mono>> reimageAll( + "/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> forceRecoveryServiceFabricPlatformUpdateDomainWalk( - @HostParam("$host") String host, + Mono> forceRecoveryServiceFabricPlatformUpdateDomainWalk( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -373,9 +384,10 @@ Mono> forceRecoveryServiceFabricPlatfo @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> convertToSinglePlacementGroup( - @HostParam("$host") String host, + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") VMScaleSetConvertToSinglePlacementGroupInput parameters, Context context); @@ -386,8 +398,8 @@ Mono> convertToSinglePlacementGroup( + "/virtualMachineScaleSets/{vmScaleSetName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -401,8 +413,8 @@ Mono> beginCreateOrUpdate( + "/virtualMachineScaleSets/{vmScaleSetName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -416,8 +428,8 @@ Mono> beginUpdate( + "/virtualMachineScaleSets/{vmScaleSetName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -430,8 +442,8 @@ Mono> beginDelete( + "/virtualMachineScaleSets/{vmScaleSetName}/deallocate") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocate( - @HostParam("$host") String host, + Mono> beginDeallocateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -445,8 +457,8 @@ Mono> beginDeallocate( + "/virtualMachineScaleSets/{vmScaleSetName}/delete") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteInstances( - @HostParam("$host") String host, + Mono> beginDeleteInstancesWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -460,8 +472,8 @@ Mono> beginDeleteInstances( + "/virtualMachineScaleSets/{vmScaleSetName}/poweroff") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOff( - @HostParam("$host") String host, + Mono> beginPowerOffWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("skipShutdown") Boolean skipShutdown, @@ -476,8 +488,8 @@ Mono> beginPowerOff( + "/virtualMachineScaleSets/{vmScaleSetName}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestart( - @HostParam("$host") String host, + Mono> beginRestartWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -491,8 +503,8 @@ Mono> beginRestart( + "/virtualMachineScaleSets/{vmScaleSetName}/start") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStart( - @HostParam("$host") String host, + Mono> beginStartWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -506,8 +518,8 @@ Mono> beginStart( + "/virtualMachineScaleSets/{vmScaleSetName}/redeploy") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeploy( - @HostParam("$host") String host, + Mono> beginRedeployWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -521,8 +533,8 @@ Mono> beginRedeploy( + "/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenance( - @HostParam("$host") String host, + Mono> beginPerformMaintenanceWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -536,8 +548,8 @@ Mono> beginPerformMaintenance( + "/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateInstances( - @HostParam("$host") String host, + Mono> beginUpdateInstancesWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -551,8 +563,8 @@ Mono> beginUpdateInstances( + "/virtualMachineScaleSets/{vmScaleSetName}/reimage") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimage( - @HostParam("$host") String host, + Mono> beginReimageWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -566,8 +578,8 @@ Mono> beginReimage( + "/virtualMachineScaleSets/{vmScaleSetName}/reimageall") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageAll( - @HostParam("$host") String host, + Mono> beginReimageAllWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmScaleSetName") String vmScaleSetName, @QueryParam("api-version") String apiVersion, @@ -579,28 +591,28 @@ Mono> beginReimageAll( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( + Mono> listAllNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkusNext( + Mono> listSkusNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOSUpgradeHistoryNext( + Mono> getOSUpgradeHistoryNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -616,11 +628,13 @@ Mono> getOSUpgra * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -646,7 +660,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -662,61 +676,20 @@ public Mono>> createOrUpdateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set to create or update. * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - VirtualMachineScaleSetInner.class, - VirtualMachineScaleSetInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner createOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return createOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - if (this.client.getHost() == null) { + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -737,23 +710,19 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); } /** - * Update a VM scale set. + * Create or update a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set to create or update. @@ -764,133 +733,154 @@ public Mono>> updateWithResponseAsync( * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); + public PollerFlux, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); return this .client .getLroResultAsync( mono, this.client.getHttpPipeline(), VirtualMachineScaleSetInner.class, - VirtualMachineScaleSetInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + VirtualMachineScaleSetInner.class); } /** - * Update a VM scale set. + * Create or update a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set to create or update. * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner update( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return updateAsync(resourceGroupName, vmScaleSetName, parameters).block(); + public PollerFlux, VirtualMachineScaleSetInner> beginCreateOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class); } /** - * Deletes a VM scale set. + * Create or update a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono createOrUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Deletes a VM scale set. + * Create or update a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName); + public Mono createOrUpdateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); return this .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class) .last() .flatMap(AsyncPollResponse::getFinalResult); } /** - * Deletes a VM scale set. + * Create or update a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmScaleSetName) { - deleteAsync(resourceGroupName, vmScaleSetName).block(); + public VirtualMachineScaleSetInner createOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters).block(); } /** - * Display information about a virtual machine scale set. + * Create or update a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + public VirtualMachineScaleSetInner createOrUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -905,26 +895,33 @@ public Mono> getByResourceGroupWithR new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String apiVersion = "2019-03-01"; return FluxUtil .withContext( context -> service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), + parameters, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Display information about a virtual machine scale set. + * Update a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -932,11 +929,13 @@ public Mono> getByResourceGroupWithR * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + public Mono>> updateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -951,74 +950,179 @@ public Mono> getByResourceGroupWithR new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String apiVersion = "2019-03-01"; return service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), + parameters, context); } /** - * Display information about a virtual machine scale set. + * Update a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class); } /** - * Display information about a virtual machine scale set. + * Update a VM scale set. * * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner getByResourceGroup(String resourceGroupName, String vmScaleSetName) { - return getByResourceGroupAsync(resourceGroupName, vmScaleSetName).block(); + public PollerFlux, VirtualMachineScaleSetInner> beginUpdate( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class); } /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineScaleSetInner.class, + VirtualMachineScaleSetInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner update( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { + return updateAsync(resourceGroupName, vmScaleSetName, parameters).block(); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner update( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + return updateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); + } + + /** + * Deletes a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deallocateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1034,135 +1138,111 @@ public Mono>> deallocateWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return FluxUtil .withContext( context -> service - .deallocate( - this.client.getHost(), + .delete( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), - vmInstanceIDs, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * Deletes a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * Deletes a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) { - deallocateAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public PollerFlux, Void> beginDelete(String resourceGroupName, String vmScaleSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Deletes virtual machines in a VM scale set. + * Deletes a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteInstancesWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return FluxUtil - .withContext( - context -> - service - .deleteInstances( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public PollerFlux, Void> beginDelete( + String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Deletes virtual machines in a VM scale set. + * Deletes a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + public Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -1171,36 +1251,73 @@ public Mono deleteInstancesAsync(String resourceGroupName, String vmScaleS } /** - * Deletes virtual machines in a VM scale set. + * Deletes a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - deleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmScaleSetName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets the status of a VM scale set instance. + * Deletes a VM scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceViewWithResponseAsync( + public void delete(String resourceGroupName, String vmScaleSetName) { + deleteAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, Context context) { + deleteAsync(resourceGroupName, vmScaleSetName, context).block(); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1220,8 +1337,8 @@ public Mono> getInstance .withContext( context -> service - .getInstanceView( - this.client.getHost(), + .getByResourceGroup( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -1231,7 +1348,7 @@ public Mono> getInstance } /** - * Gets the status of a VM scale set instance. + * Display information about a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. @@ -1239,14 +1356,16 @@ public Mono> getInstance * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. + * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getInstanceViewWithResponseAsync( + public Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1263,8 +1382,8 @@ public Mono> getInstance } final String apiVersion = "2019-03-01"; return service - .getInstanceView( - this.client.getHost(), + .getByResourceGroup( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -1273,21 +1392,20 @@ public Mono> getInstance } /** - * Gets the status of a VM scale set instance. + * Display information about a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. + * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getInstanceViewAsync( - String resourceGroupName, String vmScaleSetName) { - return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName) + public Mono getByResourceGroupAsync(String resourceGroupName, String vmScaleSetName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -1297,40 +1415,91 @@ public Mono getInstanceViewAsync( } /** - * Gets the status of a VM scale set instance. + * Display information about a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a VM scale set instance. + * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName) { - return getInstanceViewAsync(resourceGroupName, vmScaleSetName).block(); + public Mono getByResourceGroupAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmScaleSetName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Gets a list of all VM scale sets under a resource group. + * Display information about a virtual machine scale set. * * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. + * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getHost() == null) { + public VirtualMachineScaleSetInner getByResourceGroup(String resourceGroupName, String vmScaleSetName) { + return getByResourceGroupAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner getByResourceGroup( + String resourceGroupName, String vmScaleSetName, Context context) { + return getByResourceGroupAsync(resourceGroupName, vmScaleSetName, context).block(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( @@ -1338,49 +1507,57 @@ public Mono> listByResourceGroupSingl "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return FluxUtil .withContext( context -> service - .listByResourceGroup( - this.client.getHost(), + .deallocate( + this.client.getEndpoint(), resourceGroupName, + vmScaleSetName, apiVersion, this.client.getSubscriptionId(), + vmInstanceIDs, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets a list of all VM scale sets under a resource group. + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + public Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( @@ -1388,80 +1565,177 @@ public Mono> listByResourceGroupSingl "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .listByResourceGroup( - this.client.getHost(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); } /** - * Gets a list of all VM scale sets under a resource group. + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets a list of all VM scale sets under a resource group. + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeallocate( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets a list of all VM scale sets under a resource group. + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM scale sets under a resource group. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + public Mono deallocateAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + deallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) { + deallocateAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deallocate(String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + deallocateAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1469,121 +1743,1795 @@ public Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (instanceIds == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); + } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); + vmInstanceIDs.withInstanceIds(instanceIds); return FluxUtil .withContext( - context -> service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> + service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteInstancesWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); + } + final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); + vmInstanceIDs.withInstanceIds(instanceIds); + return service + .deleteInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteInstances( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteInstances( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteInstancesAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + deleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { + deleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteInstances( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + deleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return service + .getInstanceView( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getInstanceViewAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, vmScaleSetName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName) { + return getInstanceViewAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Gets the status of a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInstanceViewInner getInstanceView( + String resourceGroupName, String vmScaleSetName, Context context) { + return getInstanceViewAsync(resourceGroupName, vmScaleSetName, context).block(); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2019-03-01"; + return service + .listByResourceGroup( + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of all VM scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM scale sets under a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-03-01"; + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink + * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM + * Scale Sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSkusSinglePageAsync( + String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSkusSinglePageAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return service + .listSkus( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSkusAsync(String resourceGroupName, String vmScaleSetName) { + return new PagedFlux<>( + () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName), + nextLink -> listSkusNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSkusAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedFlux<>( + () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName, context), + nextLink -> listSkusNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus(String resourceGroupName, String vmScaleSetName) { + return new PagedIterable<>(listSkusAsync(resourceGroupName, vmScaleSetName)); + } + + /** + * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for + * each SKU. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed + * for each SKU. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedIterable<>(listSkusAsync(resourceGroupName, vmScaleSetName, context)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOSUpgradeHistorySinglePageAsync( + String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .getOSUpgradeHistory( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOSUpgradeHistorySinglePageAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + return service + .getOSUpgradeHistory( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getOSUpgradeHistoryAsync( + String resourceGroupName, String vmScaleSetName) { + return new PagedFlux<>( + () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName), + nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getOSUpgradeHistoryAsync( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedFlux<>( + () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName, context), + nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName) { + return new PagedIterable<>(getOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName)); + } + + /** + * Gets list of OS upgrades on a VM scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 OS upgrades on a VM scale set instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getOSUpgradeHistory( + String resourceGroupName, String vmScaleSetName, Context context) { + return new PagedIterable<>(getOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName, context)); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> powerOffWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + List instanceIds, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPowerOff( + String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPowerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + List instanceIds, + Context context) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync( + String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + List instanceIds, + Context context) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 powerOff( + String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { + powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).block(); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 powerOff( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + List instanceIds, + Context context) { + powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context).block(); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestart( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, List instanceIds) { + restartAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, List instanceIds, Context context) { + restartAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + return service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStart( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Starts one or more virtual machines in a VM scale set. * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() 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 apiVersion = "2019-03-01"; - return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + public PollerFlux, Void> beginStart( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. + * Starts one or more virtual machines in a VM scale set. * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. + * Starts one or more virtual machines in a VM scale set. * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink - * property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM - * Scale Sets. + * Starts one or more virtual machines in a VM scale set. * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all VM Scale Sets in the subscription, regardless of the associated resource group. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmScaleSetName, List instanceIds) { + startAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); } /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 vmScaleSetName, List instanceIds, Context context) { + startAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSkusSinglePageAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + public Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1599,48 +3547,49 @@ public Mono> listSkusSinglePageAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return FluxUtil .withContext( context -> service - .listSkus( - this.client.getHost(), + .redeploy( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), + vmInstanceIDs, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSkusSinglePageAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + public Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1656,98 +3605,173 @@ public Mono> listSkusSinglePageAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .listSkus( - this.client.getHost(), + .redeploy( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + vmInstanceIDs, + context); } /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSkusAsync(String resourceGroupName, String vmScaleSetName) { - return new PagedFlux<>( - () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName), - nextLink -> listSkusNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRedeploy( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono redeployAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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.COLLECTION) - public PagedFlux listSkusAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedFlux<>( - () -> listSkusSinglePageAsync(resourceGroupName, vmScaleSetName, context), - nextLink -> listSkusNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmScaleSetName, List instanceIds) { + redeployAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); } /** - * Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for - * each SKU. + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed - * for each SKU. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkus(String resourceGroupName, String vmScaleSetName) { - return new PagedIterable<>(listSkusAsync(resourceGroupName, vmScaleSetName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + redeployAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** - * Gets list of OS upgrades on a VM scale set instance. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 OS upgrades on a VM scale set instance. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOSUpgradeHistorySinglePageAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + public Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1763,46 +3787,50 @@ public Mono> getOSUpgra "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return FluxUtil .withContext( context -> service - .getOSUpgradeHistory( - this.client.getHost(), + .performMaintenance( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), + vmInstanceIDs, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Gets list of OS upgrades on a VM scale set instance. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 OS upgrades on a VM scale set instance. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOSUpgradeHistorySinglePageAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + public Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1818,204 +3846,233 @@ public Mono> getOSUpgra "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .getOSUpgradeHistory( - this.client.getHost(), + .performMaintenance( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + vmInstanceIDs, + context); } /** - * Gets list of OS upgrades on a VM scale set instance. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 OS upgrades on a VM scale set instance. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getOSUpgradeHistoryAsync( - String resourceGroupName, String vmScaleSetName) { - return new PagedFlux<>( - () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName), - nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets list of OS upgrades on a VM scale set instance. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 OS upgrades on a VM scale set instance. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getOSUpgradeHistoryAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return new PagedFlux<>( - () -> getOSUpgradeHistorySinglePageAsync(resourceGroupName, vmScaleSetName, context), - nextLink -> getOSUpgradeHistoryNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPerformMaintenance( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Gets list of OS upgrades on a VM scale set instance. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 OS upgrades on a VM scale set instance. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getOSUpgradeHistory( - String resourceGroupName, String vmScaleSetName) { - return new PagedIterable<>(getOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono performMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .powerOff( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono performMaintenanceAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public void performMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { + performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); } /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 powerOff( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - powerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).block(); + public void performMaintenance( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateInstancesWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); + } + final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); + vmInstanceIDs.withInstanceIds(instanceIds); + return FluxUtil + .withContext( + context -> + service + .updateInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Restarts one or more virtual machines in a VM scale set. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restartWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + public Mono>> updateInstancesWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2030,137 +4087,101 @@ public Mono>> restartWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); + if (instanceIds == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); + vmInstanceIDs.withInstanceIds(instanceIds); + return service + .updateInstances( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); } /** - * Restarts one or more virtual machines in a VM scale set. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param instanceIds The virtual machine scale set instance ids. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - restartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public PollerFlux, Void> beginUpdateInstances( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Restarts one or more virtual machines in a VM scale set. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmScaleSetName, List instanceIds) { - restartAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public PollerFlux, Void> beginUpdateInstances( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Starts one or more virtual machines in a VM scale set. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param instanceIds The virtual machine scale set instance ids. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Starts one or more virtual machines in a VM scale set. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - startWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + public Mono updateInstancesAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -2169,40 +4190,60 @@ public Mono startAsync(String resourceGroupName, String vmScaleSetName, Li } /** - * Starts one or more virtual machines in a VM scale set. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param instanceIds The virtual machine scale set instance ids. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 vmScaleSetName, List instanceIds) { - startAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void updateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { + updateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); } /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateInstances( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + updateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> redeployWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + public Mono>> reimageWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2217,144 +4258,176 @@ public Mono>> redeployWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); + if (vmScaleSetReimageInput != null) { + vmScaleSetReimageInput.validate(); } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + final String apiVersion = "2019-03-01"; return FluxUtil .withContext( context -> service - .redeploy( - this.client.getHost(), + .reimage( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), - vmInstanceIDs, + vmScaleSetReimageInput, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - redeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public Mono>> reimageWithResponseAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmScaleSetReimageInput != null) { + vmScaleSetReimageInput.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmScaleSetReimageInput, + context); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmScaleSetName, List instanceIds) { - redeployAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public PollerFlux, Void> beginReimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .performMaintenance( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono reimageAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono performMaintenanceAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - performMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + public Mono reimageAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -2363,133 +4436,111 @@ public Mono performMaintenanceAsync( } /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { - performMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public Mono reimageAsync(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; + final Context context = null; + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateInstancesWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return FluxUtil - .withContext( - context -> - service - .updateInstances( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public void reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { + reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - updateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public void reimage( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).block(); } /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 updateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - updateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void reimage(String resourceGroupName, String vmScaleSetName) { + final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; + final Context context = null; + reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - if (this.client.getHost() == null) { + public Mono>> reimageAllWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2504,113 +4555,147 @@ public Mono>> reimageWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (vmScaleSetReimageInput != null) { - vmScaleSetReimageInput.validate(); - } final String apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return FluxUtil .withContext( context -> service - .reimage( - this.client.getHost(), + .reimageAll( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, this.client.getSubscriptionId(), - vmScaleSetReimageInput, + vmInstanceIDs, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public Mono>> reimageAllWithResponseAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmScaleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; + if (instanceIds != null) { + vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); + vmInstanceIDsInternal.withInstanceIds(instanceIds); + } + VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + return service + .reimageAll( + this.client.getEndpoint(), + resourceGroupName, + vmScaleSetName, + apiVersion, + this.client.getSubscriptionId(), + vmInstanceIDs, + context); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - final Context context = null; - Mono>> mono = - reimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public PollerFlux, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); + public PollerFlux, Void> beginReimageAll( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void reimage(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - final Context context = null; - reimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); + public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -2621,51 +4706,22 @@ public void reimage(String resourceGroupName, String vmScaleSetName) { * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageAllWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 apiVersion = "2019-03-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .reimageAll( - this.client.getHost(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono reimageAllAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + Mono>> mono = + reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -2679,17 +4735,10 @@ public Mono>> reimageAllWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - Mono>> mono = - reimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public void reimageAll(String resourceGroupName, String vmScaleSetName, List instanceIds) { + reimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); } /** @@ -2700,13 +4749,14 @@ public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetNam * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 reimageAll(String resourceGroupName, String vmScaleSetName, List instanceIds) { - reimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void reimageAll(String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + reimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -2721,12 +4771,14 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, List> + public Mono> forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2747,7 +4799,7 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, List service .forceRecoveryServiceFabricPlatformUpdateDomainWalk( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -2770,12 +4822,14 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, List> + public Mono> forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2793,7 +4847,7 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, List forceRecoveryServiceFabricPlatformUpdateD return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( resourceGroupName, vmScaleSetName, platformUpdateDomain) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponseAsync( + resourceGroupName, vmScaleSetName, platformUpdateDomain, context) + .flatMap( + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -2847,6 +4928,26 @@ public RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainW .block(); } + /** + * Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after calling a manual recovery walk. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainWalk( + String resourceGroupName, String vmScaleSetName, int platformUpdateDomain, Context context) { + return forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync( + resourceGroupName, vmScaleSetName, platformUpdateDomain, context) + .block(); + } + /** * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. * @@ -2863,9 +4964,11 @@ public RecoveryWalkResponseInner forceRecoveryServiceFabricPlatformUpdateDomainW @ServiceMethod(returns = ReturnType.SINGLE) public Mono> convertToSinglePlacementGroupWithResponseAsync( String resourceGroupName, String vmScaleSetName, String activePlacementGroupId) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2880,6 +4983,7 @@ public Mono> convertToSinglePlacementGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2019-03-01"; VMScaleSetConvertToSinglePlacementGroupInput parameters = new VMScaleSetConvertToSinglePlacementGroupInput(); parameters.withActivePlacementGroupId(activePlacementGroupId); return FluxUtil @@ -2887,9 +4991,10 @@ public Mono> convertToSinglePlacementGroupWithResponseAsync( context -> service .convertToSinglePlacementGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, + apiVersion, this.client.getSubscriptionId(), parameters, context)) @@ -2913,9 +5018,11 @@ public Mono> convertToSinglePlacementGroupWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> convertToSinglePlacementGroupWithResponseAsync( String resourceGroupName, String vmScaleSetName, String activePlacementGroupId, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2930,13 +5037,15 @@ public Mono> convertToSinglePlacementGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2019-03-01"; VMScaleSetConvertToSinglePlacementGroupInput parameters = new VMScaleSetConvertToSinglePlacementGroupInput(); parameters.withActivePlacementGroupId(activePlacementGroupId); return service .convertToSinglePlacementGroup( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, + apiVersion, this.client.getSubscriptionId(), parameters, context); @@ -2962,6 +5071,28 @@ public Mono convertToSinglePlacementGroupAsync( .flatMap((Response res) -> Mono.empty()); } + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param activePlacementGroupId Id of the placement group in which you want future virtual machine instances to be + * placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the + * platform will choose one with maximum number of virtual machine instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono convertToSinglePlacementGroupAsync( + String resourceGroupName, String vmScaleSetName, String activePlacementGroupId, Context context) { + return convertToSinglePlacementGroupWithResponseAsync( + resourceGroupName, vmScaleSetName, activePlacementGroupId, context) + .flatMap((Response res) -> Mono.empty()); + } + /** * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. * @@ -2980,6 +5111,25 @@ public void convertToSinglePlacementGroup( convertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId).block(); } + /** + * Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set to create or update. + * @param activePlacementGroupId Id of the placement group in which you want future virtual machine instances to be + * placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the + * platform will choose one with maximum number of virtual machine instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 convertToSinglePlacementGroup( + String resourceGroupName, String vmScaleSetName, String activePlacementGroupId, Context context) { + convertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, activePlacementGroupId, context).block(); + } + /** * Create or update a VM scale set. * @@ -2992,11 +5142,13 @@ public void convertToSinglePlacementGroup( * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3021,8 +5173,8 @@ public Mono> beginCreateOrUpdateWith .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3045,11 +5197,13 @@ public Mono> beginCreateOrUpdateWith * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3071,8 +5225,8 @@ public Mono> beginCreateOrUpdateWith } final String apiVersion = "2019-03-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3093,17 +5247,61 @@ public Mono> beginCreateOrUpdateWith * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, parameters, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters).block(); } /** @@ -3112,15 +5310,16 @@ public Mono beginCreateOrUpdateAsync( * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set to create or update. * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginCreateOrUpdate( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters).block(); + public VirtualMachineScaleSetInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); } /** @@ -3135,11 +5334,13 @@ public VirtualMachineScaleSetInner beginCreateOrUpdate( * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3164,8 +5365,8 @@ public Mono> beginUpdateWithResponse .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3188,11 +5389,13 @@ public Mono> beginUpdateWithResponse * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3214,8 +5417,8 @@ public Mono> beginUpdateWithResponse } final String apiVersion = "2019-03-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3236,11 +5439,37 @@ public Mono> beginUpdateWithResponse * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -3261,9 +5490,27 @@ public Mono beginUpdateAsync( * @return describes a Virtual Machine Scale Set. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginUpdate( + public VirtualMachineScaleSetInner beginUpdateWithoutPolling( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters).block(); + return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters).block(); + } + + /** + * Update a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set to create or update. + * @param parameters Describes a Virtual Machine Scale Set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Virtual Machine Scale Set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineScaleSetInner beginUpdateWithoutPolling( + String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); } /** @@ -3277,10 +5524,13 @@ public VirtualMachineScaleSetInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String vmScaleSetName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync( + String resourceGroupName, String vmScaleSetName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3300,8 +5550,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3322,11 +5572,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync( + public Mono> beginDeleteWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3343,8 +5595,8 @@ public Mono> beginDeleteWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3363,8 +5615,25 @@ public Mono> beginDeleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeleteWithResponseAsync(resourceGroupName, vmScaleSetName) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmScaleSetName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) .flatMap((Response res) -> Mono.empty()); } @@ -3378,8 +5647,23 @@ public Mono beginDeleteAsync(String resourceGroupName, String vmScaleSetNa * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String vmScaleSetName) { - beginDeleteAsync(resourceGroupName, vmScaleSetName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); + } + + /** + * Deletes a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); } /** @@ -3396,11 +5680,13 @@ public void beginDelete(String resourceGroupName, String vmScaleSetName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithResponseAsync( + public Mono> beginDeallocateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3426,8 +5712,8 @@ public Mono> beginDeallocateWithResponseAsync( .withContext( context -> service - .beginDeallocate( - this.client.getHost(), + .beginDeallocateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3452,11 +5738,13 @@ public Mono> beginDeallocateWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithResponseAsync( + public Mono> beginDeallocateWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3479,8 +5767,8 @@ public Mono> beginDeallocateWithResponseAsync( } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .beginDeallocate( - this.client.getHost(), + .beginDeallocateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3503,8 +5791,30 @@ public Mono> beginDeallocateWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeallocateWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + public Mono beginDeallocateWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeallocateWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -3521,8 +5831,28 @@ public Mono beginDeallocateAsync(String resourceGroupName, String vmScaleS * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginDeallocateWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute + * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginDeallocateWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -3537,11 +5867,13 @@ public void beginDeallocate(String resourceGroupName, String vmScaleSetName, Lis * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteInstancesWithResponseAsync( + public Mono> beginDeleteInstancesWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3566,8 +5898,8 @@ public Mono> beginDeleteInstancesWithResponseAsync( .withContext( context -> service - .beginDeleteInstances( - this.client.getHost(), + .beginDeleteInstancesWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3590,11 +5922,13 @@ public Mono> beginDeleteInstancesWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteInstancesWithResponseAsync( + public Mono> beginDeleteInstancesWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3616,8 +5950,8 @@ public Mono> beginDeleteInstancesWithResponseAsync( VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); return service - .beginDeleteInstances( - this.client.getHost(), + .beginDeleteInstancesWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3638,9 +5972,29 @@ public Mono> beginDeleteInstancesWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteInstancesAsync( + public Mono beginDeleteInstancesWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeleteInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + return beginDeleteInstancesWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteInstancesWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginDeleteInstancesWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -3655,8 +6009,26 @@ public Mono beginDeleteInstancesAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginDeleteInstancesWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginDeleteInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Deletes virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginDeleteInstancesWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginDeleteInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -3676,11 +6048,13 @@ public void beginDeleteInstances(String resourceGroupName, String vmScaleSetName * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithResponseAsync( + public Mono> beginPowerOffWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3706,8 +6080,8 @@ public Mono> beginPowerOffWithResponseAsync( .withContext( context -> service - .beginPowerOff( - this.client.getHost(), + .beginPowerOffWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, skipShutdown, @@ -3736,15 +6110,17 @@ public Mono> beginPowerOffWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithResponseAsync( + public Mono> beginPowerOffWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3767,8 +6143,8 @@ public Mono> beginPowerOffWithResponseAsync( } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .beginPowerOff( - this.client.getHost(), + .beginPowerOffWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, skipShutdown, @@ -3795,9 +6171,39 @@ public Mono> beginPowerOffWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffAsync( + public Mono beginPowerOffWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - return beginPowerOffWithResponseAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds) + return beginPowerOffWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, skipShutdown, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginPowerOffWithoutPollingAsync( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + List instanceIds, + Context context) { + return beginPowerOffWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -3817,9 +6223,35 @@ public Mono beginPowerOffAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOff( + public void beginPowerOffWithoutPolling( String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).block(); + beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).block(); + } + + /** + * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you + * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * specified. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginPowerOffWithoutPolling( + String resourceGroupName, + String vmScaleSetName, + Boolean skipShutdown, + List instanceIds, + Context context) { + beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context).block(); } /** @@ -3835,11 +6267,13 @@ public void beginPowerOff( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithResponseAsync( + public Mono> beginRestartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3865,8 +6299,8 @@ public Mono> beginRestartWithResponseAsync( .withContext( context -> service - .beginRestart( - this.client.getHost(), + .beginRestartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3890,11 +6324,13 @@ public Mono> beginRestartWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithResponseAsync( + public Mono> beginRestartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3917,8 +6353,8 @@ public Mono> beginRestartWithResponseAsync( } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .beginRestart( - this.client.getHost(), + .beginRestartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -3937,12 +6373,49 @@ public Mono> beginRestartWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRestartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRestartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Restarts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 Mono beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRestartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); + public void beginRestartWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); } /** @@ -3952,13 +6425,15 @@ public Mono beginRestartAsync(String resourceGroupName, String vmScaleSetN * @param vmScaleSetName The name of the VM scale set. * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 beginRestart(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginRestartWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -3974,11 +6449,13 @@ public void beginRestart(String resourceGroupName, String vmScaleSetName, List> beginStartWithResponseAsync( + public Mono> beginStartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4004,8 +6481,8 @@ public Mono> beginStartWithResponseAsync( .withContext( context -> service - .beginStart( - this.client.getHost(), + .beginStartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4029,11 +6506,13 @@ public Mono> beginStartWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithResponseAsync( + public Mono> beginStartWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4056,8 +6535,8 @@ public Mono> beginStartWithResponseAsync( } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .beginStart( - this.client.getHost(), + .beginStartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4079,8 +6558,29 @@ public Mono> beginStartWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginStartWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + public Mono beginStartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginStartWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -4096,8 +6596,26 @@ public Mono beginStartAsync(String resourceGroupName, String vmScaleSetNam * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStart(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginStartAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginStartWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Starts one or more virtual machines in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginStartWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -4114,11 +6632,13 @@ public void beginStart(String resourceGroupName, String vmScaleSetName, List> beginRedeployWithResponseAsync( + public Mono> beginRedeployWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4144,8 +6664,8 @@ public Mono> beginRedeployWithResponseAsync( .withContext( context -> service - .beginRedeploy( - this.client.getHost(), + .beginRedeployWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4170,11 +6690,13 @@ public Mono> beginRedeployWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithResponseAsync( + public Mono> beginRedeployWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4197,8 +6719,8 @@ public Mono> beginRedeployWithResponseAsync( } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .beginRedeploy( - this.client.getHost(), + .beginRedeployWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4221,8 +6743,30 @@ public Mono> beginRedeployWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRedeployWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + public Mono beginRedeployWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRedeployWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -4239,8 +6783,27 @@ public Mono beginRedeployAsync(String resourceGroupName, String vmScaleSet * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeploy(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginRedeployWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them + * back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginRedeployWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -4258,11 +6821,13 @@ public void beginRedeploy(String resourceGroupName, String vmScaleSetName, List< * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithResponseAsync( + public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4288,8 +6853,8 @@ public Mono> beginPerformMaintenanceWithResponseAsync( .withContext( context -> service - .beginPerformMaintenance( - this.client.getHost(), + .beginPerformMaintenanceWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4315,11 +6880,13 @@ public Mono> beginPerformMaintenanceWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithResponseAsync( + public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4342,8 +6909,8 @@ public Mono> beginPerformMaintenanceWithResponseAsync( } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .beginPerformMaintenance( - this.client.getHost(), + .beginPerformMaintenanceWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4367,9 +6934,32 @@ public Mono> beginPerformMaintenanceWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceAsync( + public Mono beginPerformMaintenanceWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginPerformMaintenanceWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginPerformMaintenanceWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginPerformMaintenanceWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -4387,8 +6977,29 @@ public Mono beginPerformMaintenanceAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginPerformMaintenanceWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not + * eligible for perform maintenance will be failed. Please refer to best practices for more details: + * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginPerformMaintenanceWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -4403,11 +7014,13 @@ public void beginPerformMaintenance(String resourceGroupName, String vmScaleSetN * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateInstancesWithResponseAsync( + public Mono> beginUpdateInstancesWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4432,8 +7045,8 @@ public Mono> beginUpdateInstancesWithResponseAsync( .withContext( context -> service - .beginUpdateInstances( - this.client.getHost(), + .beginUpdateInstancesWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4456,11 +7069,13 @@ public Mono> beginUpdateInstancesWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateInstancesWithResponseAsync( + public Mono> beginUpdateInstancesWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4482,8 +7097,8 @@ public Mono> beginUpdateInstancesWithResponseAsync( VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); return service - .beginUpdateInstances( - this.client.getHost(), + .beginUpdateInstancesWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4504,9 +7119,29 @@ public Mono> beginUpdateInstancesWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateInstancesAsync( + public Mono beginUpdateInstancesWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginUpdateInstancesWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + return beginUpdateInstancesWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateInstancesWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginUpdateInstancesWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -4521,8 +7156,26 @@ public Mono beginUpdateInstancesAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginUpdateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginUpdateInstancesWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginUpdateInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginUpdateInstancesWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginUpdateInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** @@ -4539,13 +7192,15 @@ public void beginUpdateInstances(String resourceGroupName, String vmScaleSetName * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithResponseAsync( + public Mono> beginReimageWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4568,8 +7223,8 @@ public Mono> beginReimageWithResponseAsync( .withContext( context -> service - .beginReimage( - this.client.getHost(), + .beginReimageWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4594,14 +7249,16 @@ public Mono> beginReimageWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithResponseAsync( + public Mono> beginReimageWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4621,8 +7278,8 @@ public Mono> beginReimageWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginReimage( - this.client.getHost(), + .beginReimageWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4645,11 +7302,36 @@ public Mono> beginReimageWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAsync( + public Mono beginReimageWithoutPollingAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - return beginReimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) + return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginReimageWithoutPollingAsync( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + return beginReimageWithoutPollingWithResponseAsync( + resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context) .flatMap((Response res) -> Mono.empty()); } @@ -4666,10 +7348,10 @@ public Mono beginReimageAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAsync(String resourceGroupName, String vmScaleSetName) { + public Mono beginReimageWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; final Context context = null; - return beginReimageWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) + return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) .flatMap((Response res) -> Mono.empty()); } @@ -4686,11 +7368,33 @@ public Mono beginReimageAsync(String resourceGroupName, String vmScaleSetN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimage( + public void beginReimageWithoutPolling( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); + beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); + } + + /** + * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a + * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial + * state. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginReimageWithoutPolling( + String resourceGroupName, + String vmScaleSetName, + VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, + Context context) { + beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).block(); } /** @@ -4705,10 +7409,10 @@ public void beginReimage( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimage(String resourceGroupName, String vmScaleSetName) { + public void beginReimageWithoutPolling(String resourceGroupName, String vmScaleSetName) { final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; final Context context = null; - beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); + beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); } /** @@ -4725,11 +7429,13 @@ public void beginReimage(String resourceGroupName, String vmScaleSetName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithResponseAsync( + public Mono> beginReimageAllWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4755,8 +7461,8 @@ public Mono> beginReimageAllWithResponseAsync( .withContext( context -> service - .beginReimageAll( - this.client.getHost(), + .beginReimageAllWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4781,11 +7487,13 @@ public Mono> beginReimageAllWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithResponseAsync( + public Mono> beginReimageAllWithoutPollingWithResponseAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4808,8 +7516,8 @@ public Mono> beginReimageAllWithResponseAsync( } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; return service - .beginReimageAll( - this.client.getHost(), + .beginReimageAllWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmScaleSetName, apiVersion, @@ -4832,8 +7540,30 @@ public Mono> beginReimageAllWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginReimageAllWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + public Mono beginReimageAllWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginReimageAllWithoutPollingAsync( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .flatMap((Response res) -> Mono.empty()); } @@ -4850,8 +7580,28 @@ public Mono beginReimageAllAsync(String resourceGroupName, String vmScaleS * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageAll(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + public void beginReimageAllWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds) { + beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); + } + + /** + * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only + * supported for managed disks. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the VM scale set. + * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance + * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginReimageAllWithoutPolling( + String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { + beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineSizesClient.java similarity index 78% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineSizesClient.java index 4e9413df7a35..bdd806a315f9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachineSizesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -19,30 +19,33 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeInner; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeListResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in VirtualMachineSizes. */ -public final class VirtualMachineSizesInner { - private final ClientLogger logger = new ClientLogger(VirtualMachineSizesInner.class); +public final class VirtualMachineSizesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachineSizesClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachineSizesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachineSizesInner. + * Initializes an instance of VirtualMachineSizesClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachineSizesInner(ComputeManagementClientImpl client) { + public VirtualMachineSizesClient(ComputeManagementClient client) { this.service = RestProxy.create(VirtualMachineSizesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -59,8 +62,8 @@ private interface VirtualMachineSizesService { @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -79,9 +82,11 @@ Mono> list( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String location) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -96,7 +101,9 @@ public Mono> listSinglePageAsync(String l return FluxUtil .withContext( context -> - service.list(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context)) + service + .list( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -117,9 +124,11 @@ public Mono> listSinglePageAsync(String l */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -132,7 +141,7 @@ public Mono> listSinglePageAsync(String l } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context) + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -184,4 +193,20 @@ public PagedFlux listAsync(String location, Context con public PagedIterable list(String location) { return new PagedIterable<>(listAsync(location)); } + + /** + * This API is deprecated. Use [Resources + * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list). + * + * @param location The location upon which virtual-machine-sizes is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinesInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachinesClient.java similarity index 55% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinesInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachinesClient.java index 3ced8221706b..6a3b74704e3f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinesInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/VirtualMachinesClient.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; @@ -26,16 +26,26 @@ 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.http.rest.SimpleResponse; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.InstanceViewTypes; -import com.azure.management.compute.RunCommandInput; -import com.azure.management.compute.VirtualMachineCaptureParameters; -import com.azure.management.compute.VirtualMachineReimageParameters; +import com.azure.core.util.polling.PollerFlux; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.RunCommandResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineCaptureResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; +import com.azure.management.compute.fluent.inner.VirtualMachineInstanceViewInner; +import com.azure.management.compute.fluent.inner.VirtualMachineListResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeInner; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeListResultInner; +import com.azure.management.compute.fluent.inner.VirtualMachineUpdateInner; +import com.azure.management.compute.models.InstanceViewTypes; +import com.azure.management.compute.models.RunCommandInput; +import com.azure.management.compute.models.VirtualMachineCaptureParameters; +import com.azure.management.compute.models.VirtualMachineReimageParameters; import com.azure.management.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.management.resources.fluentcore.collection.InnerSupportsGet; import com.azure.management.resources.fluentcore.collection.InnerSupportsListing; @@ -44,24 +54,24 @@ import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in VirtualMachines. */ -public final class VirtualMachinesInner +public final class VirtualMachinesClient implements InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - private final ClientLogger logger = new ClientLogger(VirtualMachinesInner.class); + private final ClientLogger logger = new ClientLogger(VirtualMachinesClient.class); /** The proxy service used to perform REST calls. */ private final VirtualMachinesService service; /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; /** - * Initializes an instance of VirtualMachinesInner. + * Initializes an instance of VirtualMachinesClient. * * @param client the instance of the service client containing this operation class. */ - VirtualMachinesInner(ComputeManagementClientImpl client) { + public VirtualMachinesClient(ComputeManagementClient client) { this.service = RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; @@ -78,8 +88,8 @@ private interface VirtualMachinesService { @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocation( - @HostParam("$host") String host, + Mono> listByLocation( + @HostParam("$host") String endpoint, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -91,8 +101,8 @@ Mono> listByLocation( + "/virtualMachines/{vmName}/capture") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> capture( - @HostParam("$host") String host, + Mono>> capture( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -106,8 +116,8 @@ Mono>> capture( + "/virtualMachines/{vmName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String host, + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -121,8 +131,8 @@ Mono>> createOrUpdate( + "/virtualMachines/{vmName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String host, + Mono>> update( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -136,8 +146,8 @@ Mono>> update( + "/virtualMachines/{vmName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String host, + Mono>> delete( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -150,8 +160,8 @@ Mono>> delete( + "/virtualMachines/{vmName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String host, + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("$expand") InstanceViewTypes expand, @@ -165,8 +175,8 @@ Mono> getByResourceGroup( + "/virtualMachines/{vmName}/instanceView") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> instanceView( - @HostParam("$host") String host, + Mono> instanceView( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -179,8 +189,8 @@ Mono> instanceView( + "/virtualMachines/{vmName}/convertToManagedDisks") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> convertToManagedDisks( - @HostParam("$host") String host, + Mono>> convertToManagedDisks( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -193,8 +203,8 @@ Mono>> convertToManagedDisks( + "/virtualMachines/{vmName}/deallocate") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deallocate( - @HostParam("$host") String host, + Mono>> deallocate( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -208,7 +218,7 @@ Mono>> deallocate( @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> generalize( - @HostParam("$host") String host, + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -221,8 +231,8 @@ Mono> generalize( + "/virtualMachines") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String host, + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -232,8 +242,8 @@ Mono> listByResourceGroup( @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String host, + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); @@ -244,8 +254,8 @@ Mono> list( + "/virtualMachines/{vmName}/vmSizes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailableSizes( - @HostParam("$host") String host, + Mono> listAvailableSizes( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -258,8 +268,8 @@ Mono> listAvailableSizes( + "/virtualMachines/{vmName}/powerOff") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> powerOff( - @HostParam("$host") String host, + Mono>> powerOff( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("skipShutdown") Boolean skipShutdown, @@ -273,8 +283,8 @@ Mono>> powerOff( + "/virtualMachines/{vmName}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String host, + Mono>> restart( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -287,8 +297,8 @@ Mono>> restart( + "/virtualMachines/{vmName}/start") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String host, + Mono>> start( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -301,8 +311,8 @@ Mono>> start( + "/virtualMachines/{vmName}/redeploy") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> redeploy( - @HostParam("$host") String host, + Mono>> redeploy( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -315,8 +325,8 @@ Mono>> redeploy( + "/virtualMachines/{vmName}/reimage") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reimage( - @HostParam("$host") String host, + Mono>> reimage( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -330,8 +340,8 @@ Mono>> reimage( + "/virtualMachines/{vmName}/performMaintenance") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> performMaintenance( - @HostParam("$host") String host, + Mono>> performMaintenance( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -344,8 +354,8 @@ Mono>> performMaintenance( + "/virtualMachines/{vmName}/runCommand") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> runCommand( - @HostParam("$host") String host, + Mono>> runCommand( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -359,8 +369,8 @@ Mono>> runCommand( + "/virtualMachines/{vmName}/capture") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCapture( - @HostParam("$host") String host, + Mono> beginCaptureWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -374,8 +384,8 @@ Mono> beginCapture( + "/virtualMachines/{vmName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdate( - @HostParam("$host") String host, + Mono> beginCreateOrUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -389,8 +399,8 @@ Mono> beginCreateOrUpdate( + "/virtualMachines/{vmName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdate( - @HostParam("$host") String host, + Mono> beginUpdateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -404,8 +414,8 @@ Mono> beginUpdate( + "/virtualMachines/{vmName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDelete( - @HostParam("$host") String host, + Mono> beginDeleteWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -418,8 +428,8 @@ Mono> beginDelete( + "/virtualMachines/{vmName}/convertToManagedDisks") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginConvertToManagedDisks( - @HostParam("$host") String host, + Mono> beginConvertToManagedDisksWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -432,8 +442,8 @@ Mono> beginConvertToManagedDisks( + "/virtualMachines/{vmName}/deallocate") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocate( - @HostParam("$host") String host, + Mono> beginDeallocateWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -446,8 +456,8 @@ Mono> beginDeallocate( + "/virtualMachines/{vmName}/powerOff") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOff( - @HostParam("$host") String host, + Mono> beginPowerOffWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("skipShutdown") Boolean skipShutdown, @@ -461,8 +471,8 @@ Mono> beginPowerOff( + "/virtualMachines/{vmName}/restart") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestart( - @HostParam("$host") String host, + Mono> beginRestartWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -475,8 +485,8 @@ Mono> beginRestart( + "/virtualMachines/{vmName}/start") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStart( - @HostParam("$host") String host, + Mono> beginStartWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -489,8 +499,8 @@ Mono> beginStart( + "/virtualMachines/{vmName}/redeploy") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeploy( - @HostParam("$host") String host, + Mono> beginRedeployWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -503,8 +513,8 @@ Mono> beginRedeploy( + "/virtualMachines/{vmName}/reimage") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimage( - @HostParam("$host") String host, + Mono> beginReimageWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -518,8 +528,8 @@ Mono> beginReimage( + "/virtualMachines/{vmName}/performMaintenance") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenance( - @HostParam("$host") String host, + Mono> beginPerformMaintenanceWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -532,8 +542,8 @@ Mono> beginPerformMaintenance( + "/virtualMachines/{vmName}/runCommand") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRunCommand( - @HostParam("$host") String host, + Mono> beginRunCommandWithoutPolling( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmName") String vmName, @QueryParam("api-version") String apiVersion, @@ -545,21 +555,21 @@ Mono> beginRunCommand( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocationNext( + Mono> listByLocationNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( + Mono> listAllNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); } @@ -574,9 +584,11 @@ Mono> listAllNext( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByLocationSinglePageAsync(String location) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -593,7 +605,7 @@ public Mono> listByLocationSinglePageAsync(St context -> service .listByLocation( - this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context)) + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context)) .>map( res -> new PagedResponseBase<>( @@ -618,9 +630,11 @@ public Mono> listByLocationSinglePageAsync(St */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listByLocationSinglePageAsync(String location, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -633,7 +647,7 @@ public Mono> listByLocationSinglePageAsync(St } final String apiVersion = "2019-03-01"; return service - .listByLocation(this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), context) + .listByLocation(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( res -> new PagedResponseBase<>( @@ -691,6 +705,21 @@ public PagedIterable listByLocation(String location) { return new PagedIterable<>(listByLocationAsync(location)); } + /** + * Gets all the virtual machines under the specified subscription for the specified location. + * + * @param location The location for which virtual machines under the subscription are queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the virtual machines under the specified subscription for the specified location. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, Context context) { + return new PagedIterable<>(listByLocationAsync(location, context)); + } + /** * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar * VMs. @@ -704,11 +733,13 @@ public PagedIterable listByLocation(String location) { * @return output of virtual machine capture operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> captureWithResponseAsync( + public Mono>> captureWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -734,7 +765,7 @@ public Mono>> captureWithResponseAsync( context -> service .capture( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -744,6 +775,110 @@ public Mono>> captureWithResponseAsync( .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> captureWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2019-03-01"; + return service + .capture( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + Mono>> mono = captureWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineCaptureResultInner.class, + VirtualMachineCaptureResultInner.class); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, VirtualMachineCaptureResultInner> beginCapture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + Mono>> mono = + captureWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineCaptureResultInner.class, + VirtualMachineCaptureResultInner.class); + } + /** * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar * VMs. @@ -759,7 +894,36 @@ public Mono>> captureWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono captureAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - Mono>> mono = captureWithResponseAsync(resourceGroupName, vmName, parameters); + Mono>> mono = captureWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + VirtualMachineCaptureResultInner.class, + VirtualMachineCaptureResultInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono captureAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + Mono>> mono = + captureWithResponseAsync(resourceGroupName, vmName, parameters, context); return this .client .getLroResultAsync( @@ -789,6 +953,25 @@ public VirtualMachineCaptureResultInner capture( return captureAsync(resourceGroupName, vmName, parameters).block(); } + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineCaptureResultInner capture( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + return captureAsync(resourceGroupName, vmName, parameters, context).block(); + } + /** * The operation to create or update a virtual machine. * @@ -801,11 +984,13 @@ public VirtualMachineCaptureResultInner capture( * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( + public Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -831,7 +1016,7 @@ public Mono>> createOrUpdateWithResponseAsync( context -> service .createOrUpdate( - this.client.getHost(), + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -847,57 +1032,20 @@ public Mono>> createOrUpdateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @param parameters Describes a Virtual 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 a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * The operation to create or update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return createOrUpdateAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - if (this.client.getHost() == null) { + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -918,155 +1066,162 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); } /** - * The operation to update a virtual machine. + * The operation to create or update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. + * @param parameters Describes a Virtual Machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters); + public PollerFlux, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters); return this .client .getLroResultAsync( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class); } /** - * The operation to update a virtual machine. + * The operation to create or update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. + * @param parameters Describes a Virtual 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 a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update(String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return updateAsync(resourceGroupName, vmName, parameters).block(); + public PollerFlux, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class); } /** - * The operation to delete a virtual machine. + * The operation to create or update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono createOrUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * The operation to delete a virtual machine. + * The operation to create or update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual 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 completion. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String vmName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName); + public Mono createOrUpdateAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters, context); return this .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .getLroResultAsync( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class) .last() .flatMap(AsyncPollResponse::getFinalResult); } /** - * The operation to delete a virtual machine. + * The operation to create or update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmName) { - deleteAsync(resourceGroupName, vmName).block(); + public VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) { + return createOrUpdateAsync(resourceGroupName, vmName, parameters).block(); } /** - * Retrieves information about the model view or the instance view of a virtual machine. + * The operation to create or update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param parameters Describes a Virtual 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 a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand) { - if (this.client.getHost() == null) { + public VirtualMachineInner createOrUpdate( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vmName, parameters, context).block(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1081,28 +1236,33 @@ public Mono> getByResourceGroupWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String apiVersion = "2019-03-01"; return FluxUtil .withContext( context -> service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), resourceGroupName, vmName, - expand, apiVersion, this.client.getSubscriptionId(), + parameters, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Retrieves information about the model view or the instance view of a virtual machine. + * The operation to update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param parameters Describes a Virtual Machine 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. @@ -1110,11 +1270,13 @@ public Mono> getByResourceGroupWithResponseA * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { - if (this.client.getHost() == null) { + public Mono>> updateWithResponseAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1129,117 +1291,164 @@ public Mono> getByResourceGroupWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String apiVersion = "2019-03-01"; return service - .getByResourceGroup( - this.client.getHost(), + .update( + this.client.getEndpoint(), resourceGroupName, vmName, - expand, apiVersion, this.client.getSubscriptionId(), + parameters, context); } /** - * Retrieves information about the model view or the instance view of a virtual machine. + * The operation to update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync( - String resourceGroupName, String vmName, InstanceViewTypes expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class); } /** - * Retrieves information about the model view or the instance view of a virtual machine. + * The operation to update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String vmName) { - final InstanceViewTypes expand = null; - final Context context = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, VirtualMachineInner> beginUpdate( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class); } /** - * Retrieves information about the model view or the instance view of a virtual machine. + * The operation to update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param expand The expand expression to apply on the operation. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName, InstanceViewTypes expand) { - return getByResourceGroupAsync(resourceGroupName, vmName, expand).block(); + public Mono updateAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Retrieves information about the model view or the instance view of a virtual machine. + * The operation to update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName) { - final InstanceViewTypes expand = null; - final Context context = null; - return getByResourceGroupAsync(resourceGroupName, vmName, expand).block(); + public Mono updateAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Retrieves information about the run-time state of a virtual machine. + * The operation to update a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine 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 instance view of a virtual machine. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> instanceViewWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public VirtualMachineInner update(String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { + return updateAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner update( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + return updateAsync(resourceGroupName, vmName, parameters, context).block(); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1259,8 +1468,8 @@ public Mono> instanceViewWithRes .withContext( context -> service - .instanceView( - this.client.getHost(), + .delete( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -1270,7 +1479,7 @@ public Mono> instanceViewWithRes } /** - * Retrieves information about the run-time state of a virtual machine. + * The operation to delete a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1278,14 +1487,16 @@ public Mono> instanceViewWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the instance view of a virtual machine. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> instanceViewWithResponseAsync( + public Mono>> deleteWithResponseAsync( String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1302,51 +1513,50 @@ public Mono> instanceViewWithRes } final String apiVersion = "2019-03-01"; return service - .instanceView( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .delete( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Retrieves information about the run-time state of a virtual machine. + * The operation to delete a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 instance view of a virtual machine. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono instanceViewAsync(String resourceGroupName, String vmName) { - return instanceViewWithResponseAsync(resourceGroupName, vmName) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public PollerFlux, Void> beginDelete(String resourceGroupName, String vmName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Retrieves information about the run-time state of a virtual machine. + * The operation to delete a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 instance view of a virtual machine. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName) { - return instanceViewAsync(resourceGroupName, vmName).block(); + public PollerFlux, Void> beginDelete(String resourceGroupName, String vmName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. + * The operation to delete a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1356,54 +1566,29 @@ public VirtualMachineInstanceViewInner instanceView(String resourceGroupName, St * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> convertToManagedDisksWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .convertToManagedDisks( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono deleteAsync(String resourceGroupName, String vmName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. + * The operation to delete a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName) { - Mono>> mono = convertToManagedDisksWithResponseAsync(resourceGroupName, vmName); + public Mono deleteAsync(String resourceGroupName, String vmName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -1412,8 +1597,7 @@ public Mono convertToManagedDisksAsync(String resourceGroupName, String vm } /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. + * The operation to delete a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -1422,26 +1606,44 @@ public Mono convertToManagedDisksAsync(String resourceGroupName, String vm * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void convertToManagedDisks(String resourceGroupName, String vmName) { - convertToManagedDisksAsync(resourceGroupName, vmName).block(); + public void delete(String resourceGroupName, String vmName) { + deleteAsync(resourceGroupName, vmName).block(); } /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. + * The operation to delete a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deallocateWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public void delete(String resourceGroupName, String vmName, Context context) { + deleteAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Retrieves information about the model view or the instance view of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmName, InstanceViewTypes expand) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1461,10 +1663,11 @@ public Mono>> deallocateWithResponseAsync(String .withContext( context -> service - .deallocate( - this.client.getHost(), + .getByResourceGroup( + this.client.getEndpoint(), resourceGroupName, vmName, + expand, apiVersion, this.client.getSubscriptionId(), context)) @@ -1472,170 +1675,204 @@ public Mono>> deallocateWithResponseAsync(String } /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. + * Retrieves information about the model view or the instance view of a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deallocateAsync(String resourceGroupName, String vmName) { - Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vmName, + expand, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. + * Retrieves information about the model view or the instance view of a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deallocate(String resourceGroupName, String vmName) { - deallocateAsync(resourceGroupName, vmName).block(); + public Mono getByResourceGroupAsync( + String resourceGroupName, String vmName, InstanceViewTypes expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Sets the state of the virtual machine to generalized. + * Retrieves information about the model view or the instance view of a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .generalize( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono getByResourceGroupAsync( + String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Sets the state of the virtual machine to generalized. + * Retrieves information about the model view or the instance view of a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; - return service - .generalize( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + public Mono getByResourceGroupAsync(String resourceGroupName, String vmName) { + final InstanceViewTypes expand = null; + final Context context = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, vmName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Sets the state of the virtual machine to generalized. + * Retrieves information about the model view or the instance view of a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generalizeAsync(String resourceGroupName, String vmName) { - return generalizeWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); + public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName, InstanceViewTypes expand) { + return getByResourceGroupAsync(resourceGroupName, vmName, expand).block(); } /** - * Sets the state of the virtual machine to generalized. + * Retrieves information about the model view or the instance view of a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void generalize(String resourceGroupName, String vmName) { - generalizeAsync(resourceGroupName, vmName).block(); + public VirtualMachineInner getByResourceGroup( + String resourceGroupName, String vmName, InstanceViewTypes expand, Context context) { + return getByResourceGroupAsync(resourceGroupName, vmName, expand, context).block(); } /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. + * Retrieves information about the model view or the instance view of a virtual machine. * * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getHost() == null) { + public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName) { + final InstanceViewTypes expand = null; + final Context context = null; + return getByResourceGroupAsync(resourceGroupName, vmName, expand).block(); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> instanceViewWithResponseAsync( + String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( @@ -1647,46 +1884,1691 @@ public Mono> listByResourceGroupSinglePageAsy .withContext( context -> service - .listByResourceGroup( - this.client.getHost(), + .instanceView( + this.client.getEndpoint(), resourceGroupName, + vmName, apiVersion, this.client.getSubscriptionId(), context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. + * Retrieves information about the run-time state of a virtual machine. * * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the instance view of a virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getHost() == null) { + public Mono> instanceViewWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .instanceView( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono instanceViewAsync(String resourceGroupName, String vmName) { + return instanceViewWithResponseAsync(resourceGroupName, vmName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono instanceViewAsync( + String resourceGroupName, String vmName, Context context) { + return instanceViewWithResponseAsync(resourceGroupName, vmName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName) { + return instanceViewAsync(resourceGroupName, vmName).block(); + } + + /** + * Retrieves information about the run-time state of a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 instance view of a virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceViewInner instanceView(String resourceGroupName, String vmName, Context context) { + return instanceViewAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> convertToManagedDisksWithResponseAsync( + String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .convertToManagedDisks( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> convertToManagedDisksWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .convertToManagedDisks( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginConvertToManagedDisks(String resourceGroupName, String vmName) { + Mono>> mono = convertToManagedDisksWithResponseAsync(resourceGroupName, vmName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginConvertToManagedDisks( + String resourceGroupName, String vmName, Context context) { + Mono>> mono = + convertToManagedDisksWithResponseAsync(resourceGroupName, vmName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName) { + Mono>> mono = convertToManagedDisksWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName, Context context) { + Mono>> mono = + convertToManagedDisksWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void convertToManagedDisks(String resourceGroupName, String vmName) { + convertToManagedDisksAsync(resourceGroupName, vmName).block(); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void convertToManagedDisks(String resourceGroupName, String vmName, Context context) { + convertToManagedDisksAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deallocateWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deallocateWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .deallocate( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeallocate(String resourceGroupName, String vmName) { + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeallocate( + String resourceGroupName, String vmName, Context context) { + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deallocateAsync(String resourceGroupName, String vmName) { + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deallocateAsync(String resourceGroupName, String vmName, Context context) { + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String vmName) { + deallocateAsync(resourceGroupName, vmName).block(); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deallocate(String resourceGroupName, String vmName, Context context) { + deallocateAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .generalize( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> generalizeWithResponseAsync(String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .generalize( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono generalizeAsync(String resourceGroupName, String vmName) { + return generalizeWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono generalizeAsync(String resourceGroupName, String vmName, Context context) { + return generalizeWithResponseAsync(resourceGroupName, vmName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void generalize(String resourceGroupName, String vmName) { + generalizeAsync(resourceGroupName, vmName).block(); + } + + /** + * Sets the state of the virtual machine to generalized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void generalize(String resourceGroupName, String vmName, Context context) { + generalizeAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2019-03-01"; + return service + .listByResourceGroup( + this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to + * get the next page of virtual machines. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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 apiVersion = "2019-03-01"; + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get + * the next page of virtual machines. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAvailableSizesSinglePageAsync( + String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAvailableSizesSinglePageAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .listAvailableSizes( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAvailableSizesAsync(String resourceGroupName, String vmName) { + return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAvailableSizesAsync( + String resourceGroupName, String vmName, Context context) { + return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName, context)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes(String resourceGroupName, String vmName) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, vmName)); + } + + /** + * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSizes( + String resourceGroupName, String vmName, Context context) { + return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, vmName, context)); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmName, Boolean skipShutdown) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> powerOffWithResponseAsync( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .powerOff( + this.client.getEndpoint(), + resourceGroupName, + vmName, + skipShutdown, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPowerOff( + String resourceGroupName, String vmName, Boolean skipShutdown) { + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginPowerOff( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono powerOffAsync(String resourceGroupName, String vmName) { + final Boolean skipShutdown = null; + final Context context = null; + Mono>> mono = powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown) { + powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + powerOffAsync(resourceGroupName, vmName, skipShutdown, context).block(); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void powerOff(String resourceGroupName, String vmName) { + final Boolean skipShutdown = null; + final Context context = null; + powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return service + .restart( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestart(String resourceGroupName, String vmName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestart(String resourceGroupName, String vmName, Context context) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync(String resourceGroupName, String vmName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync(String resourceGroupName, String vmName, Context context) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmName) { + restartAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String vmName, Context context) { + restartAsync(resourceGroupName, vmName, context).block(); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( @@ -1695,81 +3577,142 @@ public Mono> listByResourceGroupSinglePageAsy } final String apiVersion = "2019-03-01"; return service - .listByResourceGroup( - this.client.getHost(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .start( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. + * The operation to start a virtual machine. * * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStart(String resourceGroupName, String vmName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. + * The operation to start a virtual machine. * * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStart(String resourceGroupName, String vmName, Context context) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to - * get the next page of virtual machines. + * The operation to start a virtual machine. * * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync(String resourceGroupName, String vmName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. + * The operation to start a virtual machine. * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync() { - if (this.client.getHost() == null) { + public Mono startAsync(String resourceGroupName, String vmName, Context context) { + Mono>> mono = startWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmName) { + startAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String vmName, Context context) { + startAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> redeployWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1780,34 +3723,44 @@ public Mono> listSinglePageAsync() { final String apiVersion = "2019-03-01"; return FluxUtil .withContext( - context -> service.list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> + service + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. + * Shuts down the virtual machine, moves it to a new node, and powers it back on. * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync(Context context) { - if (this.client.getHost() == null) { + public Mono>> redeployWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono @@ -1817,75 +3770,138 @@ public Mono> listSinglePageAsync(Context cont } final String apiVersion = "2019-03-01"; return service - .list(this.client.getHost(), apiVersion, this.client.getSubscriptionId(), context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .redeploy( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. + * Shuts down the virtual machine, moves it to a new node, and powers it back on. * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRedeploy(String resourceGroupName, String vmName) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. + * Shuts down the virtual machine, moves it to a new node, and powers it back on. * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRedeploy(String resourceGroupName, String vmName, Context context) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get - * the next page of virtual machines. + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono redeployAsync(String resourceGroupName, String vmName) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono redeployAsync(String resourceGroupName, String vmName, Context context) { + Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName, context); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmName) { + redeployAsync(resourceGroupName, vmName).block(); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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 List Virtual Machine operation response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String vmName, Context context) { + redeployAsync(resourceGroupName, vmName, context).block(); } /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableSizesSinglePageAsync( - String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono>> reimageWithResponseAsync( + String resourceGroupName, String vmName, Boolean tempDisk) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1901,41 +3917,48 @@ public Mono> listAvailableSizesSinglePage "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineReimageParameters parametersInternal = null; + if (tempDisk != null) { + parametersInternal = new VirtualMachineReimageParameters(); + parametersInternal.withTempDisk(tempDisk); + } + VirtualMachineReimageParameters parameters = parametersInternal; return FluxUtil .withContext( context -> service - .listAvailableSizes( - this.client.getHost(), + .reimage( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), + parameters, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAvailableSizesSinglePageAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + public Mono>> reimageWithResponseAsync( + String resourceGroupName, String vmName, Boolean tempDisk, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1951,130 +3974,76 @@ public Mono> listAvailableSizesSinglePage "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; + VirtualMachineReimageParameters parametersInternal = null; + if (tempDisk != null) { + parametersInternal = new VirtualMachineReimageParameters(); + parametersInternal.withTempDisk(tempDisk); + } + VirtualMachineReimageParameters parameters = parametersInternal; return service - .listAvailableSizes( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + .reimage( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); } /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. + * @return the completion. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAvailableSizesAsync(String resourceGroupName, String vmName) { - return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginReimage(String resourceGroupName, String vmName, Boolean tempDisk) { + Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, tempDisk); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAvailableSizesAsync( - String resourceGroupName, String vmName, Context context) { - return new PagedFlux<>(() -> listAvailableSizesSinglePageAsync(resourceGroupName, vmName, context)); - } - - /** - * Lists all available virtual machine sizes to which the specified virtual machine can be resized. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual 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 List Virtual Machine operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAvailableSizes(String resourceGroupName, String vmName) { - return new PagedIterable<>(listAvailableSizesAsync(resourceGroupName, vmName)); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> powerOffWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .powerOff( - this.client.getHost(), - resourceGroupName, - vmName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public PollerFlux, Void> beginReimage( + String resourceGroupName, String vmName, Boolean tempDisk, Context context) { + Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, tempDisk, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); + public Mono reimageAsync(String resourceGroupName, String vmName, Boolean tempDisk) { + Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, tempDisk); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -2083,22 +4052,21 @@ public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean } /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono powerOffAsync(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - final Context context = null; - Mono>> mono = - powerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown); + public Mono reimageAsync(String resourceGroupName, String vmName, Boolean tempDisk, Context context) { + Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, tempDisk, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -2107,42 +4075,40 @@ public Mono powerOffAsync(String resourceGroupName, String vmName) { } /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 powerOff(String resourceGroupName, String vmName, Boolean skipShutdown) { - powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + public void reimage(String resourceGroupName, String vmName, Boolean tempDisk) { + reimageAsync(resourceGroupName, vmName, tempDisk).block(); } /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 powerOff(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - final Context context = null; - powerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + public void reimage(String resourceGroupName, String vmName, Boolean tempDisk, Context context) { + reimageAsync(resourceGroupName, vmName, tempDisk, context).block(); } /** - * The operation to restart a virtual machine. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -2152,10 +4118,13 @@ public void powerOff(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restartWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2175,8 +4144,8 @@ public Mono>> restartWithResponseAsync(String re .withContext( context -> service - .restart( - this.client.getHost(), + .performMaintenance( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -2186,54 +4155,24 @@ public Mono>> restartWithResponseAsync(String re } /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restartAsync(String resourceGroupName, String vmName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String vmName) { - restartAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to start a virtual machine. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> startWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono>> performMaintenanceWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2249,22 +4188,18 @@ public Mono>> startWithResponseAsync(String reso "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .performMaintenance( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); } /** - * The operation to start a virtual machine. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -2274,31 +4209,31 @@ public Mono>> startWithResponseAsync(String reso * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startAsync(String resourceGroupName, String vmName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, vmName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + public PollerFlux, Void> beginPerformMaintenance(String resourceGroupName, String vmName) { + Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * The operation to start a virtual machine. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String vmName) { - startAsync(resourceGroupName, vmName).block(); + public PollerFlux, Void> beginPerformMaintenance( + String resourceGroupName, String vmName, Context context) { + Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -2308,52 +4243,29 @@ public void start(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> redeployWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .redeploy( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public Mono performMaintenanceAsync(String resourceGroupName, String vmName) { + Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName); + return this + .client + .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono redeployAsync(String resourceGroupName, String vmName) { - Mono>> mono = redeployWithResponseAsync(resourceGroupName, vmName); + public Mono performMaintenanceAsync(String resourceGroupName, String vmName, Context context) { + Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName, context); return this .client .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) @@ -2362,7 +4274,7 @@ public Mono redeployAsync(String resourceGroupName, String vmName) { } /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. @@ -2371,28 +4283,44 @@ public Mono redeployAsync(String resourceGroupName, String vmName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void redeploy(String resourceGroupName, String vmName) { - redeployAsync(resourceGroupName, vmName).block(); + public void performMaintenance(String resourceGroupName, String vmName) { + performMaintenanceAsync(resourceGroupName, vmName).block(); } /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> reimageWithResponseAsync( - String resourceGroupName, String vmName, Boolean tempDisk) { - if (this.client.getHost() == null) { + public void performMaintenance(String resourceGroupName, String vmName, Context context) { + performMaintenanceAsync(resourceGroupName, vmName, context).block(); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> runCommandWithResponseAsync( + String resourceGroupName, String vmName, RunCommandInput parameters) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2407,19 +4335,18 @@ public Mono>> reimageWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-03-01"; - VirtualMachineReimageParameters parametersInternal = null; - if (tempDisk != null) { - parametersInternal = new VirtualMachineReimageParameters(); - parametersInternal.withTempDisk(tempDisk); + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - VirtualMachineReimageParameters parameters = parametersInternal; + final String apiVersion = "2019-03-01"; return FluxUtil .withContext( context -> service - .reimage( - this.client.getHost(), + .runCommand( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -2430,59 +4357,25 @@ public Mono>> reimageWithResponseAsync( } /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono reimageAsync(String resourceGroupName, String vmName, Boolean tempDisk) { - Mono>> mono = reimageWithResponseAsync(resourceGroupName, vmName, tempDisk); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 reimage(String resourceGroupName, String vmName, Boolean tempDisk) { - reimageAsync(resourceGroupName, vmName, tempDisk).block(); - } - - /** - * The operation to perform maintenance on a virtual machine. + * Run command on the VM. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> performMaintenanceWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono>> runCommandWithResponseAsync( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2497,53 +4390,65 @@ public Mono>> performMaintenanceWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .performMaintenance( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + return service + .runCommand( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + context); } /** - * The operation to perform maintenance on a virtual machine. + * Run command on the VM. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono performMaintenanceAsync(String resourceGroupName, String vmName) { - Mono>> mono = performMaintenanceWithResponseAsync(resourceGroupName, vmName); + public PollerFlux, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters) { + Mono>> mono = runCommandWithResponseAsync(resourceGroupName, vmName, parameters); return this .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); + .getLroResultAsync( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class); } /** - * The operation to perform maintenance on a virtual machine. + * Run command on the VM. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void performMaintenance(String resourceGroupName, String vmName) { - performMaintenanceAsync(resourceGroupName, vmName).block(); + public PollerFlux, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmName, parameters, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class); } /** @@ -2558,44 +4463,15 @@ public void performMaintenance(String resourceGroupName, String vmName) { * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> runCommandWithResponseAsync( + public Mono runCommandAsync( String resourceGroupName, String vmName, RunCommandInput parameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .runCommand( - this.client.getHost(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + Mono>> mono = runCommandWithResponseAsync(resourceGroupName, vmName, parameters); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class) + .last() + .flatMap(AsyncPollResponse::getFinalResult); } /** @@ -2604,6 +4480,7 @@ public Mono>> runCommandWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2611,9 +4488,9 @@ public Mono>> runCommandWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono runCommandAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - Mono>> mono = - runCommandWithResponseAsync(resourceGroupName, vmName, parameters); + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, vmName, parameters, context); return this .client .getLroResultAsync( @@ -2638,6 +4515,24 @@ public RunCommandResultInner runCommand(String resourceGroupName, String vmName, return runCommandAsync(resourceGroupName, vmName, parameters).block(); } + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + return runCommandAsync(resourceGroupName, vmName, parameters, context).block(); + } + /** * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar * VMs. @@ -2651,11 +4546,13 @@ public RunCommandResultInner runCommand(String resourceGroupName, String vmName, * @return output of virtual machine capture operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCaptureWithResponseAsync( + public Mono> beginCaptureWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2680,8 +4577,8 @@ public Mono> beginCaptureWithRe .withContext( context -> service - .beginCapture( - this.client.getHost(), + .beginCaptureWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -2705,11 +4602,13 @@ public Mono> beginCaptureWithRe * @return output of virtual machine capture operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCaptureWithResponseAsync( + public Mono> beginCaptureWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2731,8 +4630,8 @@ public Mono> beginCaptureWithRe } final String apiVersion = "2019-03-01"; return service - .beginCapture( - this.client.getHost(), + .beginCaptureWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -2754,11 +4653,38 @@ public Mono> beginCaptureWithRe * @return output of virtual machine capture operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCaptureAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureWithResponseAsync(resourceGroupName, vmName, parameters) + public Mono beginCaptureWithoutPollingAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { + return beginCaptureWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCaptureWithoutPollingAsync( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + return beginCaptureWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -2780,9 +4706,28 @@ public Mono beginCaptureAsync( * @return output of virtual machine capture operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineCaptureResultInner beginCapture( + public VirtualMachineCaptureResultInner beginCaptureWithoutPolling( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureAsync(resourceGroupName, vmName, parameters).block(); + return beginCaptureWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar + * VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return output of virtual machine capture operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineCaptureResultInner beginCaptureWithoutPolling( + String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { + return beginCaptureWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); } /** @@ -2797,11 +4742,13 @@ public VirtualMachineCaptureResultInner beginCapture( * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2826,8 +4773,8 @@ public Mono> beginCreateOrUpdateWithResponse .withContext( context -> service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -2850,11 +4797,13 @@ public Mono> beginCreateOrUpdateWithResponse * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithResponseAsync( + public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2876,8 +4825,8 @@ public Mono> beginCreateOrUpdateWithResponse } final String apiVersion = "2019-03-01"; return service - .beginCreateOrUpdate( - this.client.getHost(), + .beginCreateOrUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -2898,11 +4847,37 @@ public Mono> beginCreateOrUpdateWithResponse * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateAsync( + public Mono beginCreateOrUpdateWithoutPollingAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateWithResponseAsync(resourceGroupName, vmName, parameters) + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to create or update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual 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 a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginCreateOrUpdateWithoutPollingAsync( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -2923,9 +4898,27 @@ public Mono beginCreateOrUpdateAsync( * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginCreateOrUpdate( + public VirtualMachineInner beginCreateOrUpdateWithoutPolling( String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters).block(); + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * The operation to create or update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual 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 a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner beginCreateOrUpdateWithoutPolling( + String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { + return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); } /** @@ -2940,11 +4933,13 @@ public VirtualMachineInner beginCreateOrUpdate( * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2969,8 +4964,8 @@ public Mono> beginUpdateWithResponseAsync( .withContext( context -> service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -2993,11 +4988,13 @@ public Mono> beginUpdateWithResponseAsync( * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithResponseAsync( + public Mono> beginUpdateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3019,8 +5016,8 @@ public Mono> beginUpdateWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginUpdate( - this.client.getHost(), + .beginUpdateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3041,11 +5038,37 @@ public Mono> beginUpdateWithResponseAsync( * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateAsync( + public Mono beginUpdateWithoutPollingAsync( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateWithResponseAsync(resourceGroupName, vmName, parameters) + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginUpdateWithoutPollingAsync( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -3066,9 +5089,27 @@ public Mono beginUpdateAsync( * @return describes a Virtual Machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginUpdate( + public VirtualMachineInner beginUpdateWithoutPolling( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateAsync(resourceGroupName, vmName, parameters).block(); + return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * The operation to update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Describes a Virtual Machine 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 describes a Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner beginUpdateWithoutPolling( + String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { + return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); } /** @@ -3082,10 +5123,12 @@ public VirtualMachineInner beginUpdate( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3105,8 +5148,8 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam .withContext( context -> service - .beginDelete( - this.client.getHost(), + .beginDeleteWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3127,10 +5170,13 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithResponseAsync(String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + public Mono> beginDeleteWithoutPollingWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3147,8 +5193,29 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam } final String apiVersion = "2019-03-01"; return service - .beginDelete( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .beginDeleteWithoutPolling( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -3156,14 +5223,30 @@ public Mono> beginDeleteWithResponseAsync(String resourceGroupNam * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteAsync(String resourceGroupName, String vmName) { - return beginDeleteWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); + public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { + return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginDeleteWithoutPolling(String resourceGroupName, String vmName) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmName).block(); } /** @@ -3171,13 +5254,14 @@ public Mono beginDeleteAsync(String resourceGroupName, String vmName) { * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDelete(String resourceGroupName, String vmName) { - beginDeleteAsync(resourceGroupName, vmName).block(); + public void beginDeleteWithoutPolling(String resourceGroupName, String vmName, Context context) { + beginDeleteWithoutPollingAsync(resourceGroupName, vmName, context).block(); } /** @@ -3192,10 +5276,13 @@ public void beginDelete(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginConvertToManagedDisksWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono> beginConvertToManagedDisksWithoutPollingWithResponseAsync( + String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3215,8 +5302,8 @@ public Mono> beginConvertToManagedDisksWithResponseAsync(String r .withContext( context -> service - .beginConvertToManagedDisks( - this.client.getHost(), + .beginConvertToManagedDisksWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3238,11 +5325,13 @@ public Mono> beginConvertToManagedDisksWithResponseAsync(String r * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginConvertToManagedDisksWithResponseAsync( + public Mono> beginConvertToManagedDisksWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3259,8 +5348,30 @@ public Mono> beginConvertToManagedDisksWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginConvertToManagedDisks( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .beginConvertToManagedDisksWithoutPolling( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginConvertToManagedDisksWithoutPollingAsync(String resourceGroupName, String vmName) { + return beginConvertToManagedDisksWithoutPollingWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -3269,14 +5380,16 @@ public Mono> beginConvertToManagedDisksWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginConvertToManagedDisksAsync(String resourceGroupName, String vmName) { - return beginConvertToManagedDisksWithResponseAsync(resourceGroupName, vmName) + public Mono beginConvertToManagedDisksWithoutPollingAsync( + String resourceGroupName, String vmName, Context context) { + return beginConvertToManagedDisksWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) .flatMap((Response res) -> Mono.empty()); } @@ -3291,8 +5404,24 @@ public Mono beginConvertToManagedDisksAsync(String resourceGroupName, Stri * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginConvertToManagedDisks(String resourceGroupName, String vmName) { - beginConvertToManagedDisksAsync(resourceGroupName, vmName).block(); + public void beginConvertToManagedDisksWithoutPolling(String resourceGroupName, String vmName) { + beginConvertToManagedDisksWithoutPollingAsync(resourceGroupName, vmName).block(); + } + + /** + * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before + * invoking this operation. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginConvertToManagedDisksWithoutPolling(String resourceGroupName, String vmName, Context context) { + beginConvertToManagedDisksWithoutPollingAsync(resourceGroupName, vmName, context).block(); } /** @@ -3307,10 +5436,13 @@ public void beginConvertToManagedDisks(String resourceGroupName, String vmName) * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono> beginDeallocateWithoutPollingWithResponseAsync( + String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3330,8 +5462,8 @@ public Mono> beginDeallocateWithResponseAsync(String resourceGrou .withContext( context -> service - .beginDeallocate( - this.client.getHost(), + .beginDeallocateWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3353,11 +5485,13 @@ public Mono> beginDeallocateWithResponseAsync(String resourceGrou * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithResponseAsync( + public Mono> beginDeallocateWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3374,8 +5508,30 @@ public Mono> beginDeallocateWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginDeallocate( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .beginDeallocateWithoutPolling( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginDeallocateWithoutPollingAsync(String resourceGroupName, String vmName) { + return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -3384,14 +5540,15 @@ public Mono> beginDeallocateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateAsync(String resourceGroupName, String vmName) { - return beginDeallocateWithResponseAsync(resourceGroupName, vmName) + public Mono beginDeallocateWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { + return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) .flatMap((Response res) -> Mono.empty()); } @@ -3406,8 +5563,24 @@ public Mono beginDeallocateAsync(String resourceGroupName, String vmName) * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocate(String resourceGroupName, String vmName) { - beginDeallocateAsync(resourceGroupName, vmName).block(); + public void beginDeallocateWithoutPolling(String resourceGroupName, String vmName) { + beginDeallocateWithoutPollingAsync(resourceGroupName, vmName).block(); + } + + /** + * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources + * that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginDeallocateWithoutPolling(String resourceGroupName, String vmName, Context context) { + beginDeallocateWithoutPollingAsync(resourceGroupName, vmName, context).block(); } /** @@ -3425,11 +5598,13 @@ public void beginDeallocate(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithResponseAsync( + public Mono> beginPowerOffWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Boolean skipShutdown) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3449,8 +5624,8 @@ public Mono> beginPowerOffWithResponseAsync( .withContext( context -> service - .beginPowerOff( - this.client.getHost(), + .beginPowerOffWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, skipShutdown, @@ -3476,11 +5651,13 @@ public Mono> beginPowerOffWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithResponseAsync( + public Mono> beginPowerOffWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3497,8 +5674,8 @@ public Mono> beginPowerOffWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginPowerOff( - this.client.getHost(), + .beginPowerOffWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, skipShutdown, @@ -3522,8 +5699,30 @@ public Mono> beginPowerOffWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { - return beginPowerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown) + public Mono beginPowerOffWithoutPollingAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { + return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginPowerOffWithoutPollingAsync( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown, context) .flatMap((Response res) -> Mono.empty()); } @@ -3539,10 +5738,10 @@ public Mono beginPowerOffAsync(String resourceGroupName, String vmName, Bo * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffAsync(String resourceGroupName, String vmName) { + public Mono beginPowerOffWithoutPollingAsync(String resourceGroupName, String vmName) { final Boolean skipShutdown = null; final Context context = null; - return beginPowerOffWithResponseAsync(resourceGroupName, vmName, skipShutdown) + return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown) .flatMap((Response res) -> Mono.empty()); } @@ -3560,8 +5759,28 @@ public Mono beginPowerOffAsync(String resourceGroupName, String vmName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOff(String resourceGroupName, String vmName, Boolean skipShutdown) { - beginPowerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + public void beginPowerOffWithoutPolling(String resourceGroupName, String vmName, Boolean skipShutdown) { + beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown).block(); + } + + /** + * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same + * provisioned resources. You are still charged for this virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not + * 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 beginPowerOffWithoutPolling( + String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { + beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown, context).block(); } /** @@ -3575,10 +5794,10 @@ public void beginPowerOff(String resourceGroupName, String vmName, Boolean skipS * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOff(String resourceGroupName, String vmName) { + public void beginPowerOffWithoutPolling(String resourceGroupName, String vmName) { final Boolean skipShutdown = null; final Context context = null; - beginPowerOffAsync(resourceGroupName, vmName, skipShutdown).block(); + beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown).block(); } /** @@ -3592,10 +5811,12 @@ public void beginPowerOff(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono> beginRestartWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3615,8 +5836,8 @@ public Mono> beginRestartWithResponseAsync(String resourceGroupNa .withContext( context -> service - .beginRestart( - this.client.getHost(), + .beginRestartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3637,11 +5858,13 @@ public Mono> beginRestartWithResponseAsync(String resourceGroupNa * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithResponseAsync( + public Mono> beginRestartWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3658,8 +5881,29 @@ public Mono> beginRestartWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginRestart( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .beginRestartWithoutPolling( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRestartWithoutPollingAsync(String resourceGroupName, String vmName) { + return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -3667,14 +5911,30 @@ public Mono> beginRestartWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartAsync(String resourceGroupName, String vmName) { - return beginRestartWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); + public Mono beginRestartWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { + return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginRestartWithoutPolling(String resourceGroupName, String vmName) { + beginRestartWithoutPollingAsync(resourceGroupName, vmName).block(); } /** @@ -3682,13 +5942,14 @@ public Mono beginRestartAsync(String resourceGroupName, String vmName) { * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestart(String resourceGroupName, String vmName) { - beginRestartAsync(resourceGroupName, vmName).block(); + public void beginRestartWithoutPolling(String resourceGroupName, String vmName, Context context) { + beginRestartWithoutPollingAsync(resourceGroupName, vmName, context).block(); } /** @@ -3702,10 +5963,12 @@ public void beginRestart(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono> beginStartWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3725,8 +5988,8 @@ public Mono> beginStartWithResponseAsync(String resourceGroupName .withContext( context -> service - .beginStart( - this.client.getHost(), + .beginStartWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3747,10 +6010,13 @@ public Mono> beginStartWithResponseAsync(String resourceGroupName * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithResponseAsync(String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + public Mono> beginStartWithoutPollingWithResponseAsync( + String resourceGroupName, String vmName, Context context) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3767,8 +6033,29 @@ public Mono> beginStartWithResponseAsync(String resourceGroupName } final String apiVersion = "2019-03-01"; return service - .beginStart( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .beginStartWithoutPolling( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginStartWithoutPollingAsync(String resourceGroupName, String vmName) { + return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -3776,14 +6063,30 @@ public Mono> beginStartWithResponseAsync(String resourceGroupName * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartAsync(String resourceGroupName, String vmName) { - return beginStartWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); + public Mono beginStartWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { + return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginStartWithoutPolling(String resourceGroupName, String vmName) { + beginStartWithoutPollingAsync(resourceGroupName, vmName).block(); } /** @@ -3791,13 +6094,14 @@ public Mono beginStartAsync(String resourceGroupName, String vmName) { * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStart(String resourceGroupName, String vmName) { - beginStartAsync(resourceGroupName, vmName).block(); + public void beginStartWithoutPolling(String resourceGroupName, String vmName, Context context) { + beginStartWithoutPollingAsync(resourceGroupName, vmName, context).block(); } /** @@ -3811,10 +6115,12 @@ public void beginStart(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono> beginRedeployWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3834,8 +6140,8 @@ public Mono> beginRedeployWithResponseAsync(String resourceGroupN .withContext( context -> service - .beginRedeploy( - this.client.getHost(), + .beginRedeployWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3856,11 +6162,13 @@ public Mono> beginRedeployWithResponseAsync(String resourceGroupN * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithResponseAsync( + public Mono> beginRedeployWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3877,8 +6185,29 @@ public Mono> beginRedeployWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginRedeploy( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .beginRedeployWithoutPolling( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRedeployWithoutPollingAsync(String resourceGroupName, String vmName) { + return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -3886,14 +6215,30 @@ public Mono> beginRedeployWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployAsync(String resourceGroupName, String vmName) { - return beginRedeployWithResponseAsync(resourceGroupName, vmName).flatMap((Response res) -> Mono.empty()); + public Mono beginRedeployWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { + return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Shuts down the virtual machine, moves it to a new node, and powers it back on. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginRedeployWithoutPolling(String resourceGroupName, String vmName) { + beginRedeployWithoutPollingAsync(resourceGroupName, vmName).block(); } /** @@ -3901,13 +6246,14 @@ public Mono beginRedeployAsync(String resourceGroupName, String vmName) { * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeploy(String resourceGroupName, String vmName) { - beginRedeployAsync(resourceGroupName, vmName).block(); + public void beginRedeployWithoutPolling(String resourceGroupName, String vmName, Context context) { + beginRedeployWithoutPollingAsync(resourceGroupName, vmName, context).block(); } /** @@ -3923,11 +6269,13 @@ public void beginRedeploy(String resourceGroupName, String vmName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithResponseAsync( + public Mono> beginReimageWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Boolean tempDisk) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -3953,8 +6301,8 @@ public Mono> beginReimageWithResponseAsync( .withContext( context -> service - .beginReimage( - this.client.getHost(), + .beginReimageWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -3978,11 +6326,13 @@ public Mono> beginReimageWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithResponseAsync( + public Mono> beginReimageWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Boolean tempDisk, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4005,8 +6355,8 @@ public Mono> beginReimageWithResponseAsync( } VirtualMachineReimageParameters parameters = parametersInternal; return service - .beginReimage( - this.client.getHost(), + .beginReimageWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -4028,8 +6378,28 @@ public Mono> beginReimageWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAsync(String resourceGroupName, String vmName, Boolean tempDisk) { - return beginReimageWithResponseAsync(resourceGroupName, vmName, tempDisk) + public Mono beginReimageWithoutPollingAsync(String resourceGroupName, String vmName, Boolean tempDisk) { + return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmName, tempDisk) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginReimageWithoutPollingAsync( + String resourceGroupName, String vmName, Boolean tempDisk, Context context) { + return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmName, tempDisk, context) .flatMap((Response res) -> Mono.empty()); } @@ -4045,8 +6415,25 @@ public Mono beginReimageAsync(String resourceGroupName, String vmName, Boo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimage(String resourceGroupName, String vmName, Boolean tempDisk) { - beginReimageAsync(resourceGroupName, vmName, tempDisk).block(); + public void beginReimageWithoutPolling(String resourceGroupName, String vmName, Boolean tempDisk) { + beginReimageWithoutPollingAsync(resourceGroupName, vmName, tempDisk).block(); + } + + /** + * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage + * parameter is only supported for VM/VMSS with Ephemeral OS disk. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 beginReimageWithoutPolling(String resourceGroupName, String vmName, Boolean tempDisk, Context context) { + beginReimageWithoutPollingAsync(resourceGroupName, vmName, tempDisk, context).block(); } /** @@ -4060,10 +6447,13 @@ public void beginReimage(String resourceGroupName, String vmName, Boolean tempDi * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getHost() == null) { + public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( + String resourceGroupName, String vmName) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4083,8 +6473,8 @@ public Mono> beginPerformMaintenanceWithResponseAsync(String reso .withContext( context -> service - .beginPerformMaintenance( - this.client.getHost(), + .beginPerformMaintenanceWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -4105,11 +6495,13 @@ public Mono> beginPerformMaintenanceWithResponseAsync(String reso * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithResponseAsync( + public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4126,8 +6518,29 @@ public Mono> beginPerformMaintenanceWithResponseAsync( } final String apiVersion = "2019-03-01"; return service - .beginPerformMaintenance( - this.client.getHost(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context); + .beginPerformMaintenanceWithoutPolling( + this.client.getEndpoint(), + resourceGroupName, + vmName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginPerformMaintenanceWithoutPollingAsync(String resourceGroupName, String vmName) { + return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -4135,14 +6548,16 @@ public Mono> beginPerformMaintenanceWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual 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 completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceAsync(String resourceGroupName, String vmName) { - return beginPerformMaintenanceWithResponseAsync(resourceGroupName, vmName) + public Mono beginPerformMaintenanceWithoutPollingAsync( + String resourceGroupName, String vmName, Context context) { + return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) .flatMap((Response res) -> Mono.empty()); } @@ -4156,8 +6571,23 @@ public Mono beginPerformMaintenanceAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenance(String resourceGroupName, String vmName) { - beginPerformMaintenanceAsync(resourceGroupName, vmName).block(); + public void beginPerformMaintenanceWithoutPolling(String resourceGroupName, String vmName) { + beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmName).block(); + } + + /** + * The operation to perform maintenance on a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void beginPerformMaintenanceWithoutPolling(String resourceGroupName, String vmName, Context context) { + beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmName, context).block(); } /** @@ -4172,11 +6602,13 @@ public void beginPerformMaintenance(String resourceGroupName, String vmName) { * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithResponseAsync( + public Mono> beginRunCommandWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, RunCommandInput parameters) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4201,8 +6633,8 @@ public Mono> beginRunCommandWithResponseAs .withContext( context -> service - .beginRunCommand( - this.client.getHost(), + .beginRunCommandWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -4225,11 +6657,13 @@ public Mono> beginRunCommandWithResponseAs * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithResponseAsync( + public Mono> beginRunCommandWithoutPollingWithResponseAsync( String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - if (this.client.getHost() == null) { + if (this.client.getEndpoint() == null) { return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -4251,8 +6685,8 @@ public Mono> beginRunCommandWithResponseAs } final String apiVersion = "2019-03-01"; return service - .beginRunCommand( - this.client.getHost(), + .beginRunCommandWithoutPolling( + this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, @@ -4273,11 +6707,37 @@ public Mono> beginRunCommandWithResponseAs * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRunCommandAsync( + public Mono beginRunCommandWithoutPollingAsync( String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandWithResponseAsync(resourceGroupName, vmName, parameters) + return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono beginRunCommandWithoutPollingAsync( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) .flatMap( - (SimpleResponse res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -4298,8 +6758,27 @@ public Mono beginRunCommandAsync( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner beginRunCommand(String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandAsync(resourceGroupName, vmName, parameters).block(); + public RunCommandResultInner beginRunCommandWithoutPolling( + String resourceGroupName, String vmName, RunCommandInput parameters) { + return beginRunCommandWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); + } + + /** + * Run command on the VM. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Capture Virtual Machine parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner beginRunCommandWithoutPolling( + String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { + return beginRunCommandWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); } /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AccessUriInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AccessUriInner.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AccessUriInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AccessUriInner.java index 9c3398712ac4..8387cd7e5b43 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AccessUriInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AccessUriInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AvailabilitySetInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AvailabilitySetInner.java index 1bcda651ffb7..02797ecb1464 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AvailabilitySetInner.java @@ -2,15 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.Sku; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.Sku; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AvailabilitySetListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AvailabilitySetListResultInner.java index 06926ee70b43..0489a20bff2d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/AvailabilitySetListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeOperationListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ComputeOperationListResultInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeOperationListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ComputeOperationListResultInner.java index 0acd910e870f..18811e45ef70 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeOperationListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ComputeOperationListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeOperationValueInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ComputeOperationValueInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeOperationValueInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ComputeOperationValueInner.java index 1a17a8e357bc..1a6bc132548e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeOperationValueInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ComputeOperationValueInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ContainerServiceInner.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ContainerServiceInner.java index 8573851d9065..80bcbd78f2c7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ContainerServiceInner.java @@ -2,20 +2,20 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.ContainerServiceAgentPoolProfile; -import com.azure.management.compute.ContainerServiceCustomProfile; -import com.azure.management.compute.ContainerServiceDiagnosticsProfile; -import com.azure.management.compute.ContainerServiceLinuxProfile; -import com.azure.management.compute.ContainerServiceMasterProfile; -import com.azure.management.compute.ContainerServiceOrchestratorProfile; -import com.azure.management.compute.ContainerServicePrincipalProfile; -import com.azure.management.compute.ContainerServiceWindowsProfile; +import com.azure.management.compute.models.ContainerServiceAgentPoolProfile; +import com.azure.management.compute.models.ContainerServiceCustomProfile; +import com.azure.management.compute.models.ContainerServiceDiagnosticsProfile; +import com.azure.management.compute.models.ContainerServiceLinuxProfile; +import com.azure.management.compute.models.ContainerServiceMasterProfile; +import com.azure.management.compute.models.ContainerServiceOrchestratorProfile; +import com.azure.management.compute.models.ContainerServicePrincipalProfile; +import com.azure.management.compute.models.ContainerServiceWindowsProfile; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ContainerServiceListResultInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ContainerServiceListResultInner.java index 8df14e7dfbb6..23022ecee0bc 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ContainerServiceListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostGroupInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostGroupInner.java index 379de57b4488..b5271a8106e3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostGroupInner.java @@ -2,13 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.SubResourceReadOnly; +import com.azure.management.compute.models.SubResourceReadOnly; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostGroupListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostGroupListResultInner.java index 9434d312812a..766cf2e6bf76 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostGroupListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostInner.java index 8d5b6ed1f70b..af82753b9489 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostInner.java @@ -2,16 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.DedicatedHostInstanceView; -import com.azure.management.compute.DedicatedHostLicenseTypes; -import com.azure.management.compute.Sku; -import com.azure.management.compute.SubResourceReadOnly; +import com.azure.management.compute.models.DedicatedHostInstanceView; +import com.azure.management.compute.models.DedicatedHostLicenseTypes; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.SubResourceReadOnly; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostListResultInner.java index 94202d477048..a4154654bd7c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DedicatedHostListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskEncryptionSetInner.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskEncryptionSetInner.java index 36f330fc7e7f..c74f9c61d34d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskEncryptionSetInner.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.EncryptionSetIdentity; -import com.azure.management.compute.KeyVaultAndKeyReference; +import com.azure.management.compute.models.EncryptionSetIdentity; +import com.azure.management.compute.models.KeyVaultAndKeyReference; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskEncryptionSetListInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskEncryptionSetListInner.java index 47e8cc5bf53a..e0b00c61d410 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskEncryptionSetListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskInner.java index 123d7b14ceee..34d9c16eacfb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskInner.java @@ -2,19 +2,19 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.CreationData; -import com.azure.management.compute.DiskSku; -import com.azure.management.compute.DiskState; -import com.azure.management.compute.Encryption; -import com.azure.management.compute.EncryptionSettingsCollection; -import com.azure.management.compute.HyperVGeneration; -import com.azure.management.compute.OperatingSystemTypes; +import com.azure.management.compute.models.CreationData; +import com.azure.management.compute.models.DiskSku; +import com.azure.management.compute.models.DiskState; +import com.azure.management.compute.models.Encryption; +import com.azure.management.compute.models.EncryptionSettingsCollection; +import com.azure.management.compute.models.HyperVGeneration; +import com.azure.management.compute.models.OperatingSystemTypes; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskListInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskListInner.java index a6b7b818d059..3973e31a56f9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/DiskListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationInner.java index f0071fec5212..19c50a4ffddc 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationInner.java @@ -2,13 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.OperatingSystemTypes; +import com.azure.management.compute.models.OperatingSystemTypes; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationListInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationListInner.java index 821c6936acb4..a369b6868656 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationVersionInner.java similarity index 91% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationVersionInner.java index b7513d160de7..73b84caae835 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationVersionInner.java @@ -2,15 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.GalleryApplicationVersionPropertiesProvisioningState; -import com.azure.management.compute.GalleryApplicationVersionPublishingProfile; -import com.azure.management.compute.ReplicationStatus; +import com.azure.management.compute.models.GalleryApplicationVersionPropertiesProvisioningState; +import com.azure.management.compute.models.GalleryApplicationVersionPublishingProfile; +import com.azure.management.compute.models.ReplicationStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationVersionListInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationVersionListInner.java index ac5d801a72b4..c3f6d91e4cd7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryApplicationVersionListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageInner.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageInner.java index 0e4765b16ae9..c8b7052a7419 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageInner.java @@ -2,20 +2,20 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.Disallowed; -import com.azure.management.compute.GalleryImageIdentifier; -import com.azure.management.compute.GalleryImagePropertiesProvisioningState; -import com.azure.management.compute.HyperVGeneration; -import com.azure.management.compute.ImagePurchasePlan; -import com.azure.management.compute.OperatingSystemStateTypes; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.RecommendedMachineConfiguration; +import com.azure.management.compute.models.Disallowed; +import com.azure.management.compute.models.GalleryImageIdentifier; +import com.azure.management.compute.models.GalleryImagePropertiesProvisioningState; +import com.azure.management.compute.models.HyperVGeneration; +import com.azure.management.compute.models.ImagePurchasePlan; +import com.azure.management.compute.models.OperatingSystemStateTypes; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.RecommendedMachineConfiguration; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageListInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageListInner.java index 87edba63958f..5bae4f7c822c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageVersionInner.java similarity index 91% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageVersionInner.java index 80422c25d60b..1bd44f29a3e8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageVersionInner.java @@ -2,16 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.GalleryImageVersionPropertiesProvisioningState; -import com.azure.management.compute.GalleryImageVersionPublishingProfile; -import com.azure.management.compute.GalleryImageVersionStorageProfile; -import com.azure.management.compute.ReplicationStatus; +import com.azure.management.compute.models.GalleryImageVersionPropertiesProvisioningState; +import com.azure.management.compute.models.GalleryImageVersionPublishingProfile; +import com.azure.management.compute.models.GalleryImageVersionStorageProfile; +import com.azure.management.compute.models.ReplicationStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageVersionListInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageVersionListInner.java index 61656e6682d7..94d662d23923 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryImageVersionListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryInner.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryInner.java index 8e7d8916dc4f..c59220ac9e68 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryInner.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.GalleryIdentifier; -import com.azure.management.compute.GalleryPropertiesProvisioningState; +import com.azure.management.compute.models.GalleryIdentifier; +import com.azure.management.compute.models.GalleryPropertiesProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryListInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryListInner.java index a17fbc0ca75c..f2ca8aa19cf8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/GalleryListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ImageInner.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ImageInner.java index bb7e4848c5a0..fd67155d432d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ImageInner.java @@ -2,15 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.HyperVGenerationTypes; -import com.azure.management.compute.ImageStorageProfile; +import com.azure.management.compute.models.HyperVGenerationTypes; +import com.azure.management.compute.models.ImageStorageProfile; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ImageListResultInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ImageListResultInner.java index 6e652addd8ca..5e6195a78486 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ImageListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ListUsagesResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ListUsagesResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ListUsagesResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ListUsagesResultInner.java index e2ce5514ce4b..562e0b60be8d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ListUsagesResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ListUsagesResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsOperationResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/LogAnalyticsOperationResultInner.java similarity index 91% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsOperationResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/LogAnalyticsOperationResultInner.java index 1ce8e8a7374e..d59d20f7656c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsOperationResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/LogAnalyticsOperationResultInner.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.LogAnalyticsOutput; +import com.azure.management.compute.models.LogAnalyticsOutput; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ProximityPlacementGroupInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ProximityPlacementGroupInner.java index 5dbca174b7c9..bb487946c252 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ProximityPlacementGroupInner.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.ProximityPlacementGroupType; +import com.azure.management.compute.models.ProximityPlacementGroupType; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ProximityPlacementGroupListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ProximityPlacementGroupListResultInner.java index 3316acd7fa69..e70a585eca79 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ProximityPlacementGroupListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RecoveryWalkResponseInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RecoveryWalkResponseInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RecoveryWalkResponseInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RecoveryWalkResponseInner.java index 10781249bf5a..da62afc42460 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RecoveryWalkResponseInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RecoveryWalkResponseInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ResourceSkuInner.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ResourceSkuInner.java index b749c7e93133..a8a4142e71d7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ResourceSkuInner.java @@ -2,15 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.ResourceSkuCapabilities; -import com.azure.management.compute.ResourceSkuCapacity; -import com.azure.management.compute.ResourceSkuCosts; -import com.azure.management.compute.ResourceSkuLocationInfo; -import com.azure.management.compute.ResourceSkuRestrictions; +import com.azure.management.compute.models.ResourceSkuCapabilities; +import com.azure.management.compute.models.ResourceSkuCapacity; +import com.azure.management.compute.models.ResourceSkuCosts; +import com.azure.management.compute.models.ResourceSkuLocationInfo; +import com.azure.management.compute.models.ResourceSkuRestrictions; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkusResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ResourceSkusResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkusResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ResourceSkusResultInner.java index f13d7e2131f2..c69af3546b34 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkusResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/ResourceSkusResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeStatusInfoInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RollingUpgradeStatusInfoInner.java similarity index 90% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeStatusInfoInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RollingUpgradeStatusInfoInner.java index 5c7f8db8d342..0d8cee564d44 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeStatusInfoInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RollingUpgradeStatusInfoInner.java @@ -2,16 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.ApiError; -import com.azure.management.compute.RollingUpgradePolicy; -import com.azure.management.compute.RollingUpgradeProgressInfo; -import com.azure.management.compute.RollingUpgradeRunningStatus; +import com.azure.management.compute.models.ApiError; +import com.azure.management.compute.models.RollingUpgradePolicy; +import com.azure.management.compute.models.RollingUpgradeProgressInfo; +import com.azure.management.compute.models.RollingUpgradeRunningStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandDocumentBaseInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandDocumentBaseInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandDocumentBaseInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandDocumentBaseInner.java index 7dd83e987547..bd9a04ac1a19 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandDocumentBaseInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandDocumentBaseInner.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.OperatingSystemTypes; +import com.azure.management.compute.models.OperatingSystemTypes; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandDocumentInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandDocumentInner.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandDocumentInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandDocumentInner.java index 8ae990848b78..d2700eaa24a9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandDocumentInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandDocumentInner.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.RunCommandParameterDefinition; +import com.azure.management.compute.models.RunCommandParameterDefinition; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandListResultInner.java index 3e3f8cc0e377..b7ed4a3dcd5d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandResultInner.java similarity index 92% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandResultInner.java index 0e0d894e8735..e72674481c15 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/RunCommandResultInner.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.InstanceViewStatus; +import com.azure.management.compute.models.InstanceViewStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/SnapshotInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/SnapshotInner.java index a397d256336d..62e33cf214aa 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/SnapshotInner.java @@ -2,18 +2,18 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.CreationData; -import com.azure.management.compute.Encryption; -import com.azure.management.compute.EncryptionSettingsCollection; -import com.azure.management.compute.HyperVGeneration; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.SnapshotSku; +import com.azure.management.compute.models.CreationData; +import com.azure.management.compute.models.Encryption; +import com.azure.management.compute.models.EncryptionSettingsCollection; +import com.azure.management.compute.models.HyperVGeneration; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.SnapshotSku; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotListInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/SnapshotListInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotListInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/SnapshotListInner.java index fcfdd5418573..e01d9f46a92f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotListInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/SnapshotListInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoricalStatusInfoInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/UpgradeOperationHistoricalStatusInfoInner.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoricalStatusInfoInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/UpgradeOperationHistoricalStatusInfoInner.java index 4e0e682b1c12..43ecb75dbc6c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoricalStatusInfoInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/UpgradeOperationHistoricalStatusInfoInner.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.UpgradeOperationHistoricalStatusInfoProperties; +import com.azure.management.compute.models.UpgradeOperationHistoricalStatusInfoProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsageInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/UsageInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsageInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/UsageInner.java index 8764fd2a4e01..1e8376f0d5bb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsageInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/UsageInner.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.UsageName; +import com.azure.management.compute.models.UsageName; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCaptureResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineCaptureResultInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCaptureResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineCaptureResultInner.java index d12f45feedd3..7c90aa5c6f93 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCaptureResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineCaptureResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionImageInner.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionImageInner.java index 75ccd4d9681d..642c95f17fc7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionImageInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionInner.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionInner.java index 16348463c043..62730f5d560e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionInner.java @@ -2,13 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -121,24 +121,22 @@ public VirtualMachineExtensionInner withPublisher(String publisher) { } /** - * Get the virtualMachineExtensionType property: Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Get the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". * - * @return the virtualMachineExtensionType value. + * @return the typePropertiesType value. */ public String virtualMachineExtensionType() { return this.virtualMachineExtensionType; } /** - * Set the virtualMachineExtensionType property: Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Set the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". * - * @param virtualMachineExtensionType the typePropertiesType value to set. + * @param typePropertiesType the typePropertiesType value to set. * @return the VirtualMachineExtensionInner object itself. */ - public VirtualMachineExtensionInner withVirtualMachineExtensionType(String virtualMachineExtensionType) { - this.virtualMachineExtensionType = virtualMachineExtensionType; + public VirtualMachineExtensionInner withVirtualMachineExtensionType(String typePropertiesType) { + this.virtualMachineExtensionType = typePropertiesType; return this; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionsListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionsListResultInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionsListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionsListResultInner.java index 78c80de03aee..a9d612319bec 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionsListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineExtensionsListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImageInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineImageInner.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImageInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineImageInner.java index 9abebed9c2d9..034b04899bf8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImageInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineImageInner.java @@ -2,16 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AutomaticOSUpgradeProperties; -import com.azure.management.compute.DataDiskImage; -import com.azure.management.compute.HyperVGenerationTypes; -import com.azure.management.compute.OSDiskImage; -import com.azure.management.compute.PurchasePlan; +import com.azure.management.compute.models.AutomaticOSUpgradeProperties; +import com.azure.management.compute.models.DataDiskImage; +import com.azure.management.compute.models.HyperVGenerationTypes; +import com.azure.management.compute.models.OSDiskImage; +import com.azure.management.compute.models.PurchasePlan; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImageResourceInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineImageResourceInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImageResourceInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineImageResourceInner.java index c5d845f37099..0e338b00429f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImageResourceInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineImageResourceInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineInner.java index 39314d20863b..c69a7444eb78 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineInner.java @@ -2,24 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AdditionalCapabilities; -import com.azure.management.compute.BillingProfile; -import com.azure.management.compute.DiagnosticsProfile; -import com.azure.management.compute.HardwareProfile; -import com.azure.management.compute.NetworkProfile; -import com.azure.management.compute.OSProfile; -import com.azure.management.compute.Plan; -import com.azure.management.compute.StorageProfile; -import com.azure.management.compute.VirtualMachineEvictionPolicyTypes; -import com.azure.management.compute.VirtualMachineIdentity; -import com.azure.management.compute.VirtualMachinePriorityTypes; +import com.azure.management.compute.models.AdditionalCapabilities; +import com.azure.management.compute.models.BillingProfile; +import com.azure.management.compute.models.DiagnosticsProfile; +import com.azure.management.compute.models.HardwareProfile; +import com.azure.management.compute.models.NetworkProfile; +import com.azure.management.compute.models.OSProfile; +import com.azure.management.compute.models.Plan; +import com.azure.management.compute.models.StorageProfile; +import com.azure.management.compute.models.VirtualMachineEvictionPolicyTypes; +import com.azure.management.compute.models.VirtualMachineIdentity; +import com.azure.management.compute.models.VirtualMachinePriorityTypes; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInstanceViewInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineInstanceViewInner.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInstanceViewInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineInstanceViewInner.java index 806cc6d5cc10..6b5fa1bf6a35 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInstanceViewInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineInstanceViewInner.java @@ -2,17 +2,17 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.BootDiagnosticsInstanceView; -import com.azure.management.compute.DiskInstanceView; -import com.azure.management.compute.HyperVGenerationType; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.MaintenanceRedeployStatus; -import com.azure.management.compute.VirtualMachineAgentInstanceView; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.models.BootDiagnosticsInstanceView; +import com.azure.management.compute.models.DiskInstanceView; +import com.azure.management.compute.models.HyperVGenerationType; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.MaintenanceRedeployStatus; +import com.azure.management.compute.models.VirtualMachineAgentInstanceView; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineListResultInner.java index 4720bea951dc..ce423b292453 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java index f73e217bc176..47ea37163221 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java @@ -2,12 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.SubResourceReadOnly; +import com.azure.management.compute.models.SubResourceReadOnly; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetExtensionListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetExtensionListResultInner.java index 7a9b4222310e..551d912a4b25 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetExtensionListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetInner.java index 8b9cfc2555c2..2cbe2204aa5f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetInner.java @@ -2,21 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AdditionalCapabilities; -import com.azure.management.compute.AutomaticRepairsPolicy; -import com.azure.management.compute.Plan; -import com.azure.management.compute.ScaleInPolicy; -import com.azure.management.compute.Sku; -import com.azure.management.compute.UpgradePolicy; -import com.azure.management.compute.VirtualMachineScaleSetIdentity; -import com.azure.management.compute.VirtualMachineScaleSetVMProfile; +import com.azure.management.compute.models.AdditionalCapabilities; +import com.azure.management.compute.models.AutomaticRepairsPolicy; +import com.azure.management.compute.models.Plan; +import com.azure.management.compute.models.ScaleInPolicy; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.UpgradePolicy; +import com.azure.management.compute.models.VirtualMachineScaleSetIdentity; +import com.azure.management.compute.models.VirtualMachineScaleSetVMProfile; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInstanceViewInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetInstanceViewInner.java similarity index 90% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInstanceViewInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetInstanceViewInner.java index 484f38d718ea..84fb2893e770 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInstanceViewInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetInstanceViewInner.java @@ -2,13 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.VirtualMachineScaleSetInstanceViewStatusesSummary; -import com.azure.management.compute.VirtualMachineScaleSetVMExtensionsSummary; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.VirtualMachineScaleSetInstanceViewStatusesSummary; +import com.azure.management.compute.models.VirtualMachineScaleSetVMExtensionsSummary; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListOSUpgradeHistoryInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListOSUpgradeHistoryInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListOSUpgradeHistoryInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListOSUpgradeHistoryInner.java index 6f5ad0d8e7dc..05642f198907 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListOSUpgradeHistoryInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListOSUpgradeHistoryInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListResultInner.java index 5da5bfb8bd92..cc44311badcc 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListSkusResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListSkusResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListSkusResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListSkusResultInner.java index 02068c695b55..106db69ad40b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListSkusResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListSkusResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListWithLinkResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListWithLinkResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListWithLinkResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListWithLinkResultInner.java index b93781e1c194..a0301a0d778a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetListWithLinkResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetListWithLinkResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetSkuInner.java similarity index 91% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetSkuInner.java index 4a7bc2ef712a..de7b03a6cc97 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetSkuInner.java @@ -2,12 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.Sku; -import com.azure.management.compute.VirtualMachineScaleSetSkuCapacity; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuCapacity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMInner.java index 5640c2944bff..3efd1334a903 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMInner.java @@ -2,23 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AdditionalCapabilities; -import com.azure.management.compute.DiagnosticsProfile; -import com.azure.management.compute.HardwareProfile; -import com.azure.management.compute.NetworkProfile; -import com.azure.management.compute.OSProfile; -import com.azure.management.compute.Plan; -import com.azure.management.compute.Sku; -import com.azure.management.compute.StorageProfile; -import com.azure.management.compute.VirtualMachineScaleSetVMNetworkProfileConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetVMProtectionPolicy; +import com.azure.management.compute.models.AdditionalCapabilities; +import com.azure.management.compute.models.DiagnosticsProfile; +import com.azure.management.compute.models.HardwareProfile; +import com.azure.management.compute.models.NetworkProfile; +import com.azure.management.compute.models.OSProfile; +import com.azure.management.compute.models.Plan; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.StorageProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetVMProtectionPolicy; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceViewInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMInstanceViewInner.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceViewInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMInstanceViewInner.java index 29e5f11439ed..ee77b38794b4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceViewInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMInstanceViewInner.java @@ -2,17 +2,17 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.BootDiagnosticsInstanceView; -import com.azure.management.compute.DiskInstanceView; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.MaintenanceRedeployStatus; -import com.azure.management.compute.VirtualMachineAgentInstanceView; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; -import com.azure.management.compute.VirtualMachineHealthStatus; +import com.azure.management.compute.models.BootDiagnosticsInstanceView; +import com.azure.management.compute.models.DiskInstanceView; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.MaintenanceRedeployStatus; +import com.azure.management.compute.models.VirtualMachineAgentInstanceView; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.models.VirtualMachineHealthStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMListResultInner.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMListResultInner.java index 9a7ce3a746a6..02cfb7f34902 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineScaleSetVMListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineSizeInner.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineSizeInner.java index 4701e59ddc85..fb30c3f5952a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineSizeInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeListResultInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineSizeListResultInner.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeListResultInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineSizeListResultInner.java index 978a4c4b00b1..c93b27c622b2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeListResultInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineSizeListResultInner.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineUpdateInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineUpdateInner.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineUpdateInner.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineUpdateInner.java index 773e073d472d..e51394311f02 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineUpdateInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/VirtualMachineUpdateInner.java @@ -2,24 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute.models; +package com.azure.management.compute.fluent.inner; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AdditionalCapabilities; -import com.azure.management.compute.BillingProfile; -import com.azure.management.compute.DiagnosticsProfile; -import com.azure.management.compute.HardwareProfile; -import com.azure.management.compute.NetworkProfile; -import com.azure.management.compute.OSProfile; -import com.azure.management.compute.Plan; -import com.azure.management.compute.StorageProfile; -import com.azure.management.compute.UpdateResource; -import com.azure.management.compute.VirtualMachineEvictionPolicyTypes; -import com.azure.management.compute.VirtualMachineIdentity; -import com.azure.management.compute.VirtualMachinePriorityTypes; +import com.azure.management.compute.models.AdditionalCapabilities; +import com.azure.management.compute.models.BillingProfile; +import com.azure.management.compute.models.DiagnosticsProfile; +import com.azure.management.compute.models.HardwareProfile; +import com.azure.management.compute.models.NetworkProfile; +import com.azure.management.compute.models.OSProfile; +import com.azure.management.compute.models.Plan; +import com.azure.management.compute.models.StorageProfile; +import com.azure.management.compute.models.UpdateResource; +import com.azure.management.compute.models.VirtualMachineEvictionPolicyTypes; +import com.azure.management.compute.models.VirtualMachineIdentity; +import com.azure.management.compute.models.VirtualMachinePriorityTypes; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/package-info.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/package-info.java new file mode 100644 index 000000000000..ae8f163fcef7 --- /dev/null +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/inner/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ComputeManagementClient. Compute Client. */ +package com.azure.management.compute.fluent.inner; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/package-info.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/package-info.java new file mode 100644 index 000000000000..8461ca731b9e --- /dev/null +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ComputeManagementClient. Compute Client. */ +package com.azure.management.compute.fluent; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetImpl.java index e33cde28bf68..36c873a45102 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetImpl.java @@ -4,15 +4,16 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.SubResource; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.ProximityPlacementGroup; -import com.azure.management.compute.ProximityPlacementGroupType; -import com.azure.management.compute.Sku; -import com.azure.management.compute.VirtualMachineSize; -import com.azure.management.compute.models.AvailabilitySetInner; -import com.azure.management.compute.models.ProximityPlacementGroupInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.ProximityPlacementGroup; +import com.azure.management.compute.models.ProximityPlacementGroupType; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.VirtualMachineSize; +import com.azure.management.compute.fluent.inner.AvailabilitySetInner; +import com.azure.management.compute.fluent.inner.ProximityPlacementGroupInner; import com.azure.management.resources.fluentcore.arm.ResourceId; import com.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; import com.azure.management.resources.fluentcore.utils.Utils; @@ -73,7 +74,7 @@ public Set virtualMachineIds() { public ProximityPlacementGroup proximityPlacementGroup() { ResourceId id = ResourceId.fromString(inner().proximityPlacementGroup().id()); ProximityPlacementGroupInner plgInner = - manager().inner().proximityPlacementGroups().getByResourceGroup(id.resourceGroupName(), id.name()); + manager().inner().getProximityPlacementGroups().getByResourceGroup(id.resourceGroupName(), id.name()); if (plgInner == null) { return null; } else { @@ -90,7 +91,7 @@ public List statuses() { public PagedIterable listVirtualMachineSizes() { return manager() .inner() - .availabilitySets() + .getAvailabilitySets() .listAvailableSizes(resourceGroupName(), name()) .mapPage(virtualMachineSizeInner -> new VirtualMachineSizeImpl(virtualMachineSizeInner)); } @@ -109,7 +110,8 @@ public Mono refreshAsync() { @Override protected Mono getInnerAsync() { - return this.manager().inner().availabilitySets().getByResourceGroupAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getAvailabilitySets() + .getByResourceGroupAsync(this.resourceGroupName(), this.name()); } @Override @@ -175,7 +177,7 @@ public Mono createResourceAsync() { availabilitySet -> manager() .inner() - .availabilitySets() + .getAvailabilitySets() .createOrUpdateAsync(resourceGroupName(), name(), inner()) .map( availabilitySetInner -> { @@ -194,7 +196,7 @@ private Mono createNewProximityPlacementGroupAsync() { return this .manager() .inner() - .proximityPlacementGroups() + .getProximityPlacementGroups() .createOrUpdateAsync(this.resourceGroupName(), this.newProximityPlacementGroupName, plgInner) .map( createdPlgInner -> { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetsImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetsImpl.java index 5a9382b768c1..77c9b53b2768 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetsImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/AvailabilitySetsImpl.java @@ -4,32 +4,33 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.AvailabilitySets; -import com.azure.management.compute.models.AvailabilitySetInner; -import com.azure.management.compute.models.AvailabilitySetsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.AvailabilitySets; +import com.azure.management.compute.fluent.inner.AvailabilitySetInner; +import com.azure.management.compute.fluent.AvailabilitySetsClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import reactor.core.publisher.Mono; /** The implementation for AvailabilitySets. */ -class AvailabilitySetsImpl +public class AvailabilitySetsImpl extends GroupableResourcesImpl< - AvailabilitySet, AvailabilitySetImpl, AvailabilitySetInner, AvailabilitySetsInner, ComputeManager> + AvailabilitySet, AvailabilitySetImpl, AvailabilitySetInner, AvailabilitySetsClient, ComputeManager> implements AvailabilitySets { - AvailabilitySetsImpl(final ComputeManager computeManager) { - super(computeManager.inner().availabilitySets(), computeManager); + public AvailabilitySetsImpl(final ComputeManager computeManager) { + super(computeManager.inner().getAvailabilitySets(), computeManager); } @Override public PagedIterable list() { - return manager().inner().availabilitySets().list().mapPage(this::wrapModel); + return manager().inner().getAvailabilitySets().list().mapPage(this::wrapModel); } @Override public PagedFlux listAsync() { - return this.manager().inner().availabilitySets().listAsync().mapPage(this::wrapModel); + return this.manager().inner().getAvailabilitySets().listAsync().mapPage(this::wrapModel); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkuImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkuImpl.java index eb2837b93570..01575dbc2f10 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkuImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkuImpl.java @@ -3,20 +3,20 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.ComputeResourceType; -import com.azure.management.compute.ComputeSku; -import com.azure.management.compute.ComputeSkuName; -import com.azure.management.compute.ComputeSkuTier; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.DiskStorageAccountTypes; -import com.azure.management.compute.ResourceSkuCapabilities; -import com.azure.management.compute.ResourceSkuCapacity; -import com.azure.management.compute.ResourceSkuCosts; -import com.azure.management.compute.ResourceSkuLocationInfo; -import com.azure.management.compute.ResourceSkuRestrictions; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.models.ResourceSkuInner; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.ComputeResourceType; +import com.azure.management.compute.models.ComputeSku; +import com.azure.management.compute.models.ComputeSkuName; +import com.azure.management.compute.models.ComputeSkuTier; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.DiskStorageAccountTypes; +import com.azure.management.compute.models.ResourceSkuCapabilities; +import com.azure.management.compute.models.ResourceSkuCapacity; +import com.azure.management.compute.models.ResourceSkuCosts; +import com.azure.management.compute.models.ResourceSkuLocationInfo; +import com.azure.management.compute.models.ResourceSkuRestrictions; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.fluent.inner.ResourceSkuInner; import com.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.azure.management.resources.fluentcore.arm.Region; import java.util.ArrayList; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkusImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkusImpl.java index fa748f939319..4f1af08e3991 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkusImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeSkusImpl.java @@ -5,22 +5,23 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.ComputeResourceType; -import com.azure.management.compute.ComputeSku; -import com.azure.management.compute.ComputeSkus; -import com.azure.management.compute.models.ResourceSkuInner; -import com.azure.management.compute.models.ResourceSkusInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.ComputeResourceType; +import com.azure.management.compute.models.ComputeSku; +import com.azure.management.compute.models.ComputeSkus; +import com.azure.management.compute.fluent.inner.ResourceSkuInner; +import com.azure.management.compute.fluent.ResourceSkusClient; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; import com.azure.management.resources.fluentcore.utils.PagedConverter; import reactor.core.publisher.Mono; /** The implementation for {@link ComputeSkus}. */ -final class ComputeSkusImpl extends ReadableWrappersImpl +public final class ComputeSkusImpl extends ReadableWrappersImpl implements ComputeSkus { private final ComputeManager manager; - ComputeSkusImpl(ComputeManager computeManager) { + public ComputeSkusImpl(ComputeManager computeManager) { this.manager = computeManager; } @@ -60,8 +61,8 @@ public PagedFlux listByRegionAsync(final Region region) { } @Override - public ResourceSkusInner inner() { - return this.manager.inner().resourceSkus(); + public ResourceSkusClient inner() { + return this.manager.inner().getResourceSkus(); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsageImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsageImpl.java index af167aa923ee..dbe3045d8287 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsageImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsageImpl.java @@ -2,10 +2,10 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.ComputeUsage; -import com.azure.management.compute.ComputeUsageUnit; -import com.azure.management.compute.UsageName; -import com.azure.management.compute.models.UsageInner; +import com.azure.management.compute.models.ComputeUsage; +import com.azure.management.compute.models.ComputeUsageUnit; +import com.azure.management.compute.models.UsageName; +import com.azure.management.compute.fluent.inner.UsageInner; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; /** The implementation of ComputeUsage. */ diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsagesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsagesImpl.java index 2eee5d958432..2dcc66c73497 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsagesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ComputeUsagesImpl.java @@ -4,19 +4,19 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.ComputeUsage; -import com.azure.management.compute.ComputeUsages; -import com.azure.management.compute.models.ComputeManagementClientImpl; -import com.azure.management.compute.models.UsageInner; +import com.azure.management.compute.models.ComputeUsage; +import com.azure.management.compute.models.ComputeUsages; +import com.azure.management.compute.ComputeManagementClient; +import com.azure.management.compute.fluent.inner.UsageInner; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; /** The implementation of {@link ComputeUsages}. */ -class ComputeUsagesImpl extends ReadableWrappersImpl +public class ComputeUsagesImpl extends ReadableWrappersImpl implements ComputeUsages { - private final ComputeManagementClientImpl client; + private final ComputeManagementClient client; - ComputeUsagesImpl(ComputeManagementClientImpl client) { + public ComputeUsagesImpl(ComputeManagementClient client) { this.client = client; } @@ -27,7 +27,7 @@ public PagedIterable listByRegion(Region region) { @Override public PagedIterable listByRegion(String regionName) { - return wrapList(client.usages().list(regionName)); + return wrapList(client.getUsages().list(regionName)); } @Override @@ -37,7 +37,7 @@ public PagedFlux listByRegionAsync(Region region) { @Override public PagedFlux listByRegionAsync(String regionName) { - return wrapPageAsync(client.usages().listAsync(regionName)); + return wrapPageAsync(client.getUsages().listAsync(regionName)); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/CustomImageDataDiskImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/CustomImageDataDiskImpl.java index d2cd4a7fa8f1..9153affc24eb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/CustomImageDataDiskImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/CustomImageDataDiskImpl.java @@ -4,10 +4,10 @@ package com.azure.management.compute.implementation; import com.azure.core.management.SubResource; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.ImageDataDisk; -import com.azure.management.compute.VirtualMachineCustomImage; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.ImageDataDisk; +import com.azure.management.compute.models.VirtualMachineCustomImage; import com.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; /** The implementation for {@link VirtualMachineCustomImage.CustomImageDataDisk}. */ diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DiskImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DiskImpl.java index eb4ff991faa9..9e5048079ac4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DiskImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DiskImpl.java @@ -3,18 +3,19 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.AccessLevel; -import com.azure.management.compute.CreationData; -import com.azure.management.compute.CreationSource; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskCreateOption; -import com.azure.management.compute.DiskSku; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.EncryptionSettingsCollection; -import com.azure.management.compute.GrantAccessData; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.Snapshot; -import com.azure.management.compute.models.DiskInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AccessLevel; +import com.azure.management.compute.models.CreationData; +import com.azure.management.compute.models.CreationSource; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskCreateOption; +import com.azure.management.compute.models.DiskSku; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.EncryptionSettingsCollection; +import com.azure.management.compute.models.GrantAccessData; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.Snapshot; +import com.azure.management.compute.fluent.inner.DiskInner; import com.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import com.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; @@ -103,7 +104,7 @@ public Mono grantAccessAsync(int accessDurationInSeconds) { return this .manager() .inner() - .disks() + .getDisks() .grantAccessAsync(this.resourceGroupName(), this.name(), grantAccessDataInner) .onErrorResume(e -> Mono.empty()) .map(accessUriInner -> accessUriInner.accessSas()); @@ -116,7 +117,7 @@ public void revokeAccess() { @Override public Mono revokeAccessAsync() { - return this.manager().inner().disks().revokeAccessAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getDisks().revokeAccessAsync(this.resourceGroupName(), this.name()); } @Override @@ -351,13 +352,13 @@ public DiskImpl withAvailabilityZone(AvailabilityZoneId zoneId) { public Mono createResourceAsync() { return manager() .inner() - .disks() + .getDisks() .createOrUpdateAsync(resourceGroupName(), name(), this.inner()) .map(innerToFluentMap(this)); } @Override protected Mono getInnerAsync() { - return this.manager().inner().disks().getByResourceGroupAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getDisks().getByResourceGroupAsync(this.resourceGroupName(), this.name()); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DisksImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DisksImpl.java index 2bd5f52307f6..358381666ce3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DisksImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/DisksImpl.java @@ -3,21 +3,22 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.AccessLevel; -import com.azure.management.compute.Disk; -import com.azure.management.compute.Disks; -import com.azure.management.compute.GrantAccessData; -import com.azure.management.compute.models.DiskInner; -import com.azure.management.compute.models.DisksInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AccessLevel; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.Disks; +import com.azure.management.compute.models.GrantAccessData; +import com.azure.management.compute.fluent.inner.DiskInner; +import com.azure.management.compute.fluent.DisksClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; import reactor.core.publisher.Mono; /** The implementation for Disks. */ -class DisksImpl extends TopLevelModifiableResourcesImpl +public class DisksImpl extends TopLevelModifiableResourcesImpl implements Disks { - DisksImpl(ComputeManager computeManager) { - super(computeManager.inner().disks(), computeManager); + public DisksImpl(ComputeManager computeManager) { + super(computeManager.inner().getDisks(), computeManager); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionExtensionIdentifier.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionExtensionIdentifier.java index fa764f524eed..bbe6e4dc1e4a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionExtensionIdentifier.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionExtensionIdentifier.java @@ -3,7 +3,7 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.OperatingSystemTypes; +import com.azure.management.compute.models.OperatingSystemTypes; /** An internal type expose utility methods around encryption extension identifier. */ class EncryptionExtensionIdentifier { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionSettings.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionSettings.java index e4a7a9aabbdd..a1bd0b248885 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionSettings.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/EncryptionSettings.java @@ -4,12 +4,12 @@ package com.azure.management.compute.implementation; import com.azure.core.management.SubResource; -import com.azure.management.compute.DiskEncryptionSettings; -import com.azure.management.compute.DiskVolumeType; -import com.azure.management.compute.KeyVaultKeyReference; -import com.azure.management.compute.KeyVaultSecretReference; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachineEncryptionConfiguration; +import com.azure.management.compute.models.DiskEncryptionSettings; +import com.azure.management.compute.models.DiskVolumeType; +import com.azure.management.compute.models.KeyVaultKeyReference; +import com.azure.management.compute.models.KeyVaultSecretReference; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachineEncryptionConfiguration; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.UUID; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleriesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleriesImpl.java index ad25e03324d2..c6b1e0f69b95 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleriesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleriesImpl.java @@ -5,10 +5,11 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.Galleries; -import com.azure.management.compute.Gallery; -import com.azure.management.compute.models.GalleriesInner; -import com.azure.management.compute.models.GalleryInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.Galleries; +import com.azure.management.compute.models.Gallery; +import com.azure.management.compute.fluent.GalleriesClient; +import com.azure.management.compute.fluent.inner.GalleryInner; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import com.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.azure.management.resources.fluentcore.utils.ReactorMapper; @@ -19,10 +20,11 @@ import reactor.core.publisher.Mono; /** The implementation for Galleries. */ -class GalleriesImpl extends GroupableResourcesImpl +public class GalleriesImpl + extends GroupableResourcesImpl implements Galleries { - protected GalleriesImpl(ComputeManager manager) { - super(manager.inner().galleries(), manager); + public GalleriesImpl(ComputeManager manager) { + super(manager.inner().getGalleries(), manager); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageImpl.java index 73234fdf4bd1..2111aa33adbe 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageImpl.java @@ -5,19 +5,20 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.Disallowed; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.DiskStorageAccountTypes; -import com.azure.management.compute.Gallery; -import com.azure.management.compute.GalleryImage; -import com.azure.management.compute.GalleryImageIdentifier; -import com.azure.management.compute.GalleryImageVersion; -import com.azure.management.compute.ImagePurchasePlan; -import com.azure.management.compute.OperatingSystemStateTypes; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.RecommendedMachineConfiguration; -import com.azure.management.compute.ResourceRange; -import com.azure.management.compute.models.GalleryImageInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.Disallowed; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.DiskStorageAccountTypes; +import com.azure.management.compute.models.Gallery; +import com.azure.management.compute.models.GalleryImage; +import com.azure.management.compute.models.GalleryImageIdentifier; +import com.azure.management.compute.models.GalleryImageVersion; +import com.azure.management.compute.models.ImagePurchasePlan; +import com.azure.management.compute.models.OperatingSystemStateTypes; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.RecommendedMachineConfiguration; +import com.azure.management.compute.models.ResourceRange; +import com.azure.management.compute.fluent.inner.GalleryImageInner; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import reactor.core.publisher.Mono; @@ -99,7 +100,7 @@ public ComputeManager manager() { public Mono createResourceAsync() { return manager() .inner() - .galleryImages() + .getGalleryImages() .createOrUpdateAsync(this.resourceGroupName, this.galleryName, this.galleryImageName, this.inner()) .map(innerToFluentMap(this)); } @@ -108,7 +109,7 @@ public Mono createResourceAsync() { public Mono updateResourceAsync() { return manager() .inner() - .galleryImages() + .getGalleryImages() .createOrUpdateAsync(this.resourceGroupName, this.galleryName, this.galleryImageName, this.inner()) .map(innerToFluentMap(this)); } @@ -117,7 +118,7 @@ public Mono updateResourceAsync() { protected Mono getInnerAsync() { return manager() .inner() - .galleryImages() + .getGalleryImages() .getAsync(this.resourceGroupName, this.galleryName, this.galleryImageName); } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionImpl.java index fd0a538a061c..c882367d9e2b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionImpl.java @@ -3,14 +3,15 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.GalleryArtifactVersionSource; -import com.azure.management.compute.GalleryImageVersion; -import com.azure.management.compute.GalleryImageVersionPublishingProfile; -import com.azure.management.compute.GalleryImageVersionStorageProfile; -import com.azure.management.compute.ReplicationStatus; -import com.azure.management.compute.TargetRegion; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.models.GalleryImageVersionInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.GalleryArtifactVersionSource; +import com.azure.management.compute.models.GalleryImageVersion; +import com.azure.management.compute.models.GalleryImageVersionPublishingProfile; +import com.azure.management.compute.models.GalleryImageVersionStorageProfile; +import com.azure.management.compute.models.ReplicationStatus; +import com.azure.management.compute.models.TargetRegion; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.fluent.inner.GalleryImageVersionInner; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import reactor.core.publisher.Mono; @@ -63,7 +64,7 @@ public ComputeManager manager() { public Mono createResourceAsync() { return manager() .inner() - .galleryImageVersions() + .getGalleryImageVersions() .createOrUpdateAsync( this.resourceGroupName, this.galleryName, @@ -77,7 +78,7 @@ public Mono createResourceAsync() { public Mono updateResourceAsync() { return manager() .inner() - .galleryImageVersions() + .getGalleryImageVersions() .createOrUpdateAsync( this.resourceGroupName, this.galleryName, @@ -91,7 +92,7 @@ public Mono updateResourceAsync() { protected Mono getInnerAsync() { return manager() .inner() - .galleryImageVersions() + .getGalleryImageVersions() .getAsync(this.resourceGroupName, this.galleryName, this.galleryImageName, this.galleryImageVersionName); } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionsImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionsImpl.java index 8939c02317e6..e43b611fa252 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionsImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImageVersionsImpl.java @@ -5,19 +5,20 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.GalleryImageVersion; -import com.azure.management.compute.GalleryImageVersions; -import com.azure.management.compute.models.GalleryImageVersionInner; -import com.azure.management.compute.models.GalleryImageVersionsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.GalleryImageVersion; +import com.azure.management.compute.models.GalleryImageVersions; +import com.azure.management.compute.fluent.inner.GalleryImageVersionInner; +import com.azure.management.compute.fluent.GalleryImageVersionsClient; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; import reactor.core.publisher.Mono; /** The implementation for GalleryImageVersions. */ -class GalleryImageVersionsImpl extends WrapperImpl implements GalleryImageVersions { +public class GalleryImageVersionsImpl extends WrapperImpl implements GalleryImageVersions { private final ComputeManager manager; - GalleryImageVersionsImpl(ComputeManager manager) { - super(manager.inner().galleryImageVersions()); + public GalleryImageVersionsImpl(ComputeManager manager) { + super(manager.inner().getGalleryImageVersions()); this.manager = manager; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImagesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImagesImpl.java index 3e7b905e72c2..959db9526164 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImagesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImagesImpl.java @@ -5,19 +5,20 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.GalleryImage; -import com.azure.management.compute.GalleryImages; -import com.azure.management.compute.models.GalleryImageInner; -import com.azure.management.compute.models.GalleryImagesInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.GalleryImage; +import com.azure.management.compute.models.GalleryImages; +import com.azure.management.compute.fluent.inner.GalleryImageInner; +import com.azure.management.compute.fluent.GalleryImagesClient; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; import reactor.core.publisher.Mono; /** The implementation for GalleryImages. */ -class GalleryImagesImpl extends WrapperImpl implements GalleryImages { +public class GalleryImagesImpl extends WrapperImpl implements GalleryImages { private final ComputeManager manager; - GalleryImagesImpl(ComputeManager manager) { - super(manager.inner().galleryImages()); + public GalleryImagesImpl(ComputeManager manager) { + super(manager.inner().getGalleryImages()); this.manager = manager; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImpl.java index 7e79c6c46b0e..9cf56cd62aa5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/GalleryImpl.java @@ -5,9 +5,10 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.Gallery; -import com.azure.management.compute.GalleryImage; -import com.azure.management.compute.models.GalleryInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.Gallery; +import com.azure.management.compute.models.GalleryImage; +import com.azure.management.compute.fluent.inner.GalleryInner; import com.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; import reactor.core.publisher.Mono; @@ -22,7 +23,7 @@ class GalleryImpl extends GroupableResourceImpl createResourceAsync() { return manager() .inner() - .galleries() + .getGalleries() .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) .map(innerToFluentMap(this)); } @@ -31,14 +32,14 @@ public Mono createResourceAsync() { public Mono updateResourceAsync() { return manager() .inner() - .galleries() + .getGalleries() .createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) .map(innerToFluentMap(this)); } @Override protected Mono getInnerAsync() { - return manager().inner().galleries().getByResourceGroupAsync(this.resourceGroupName(), this.name()); + return manager().inner().getGalleries().getByResourceGroupAsync(this.resourceGroupName(), this.name()); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeLegacyEncryptionMonitorImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeLegacyEncryptionMonitorImpl.java index 33fd0bb3d49b..85e7e3dbef12 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeLegacyEncryptionMonitorImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeLegacyEncryptionMonitorImpl.java @@ -3,11 +3,12 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.DiskVolumeEncryptionMonitor; -import com.azure.management.compute.EncryptionStatus; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.models.VirtualMachineExtensionInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.EncryptionStatus; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import java.util.HashMap; import java.util.Map; @@ -115,7 +116,7 @@ private Mono retrieveExtensionWithInstanceViewAsyn VirtualMachineExtensionInner extension) { return computeManager .inner() - .virtualMachineExtensions() + .getVirtualMachineExtensions() .getAsync(rgName, vmName, extension.name(), "instanceView") .onErrorResume(e -> Mono.empty()); } @@ -130,7 +131,7 @@ private Mono retrieveExtensionWithInstanceViewAsyn private Mono retrieveEncryptExtensionWithInstanceViewFromVMAsync() { return computeManager .inner() - .virtualMachines() + .getVirtualMachines() .getByResourceGroupAsync(rgName, vmName) .onErrorResume( e -> diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeNoAADEncryptionMonitorImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeNoAADEncryptionMonitorImpl.java index 57f2a3d89c25..fe84b12a6b2a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeNoAADEncryptionMonitorImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxDiskVolumeNoAADEncryptionMonitorImpl.java @@ -3,13 +3,14 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.DiskInstanceView; -import com.azure.management.compute.DiskVolumeEncryptionMonitor; -import com.azure.management.compute.EncryptionStatus; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; -import com.azure.management.compute.models.VirtualMachineInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.DiskInstanceView; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.EncryptionStatus; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import reactor.core.publisher.Mono; @@ -126,7 +127,7 @@ public Mono refreshAsync() { private Mono retrieveVirtualMachineAsync() { return computeManager .inner() - .virtualMachines() + .getVirtualMachines() .getByResourceGroupAsync(rgName, vmName) .onErrorResume( e -> diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxEncryptionExtensionUtil.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxEncryptionExtensionUtil.java index bb51c97150bd..1c71f9d379b4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxEncryptionExtensionUtil.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/LinuxEncryptionExtensionUtil.java @@ -3,9 +3,9 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.EncryptionStatus; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.models.EncryptionStatus; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.MissingNode; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProximityPlacementGroupImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProximityPlacementGroupImpl.java index 861cc12918a1..305f338e2fc1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProximityPlacementGroupImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProximityPlacementGroupImpl.java @@ -4,10 +4,10 @@ package com.azure.management.compute.implementation; import com.azure.core.management.SubResource; -import com.azure.management.compute.ComputeSku; -import com.azure.management.compute.ProximityPlacementGroup; -import com.azure.management.compute.ProximityPlacementGroupType; -import com.azure.management.compute.models.ProximityPlacementGroupInner; +import com.azure.management.compute.models.ComputeSku; +import com.azure.management.compute.models.ProximityPlacementGroup; +import com.azure.management.compute.models.ProximityPlacementGroupType; +import com.azure.management.compute.fluent.inner.ProximityPlacementGroupInner; import com.azure.management.resources.fluentcore.arm.ResourceId; import java.util.ArrayList; import java.util.Iterator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProxyEncryptionMonitorImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProxyEncryptionMonitorImpl.java index 86e941e0678d..e6ca17a8f6b7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProxyEncryptionMonitorImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/ProxyEncryptionMonitorImpl.java @@ -3,13 +3,14 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.DiskVolumeEncryptionMonitor; -import com.azure.management.compute.EncryptionStatus; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.models.VirtualMachineExtensionInner; -import com.azure.management.compute.models.VirtualMachineInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.EncryptionStatus; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import java.util.HashMap; import java.util.Map; @@ -111,7 +112,7 @@ public Mono refreshAsync() { private Mono retrieveVirtualMachineAsync() { return computeManager .inner() - .virtualMachines() + .getVirtualMachines() .getByResourceGroupAsync(ResourceUtils.groupFromResourceId(vmId), ResourceUtils.nameFromResourceId(vmId)) .onErrorResume(e -> Mono.error(new Exception(String.format("VM with id '%s' not found.", vmId)))); } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/RunCommandResultImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/RunCommandResultImpl.java index b5441fe3e733..5aea0c727ae9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/RunCommandResultImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/RunCommandResultImpl.java @@ -2,9 +2,9 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.RunCommandResult; -import com.azure.management.compute.models.RunCommandResultInner; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.RunCommandResult; +import com.azure.management.compute.fluent.inner.RunCommandResultInner; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotImpl.java index 7d28816d7e60..b0e5ed352202 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotImpl.java @@ -3,20 +3,21 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.AccessLevel; -import com.azure.management.compute.CreationData; -import com.azure.management.compute.CreationSource; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskCreateOption; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.DiskStorageAccountTypes; -import com.azure.management.compute.GrantAccessData; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.Snapshot; -import com.azure.management.compute.SnapshotSku; -import com.azure.management.compute.SnapshotSkuType; -import com.azure.management.compute.SnapshotStorageAccountTypes; -import com.azure.management.compute.models.SnapshotInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AccessLevel; +import com.azure.management.compute.models.CreationData; +import com.azure.management.compute.models.CreationSource; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskCreateOption; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.DiskStorageAccountTypes; +import com.azure.management.compute.models.GrantAccessData; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.Snapshot; +import com.azure.management.compute.models.SnapshotSku; +import com.azure.management.compute.models.SnapshotSkuType; +import com.azure.management.compute.models.SnapshotStorageAccountTypes; +import com.azure.management.compute.fluent.inner.SnapshotInner; import com.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; import com.azure.management.resources.fluentcore.utils.Utils; import reactor.core.publisher.Mono; @@ -84,7 +85,7 @@ public Mono grantAccessAsync(int accessDurationInSeconds) { grantAccessDataInner.withAccess(AccessLevel.READ).withDurationInSeconds(accessDurationInSeconds); return manager() .inner() - .snapshots() + .getSnapshots() .grantAccessAsync(resourceGroupName(), name(), grantAccessDataInner) .onErrorResume(e -> Mono.empty()) .map(accessUriInner -> accessUriInner.accessSas()); @@ -97,7 +98,7 @@ public void revokeAccess() { @Override public Mono revokeAccessAsync() { - return this.manager().inner().snapshots().revokeAccessAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getSnapshots().revokeAccessAsync(this.resourceGroupName(), this.name()); } @Override @@ -292,13 +293,13 @@ public Mono createResourceAsync() { return this .manager() .inner() - .snapshots() + .getSnapshots() .createOrUpdateAsync(resourceGroupName(), name(), this.inner()) .map(innerToFluentMap(this)); } @Override protected Mono getInnerAsync() { - return this.manager().inner().snapshots().getByResourceGroupAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getSnapshots().getByResourceGroupAsync(this.resourceGroupName(), this.name()); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotsImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotsImpl.java index 36cc5d90e4d9..f1397bcfb939 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotsImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/SnapshotsImpl.java @@ -3,22 +3,23 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.AccessLevel; -import com.azure.management.compute.GrantAccessData; -import com.azure.management.compute.Snapshot; -import com.azure.management.compute.Snapshots; -import com.azure.management.compute.models.SnapshotInner; -import com.azure.management.compute.models.SnapshotsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AccessLevel; +import com.azure.management.compute.models.GrantAccessData; +import com.azure.management.compute.models.Snapshot; +import com.azure.management.compute.models.Snapshots; +import com.azure.management.compute.fluent.inner.SnapshotInner; +import com.azure.management.compute.fluent.SnapshotsClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; import reactor.core.publisher.Mono; /** The implementation for Snapshots. */ -class SnapshotsImpl - extends TopLevelModifiableResourcesImpl +public class SnapshotsImpl + extends TopLevelModifiableResourcesImpl implements Snapshots { - SnapshotsImpl(ComputeManager computeManager) { - super(computeManager.inner().snapshots(), computeManager); + public SnapshotsImpl(ComputeManager computeManager) { + super(computeManager.inner().getSnapshots(), computeManager); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/UnmanagedDataDiskImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/UnmanagedDataDiskImpl.java index e91c26be2c2b..01a1a376d12b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/UnmanagedDataDiskImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/UnmanagedDataDiskImpl.java @@ -4,12 +4,12 @@ package com.azure.management.compute.implementation; import com.azure.core.management.AzureEnvironment; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.DataDisk; -import com.azure.management.compute.DiskCreateOptionTypes; -import com.azure.management.compute.VirtualHardDisk; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineUnmanagedDataDisk; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DataDisk; +import com.azure.management.compute.models.DiskCreateOptionTypes; +import com.azure.management.compute.models.VirtualHardDisk; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; import com.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; import com.azure.management.resources.fluentcore.utils.Utils; import com.azure.management.storage.models.StorageAccount; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VMSSPatchPayload.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VMSSPatchPayload.java index 5dbd268a6270..7eea4f06a9ba 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VMSSPatchPayload.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VMSSPatchPayload.java @@ -4,18 +4,18 @@ package com.azure.management.compute.implementation; import com.azure.core.management.SubResource; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetIpConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetNetworkConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetUpdate; -import com.azure.management.compute.VirtualMachineScaleSetUpdateIpConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetUpdateNetworkConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetUpdateNetworkProfile; -import com.azure.management.compute.VirtualMachineScaleSetUpdateOSDisk; -import com.azure.management.compute.VirtualMachineScaleSetUpdateOSProfile; -import com.azure.management.compute.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetUpdateStorageProfile; -import com.azure.management.compute.VirtualMachineScaleSetUpdateVMProfile; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdate; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdateIpConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdateNetworkConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdateNetworkProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdateOSDisk; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdateOSProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdateStorageProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdateVMProfile; import java.util.ArrayList; class VMSSPatchPayload { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImageImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImageImpl.java index 2e0d9b76d281..40abb2f8aafb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImageImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImageImpl.java @@ -4,18 +4,19 @@ package com.azure.management.compute.implementation; import com.azure.core.management.SubResource; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.HyperVGenerationTypes; -import com.azure.management.compute.ImageDataDisk; -import com.azure.management.compute.ImageOSDisk; -import com.azure.management.compute.ImageStorageProfile; -import com.azure.management.compute.OperatingSystemStateTypes; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.Snapshot; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.models.ImageInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.HyperVGenerationTypes; +import com.azure.management.compute.models.ImageDataDisk; +import com.azure.management.compute.models.ImageOSDisk; +import com.azure.management.compute.models.ImageStorageProfile; +import com.azure.management.compute.models.OperatingSystemStateTypes; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.Snapshot; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.fluent.inner.ImageInner; import com.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; import reactor.core.publisher.Mono; @@ -216,14 +217,14 @@ public Mono createResourceAsync() { return this .manager() .inner() - .images() + .getImages() .createOrUpdateAsync(resourceGroupName(), name(), this.inner()) .map(innerToFluentMap(this)); } @Override protected Mono getInnerAsync() { - return this.manager().inner().images().getByResourceGroupAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getImages().getByResourceGroupAsync(this.resourceGroupName(), this.name()); } private ImageOSDisk ensureOsDiskImage() { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImagesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImagesImpl.java index 265d366bfaee..c1141f7c54de 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImagesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineCustomImagesImpl.java @@ -3,20 +3,21 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.VirtualMachineCustomImages; -import com.azure.management.compute.models.ImageInner; -import com.azure.management.compute.models.ImagesInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineCustomImages; +import com.azure.management.compute.fluent.inner.ImageInner; +import com.azure.management.compute.fluent.ImagesClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; /** The implementation for VirtualMachineCustomImages. */ -class VirtualMachineCustomImagesImpl +public class VirtualMachineCustomImagesImpl extends TopLevelModifiableResourcesImpl< - VirtualMachineCustomImage, VirtualMachineCustomImageImpl, ImageInner, ImagesInner, ComputeManager> + VirtualMachineCustomImage, VirtualMachineCustomImageImpl, ImageInner, ImagesClient, ComputeManager> implements VirtualMachineCustomImages { - VirtualMachineCustomImagesImpl(final ComputeManager computeManager) { - super(computeManager.inner().images(), computeManager); + public VirtualMachineCustomImagesImpl(final ComputeManager computeManager) { + super(computeManager.inner().getImages(), computeManager); } @Override diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineDataDiskImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineDataDiskImpl.java index 1cbd302fe4e0..a825e13175be 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineDataDiskImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineDataDiskImpl.java @@ -3,11 +3,11 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.DataDisk; -import com.azure.management.compute.DiskCreateOptionTypes; -import com.azure.management.compute.StorageAccountTypes; -import com.azure.management.compute.VirtualMachineDataDisk; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DataDisk; +import com.azure.management.compute.models.DiskCreateOptionTypes; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.VirtualMachineDataDisk; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; import com.azure.management.resources.fluentcore.utils.Utils; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionHelper.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionHelper.java index fe86afa0bcd3..ea5151437b2f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionHelper.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionHelper.java @@ -3,13 +3,13 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.DiskEncryptionSettings; -import com.azure.management.compute.DiskVolumeEncryptionMonitor; -import com.azure.management.compute.DiskVolumeType; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineEncryptionConfiguration; -import com.azure.management.compute.VirtualMachineExtension; +import com.azure.management.compute.models.DiskEncryptionSettings; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.DiskVolumeType; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineEncryptionConfiguration; +import com.azure.management.compute.models.VirtualMachineExtension; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionImpl.java index ec4c950432fc..237c98e0a170 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineEncryptionImpl.java @@ -3,13 +3,13 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.DiskVolumeEncryptionMonitor; -import com.azure.management.compute.DiskVolumeType; -import com.azure.management.compute.LinuxVMDiskEncryptionConfiguration; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineEncryption; -import com.azure.management.compute.WindowsVMDiskEncryptionConfiguration; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.DiskVolumeType; +import com.azure.management.compute.models.LinuxVMDiskEncryptionConfiguration; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineEncryption; +import com.azure.management.compute.models.WindowsVMDiskEncryptionConfiguration; import reactor.core.publisher.Mono; /** Implementation of VirtualMachineEncryption. */ diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageImpl.java index 27eb6a92b08d..2fd3b2790630 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageImpl.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.ComputeRoles; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachineExtensionImage; -import com.azure.management.compute.VirtualMachineExtensionImageVersion; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; +import com.azure.management.compute.models.ComputeRoles; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachineExtensionImage; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersion; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; /** The implementation for {@link VirtualMachineExtensionImage}. */ diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypeImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypeImpl.java index 4569b9bd99bd..13c5cce60f4b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypeImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypeImpl.java @@ -2,21 +2,21 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineExtensionImageType; -import com.azure.management.compute.VirtualMachineExtensionImageVersions; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; -import com.azure.management.compute.models.VirtualMachineExtensionImagesInner; +import com.azure.management.compute.models.VirtualMachineExtensionImageType; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersions; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; +import com.azure.management.compute.fluent.VirtualMachineExtensionImagesClient; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; /** The implementation for VirtualMachineExtensionImageType. */ class VirtualMachineExtensionImageTypeImpl extends WrapperImpl implements VirtualMachineExtensionImageType { - private final VirtualMachineExtensionImagesInner client; + private final VirtualMachineExtensionImagesClient client; private final VirtualMachinePublisher publisher; VirtualMachineExtensionImageTypeImpl( - VirtualMachineExtensionImagesInner client, + VirtualMachineExtensionImagesClient client, VirtualMachinePublisher publisher, VirtualMachineExtensionImageInner inner) { super(inner); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java index 4ae6f34dd1bf..0539f0eeb546 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageTypesImpl.java @@ -4,11 +4,11 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineExtensionImageType; -import com.azure.management.compute.VirtualMachineExtensionImageTypes; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; -import com.azure.management.compute.models.VirtualMachineExtensionImagesInner; +import com.azure.management.compute.models.VirtualMachineExtensionImageType; +import com.azure.management.compute.models.VirtualMachineExtensionImageTypes; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; +import com.azure.management.compute.fluent.VirtualMachineExtensionImagesClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; import com.azure.management.resources.fluentcore.utils.PagedConverter; @@ -17,11 +17,11 @@ class VirtualMachineExtensionImageTypesImpl extends ReadableWrappersImpl< VirtualMachineExtensionImageType, VirtualMachineExtensionImageTypeImpl, VirtualMachineExtensionImageInner> implements VirtualMachineExtensionImageTypes { - private final VirtualMachineExtensionImagesInner client; + private final VirtualMachineExtensionImagesClient client; private final VirtualMachinePublisher publisher; VirtualMachineExtensionImageTypesImpl( - VirtualMachineExtensionImagesInner client, VirtualMachinePublisher publisher) { + VirtualMachineExtensionImagesClient client, VirtualMachinePublisher publisher) { this.client = client; this.publisher = publisher; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionImpl.java index 5ea538d57b0c..9e52908167ce 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionImpl.java @@ -2,22 +2,22 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineExtensionImage; -import com.azure.management.compute.VirtualMachineExtensionImageType; -import com.azure.management.compute.VirtualMachineExtensionImageVersion; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; -import com.azure.management.compute.models.VirtualMachineExtensionImagesInner; +import com.azure.management.compute.models.VirtualMachineExtensionImage; +import com.azure.management.compute.models.VirtualMachineExtensionImageType; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersion; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; +import com.azure.management.compute.fluent.VirtualMachineExtensionImagesClient; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; import reactor.core.publisher.Mono; /** The implementation for VirtualMachineExtensionImageVersion. */ class VirtualMachineExtensionImageVersionImpl extends WrapperImpl implements VirtualMachineExtensionImageVersion { - private final VirtualMachineExtensionImagesInner client; + private final VirtualMachineExtensionImagesClient client; private final VirtualMachineExtensionImageType type; VirtualMachineExtensionImageVersionImpl( - VirtualMachineExtensionImagesInner client, + VirtualMachineExtensionImagesClient client, VirtualMachineExtensionImageType extensionImageType, VirtualMachineExtensionImageInner inner) { super(inner); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java index a3c6549705c3..05315f1460ef 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImageVersionsImpl.java @@ -4,11 +4,11 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineExtensionImageType; -import com.azure.management.compute.VirtualMachineExtensionImageVersion; -import com.azure.management.compute.VirtualMachineExtensionImageVersions; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; -import com.azure.management.compute.models.VirtualMachineExtensionImagesInner; +import com.azure.management.compute.models.VirtualMachineExtensionImageType; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersion; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersions; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; +import com.azure.management.compute.fluent.VirtualMachineExtensionImagesClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; import com.azure.management.resources.fluentcore.utils.PagedConverter; @@ -17,11 +17,11 @@ public class VirtualMachineExtensionImageVersionsImpl extends ReadableWrappersImpl< VirtualMachineExtensionImageVersion, VirtualMachineExtensionImageVersionImpl, VirtualMachineExtensionImageInner> implements VirtualMachineExtensionImageVersions { - private final VirtualMachineExtensionImagesInner client; + private final VirtualMachineExtensionImagesClient client; private final VirtualMachineExtensionImageType type; VirtualMachineExtensionImageVersionsImpl( - VirtualMachineExtensionImagesInner client, VirtualMachineExtensionImageType type) { + VirtualMachineExtensionImagesClient client, VirtualMachineExtensionImageType type) { this.client = client; this.type = type; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImagesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImagesImpl.java index 14b5e4d5a58a..2ab67af9c458 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImagesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImagesImpl.java @@ -4,19 +4,19 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineExtensionImage; -import com.azure.management.compute.VirtualMachineExtensionImageVersion; -import com.azure.management.compute.VirtualMachineExtensionImages; -import com.azure.management.compute.VirtualMachinePublishers; +import com.azure.management.compute.models.VirtualMachineExtensionImage; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersion; +import com.azure.management.compute.models.VirtualMachineExtensionImages; +import com.azure.management.compute.models.VirtualMachinePublishers; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.utils.PagedConverter; import reactor.core.publisher.Mono; /** The implementation for {@link VirtualMachineExtensionImages}. */ -class VirtualMachineExtensionImagesImpl implements VirtualMachineExtensionImages { +public class VirtualMachineExtensionImagesImpl implements VirtualMachineExtensionImages { private final VirtualMachinePublishers publishers; - VirtualMachineExtensionImagesImpl(VirtualMachinePublishers publishers) { + public VirtualMachineExtensionImagesImpl(VirtualMachinePublishers publishers) { this.publishers = publishers; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImpl.java index 59fee07e1816..bc0d365e1652 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionImpl.java @@ -2,12 +2,12 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineExtension; -import com.azure.management.compute.VirtualMachineExtensionImage; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; -import com.azure.management.compute.models.VirtualMachineExtensionInner; -import com.azure.management.compute.models.VirtualMachineExtensionsInner; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineExtension; +import com.azure.management.compute.models.VirtualMachineExtensionImage; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; +import com.azure.management.compute.fluent.VirtualMachineExtensionsClient; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import com.azure.management.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; import java.util.Collections; @@ -25,7 +25,7 @@ class VirtualMachineExtensionImpl VirtualMachineExtension.Definition, VirtualMachineExtension.UpdateDefinition, VirtualMachineExtension.Update { - private final VirtualMachineExtensionsInner client; + private final VirtualMachineExtensionsClient client; private HashMap publicSettings; private HashMap protectedSettings; @@ -33,14 +33,14 @@ class VirtualMachineExtensionImpl String name, VirtualMachineImpl parent, VirtualMachineExtensionInner inner, - VirtualMachineExtensionsInner client) { + VirtualMachineExtensionsClient client) { super(name, parent, inner); this.client = client; initializeSettings(); } protected static VirtualMachineExtensionImpl newVirtualMachineExtension( - String name, VirtualMachineImpl parent, VirtualMachineExtensionsInner client) { + String name, VirtualMachineImpl parent, VirtualMachineExtensionsClient client) { VirtualMachineExtensionInner inner = new VirtualMachineExtensionInner(); inner.withLocation(parent.regionName()); VirtualMachineExtensionImpl extension = new VirtualMachineExtensionImpl(name, parent, inner, client); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionsImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionsImpl.java index fc5c5da3b070..5798c6e7a277 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionsImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineExtensionsImpl.java @@ -2,10 +2,10 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineExtension; -import com.azure.management.compute.models.VirtualMachineExtensionInner; -import com.azure.management.compute.models.VirtualMachineExtensionsInner; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineExtension; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; +import com.azure.management.compute.fluent.VirtualMachineExtensionsClient; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import com.azure.management.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesCachedImpl; import java.util.ArrayList; @@ -24,7 +24,7 @@ class VirtualMachineExtensionsImpl VirtualMachineExtensionInner, VirtualMachineImpl, VirtualMachine> { - private final VirtualMachineExtensionsInner client; + private final VirtualMachineExtensionsClient client; /** * Creates new VirtualMachineExtensionsImpl. @@ -32,7 +32,7 @@ class VirtualMachineExtensionsImpl * @param client the client to perform REST calls on extensions * @param parent the parent virtual machine of the extensions */ - VirtualMachineExtensionsImpl(VirtualMachineExtensionsInner client, VirtualMachineImpl parent) { + VirtualMachineExtensionsImpl(VirtualMachineExtensionsClient client, VirtualMachineImpl parent) { super(parent, parent.taskGroup(), "VirtualMachineExtension"); this.client = client; this.cacheCollection(); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImageImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImageImpl.java index 0e6cb0f61e5e..afe4a0467adf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImageImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImageImpl.java @@ -2,12 +2,12 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.DataDiskImage; -import com.azure.management.compute.ImageReference; -import com.azure.management.compute.OSDiskImage; -import com.azure.management.compute.PurchasePlan; -import com.azure.management.compute.VirtualMachineImage; -import com.azure.management.compute.models.VirtualMachineImageInner; +import com.azure.management.compute.models.DataDiskImage; +import com.azure.management.compute.models.ImageReference; +import com.azure.management.compute.models.OSDiskImage; +import com.azure.management.compute.models.PurchasePlan; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.fluent.inner.VirtualMachineImageInner; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.implementation.IndexableWrapperImpl; import java.util.Collections; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesImpl.java index 671cc8fe81ef..f29adbfa155b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesImpl.java @@ -4,23 +4,23 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineImage; -import com.azure.management.compute.VirtualMachineImages; -import com.azure.management.compute.VirtualMachinePublishers; -import com.azure.management.compute.models.VirtualMachineImageInner; -import com.azure.management.compute.models.VirtualMachineImageResourceInner; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineImages; +import com.azure.management.compute.models.VirtualMachinePublishers; +import com.azure.management.compute.fluent.inner.VirtualMachineImageInner; +import com.azure.management.compute.fluent.inner.VirtualMachineImageResourceInner; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.utils.PagedConverter; import java.util.List; import reactor.core.publisher.Mono; /** The implementation for {@link VirtualMachineImages}. */ -class VirtualMachineImagesImpl implements VirtualMachineImages { +public class VirtualMachineImagesImpl implements VirtualMachineImages { private final VirtualMachinePublishers publishers; - private final VirtualMachineImagesInner client; + private final VirtualMachineImagesClient client; - VirtualMachineImagesImpl(VirtualMachinePublishers publishers, VirtualMachineImagesInner client) { + public VirtualMachineImagesImpl(VirtualMachinePublishers publishers, VirtualMachineImagesClient client) { this.publishers = publishers; this.client = client; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java index 7bc5a06a3905..e28e4e869c5d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java @@ -4,20 +4,20 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineImage; -import com.azure.management.compute.VirtualMachineImagesInSku; -import com.azure.management.compute.VirtualMachineSku; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineImagesInSku; +import com.azure.management.compute.models.VirtualMachineSku; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.utils.PagedConverter; import reactor.core.publisher.Flux; /** The implementation for {@link VirtualMachineImagesInSku}. */ class VirtualMachineImagesInSkuImpl implements VirtualMachineImagesInSku { - private final VirtualMachineImagesInner innerCollection; + private final VirtualMachineImagesClient innerCollection; private final VirtualMachineSku sku; - VirtualMachineImagesInSkuImpl(VirtualMachineSku sku, VirtualMachineImagesInner innerCollection) { + VirtualMachineImagesInSkuImpl(VirtualMachineSku sku, VirtualMachineImagesClient innerCollection) { this.sku = sku; this.innerCollection = innerCollection; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImpl.java index 1eb2c9d76e20..db1636a7362b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineImpl.java @@ -6,58 +6,60 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.BillingProfile; -import com.azure.management.compute.BootDiagnostics; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.DataDisk; -import com.azure.management.compute.DiagnosticsProfile; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskCreateOptionTypes; -import com.azure.management.compute.DiskEncryptionSettings; -import com.azure.management.compute.HardwareProfile; -import com.azure.management.compute.ImageReference; -import com.azure.management.compute.InstanceViewTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.LinuxConfiguration; -import com.azure.management.compute.ManagedDiskParameters; -import com.azure.management.compute.NetworkInterfaceReference; -import com.azure.management.compute.OSDisk; -import com.azure.management.compute.OSProfile; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.Plan; -import com.azure.management.compute.PowerState; -import com.azure.management.compute.ProximityPlacementGroup; -import com.azure.management.compute.ProximityPlacementGroupType; -import com.azure.management.compute.PurchasePlan; -import com.azure.management.compute.ResourceIdentityType; -import com.azure.management.compute.RunCommandInput; -import com.azure.management.compute.RunCommandInputParameter; -import com.azure.management.compute.RunCommandResult; -import com.azure.management.compute.SshConfiguration; -import com.azure.management.compute.SshPublicKey; -import com.azure.management.compute.StorageAccountTypes; -import com.azure.management.compute.StorageProfile; -import com.azure.management.compute.VirtualHardDisk; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineCaptureParameters; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineEncryption; -import com.azure.management.compute.VirtualMachineEvictionPolicyTypes; -import com.azure.management.compute.VirtualMachineExtension; -import com.azure.management.compute.VirtualMachineInstanceView; -import com.azure.management.compute.VirtualMachinePriorityTypes; -import com.azure.management.compute.VirtualMachineSize; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachineUnmanagedDataDisk; -import com.azure.management.compute.WinRMConfiguration; -import com.azure.management.compute.WinRMListener; -import com.azure.management.compute.WindowsConfiguration; -import com.azure.management.compute.models.ProximityPlacementGroupInner; -import com.azure.management.compute.models.VirtualMachineInner; -import com.azure.management.compute.models.VirtualMachineUpdateInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.BillingProfile; +import com.azure.management.compute.models.BootDiagnostics; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DataDisk; +import com.azure.management.compute.models.DiagnosticsProfile; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskCreateOptionTypes; +import com.azure.management.compute.models.DiskEncryptionSettings; +import com.azure.management.compute.models.HardwareProfile; +import com.azure.management.compute.models.ImageReference; +import com.azure.management.compute.models.InstanceViewTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.LinuxConfiguration; +import com.azure.management.compute.models.ManagedDiskParameters; +import com.azure.management.compute.models.NetworkInterfaceReference; +import com.azure.management.compute.models.OSDisk; +import com.azure.management.compute.models.OSProfile; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.Plan; +import com.azure.management.compute.models.PowerState; +import com.azure.management.compute.models.ProximityPlacementGroup; +import com.azure.management.compute.models.ProximityPlacementGroupType; +import com.azure.management.compute.models.PurchasePlan; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.RunCommandInput; +import com.azure.management.compute.models.RunCommandInputParameter; +import com.azure.management.compute.models.RunCommandResult; +import com.azure.management.compute.models.SshConfiguration; +import com.azure.management.compute.models.SshPublicKey; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.StorageProfile; +import com.azure.management.compute.models.VirtualHardDisk; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCaptureParameters; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineEncryption; +import com.azure.management.compute.models.VirtualMachineEvictionPolicyTypes; +import com.azure.management.compute.models.VirtualMachineExtension; +import com.azure.management.compute.models.VirtualMachineInstanceView; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachinePriorityTypes; +import com.azure.management.compute.models.VirtualMachineSize; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; +import com.azure.management.compute.models.WinRMConfiguration; +import com.azure.management.compute.models.WinRMListener; +import com.azure.management.compute.models.WindowsConfiguration; +import com.azure.management.compute.fluent.inner.ProximityPlacementGroupInner; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; +import com.azure.management.compute.fluent.inner.VirtualMachineUpdateInner; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.graphrbac.implementation.RoleAssignmentHelper; @@ -188,7 +190,7 @@ public JsonProperty.Access findPropertyAccess(Annotated annotated) { this.creatableSecondaryNetworkInterfaceKeys = new ArrayList<>(); this.existingSecondaryNetworkInterfacesToAssociate = new ArrayList<>(); this.virtualMachineExtensions = - new VirtualMachineExtensionsImpl(computeManager.inner().virtualMachineExtensions(), this); + new VirtualMachineExtensionsImpl(computeManager.inner().getVirtualMachineExtensions(), this); this.managedDataDisks = new ManagedDataDiskCollection(this); initializeDataDisks(); @@ -216,7 +218,8 @@ public Mono refreshAsync() { @Override protected Mono getInnerAsync() { - return this.manager().inner().virtualMachines().getByResourceGroupAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getVirtualMachines() + .getByResourceGroupAsync(this.resourceGroupName(), this.name()); } @Override @@ -229,7 +232,7 @@ public Mono deallocateAsync() { return this .manager() .inner() - .virtualMachines() + .getVirtualMachines() .deallocateAsync(this.resourceGroupName(), this.name()) // Refresh after deallocate to ensure the inner is updatable (due to a change in behavior in Managed Disks) .map(aVoid -> this.refreshAsync()) @@ -243,7 +246,7 @@ public void generalize() { @Override public Mono generalizeAsync() { - return this.manager().inner().virtualMachines().generalizeAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getVirtualMachines().generalizeAsync(this.resourceGroupName(), this.name()); } @Override @@ -253,7 +256,7 @@ public void powerOff() { @Override public Mono powerOffAsync() { - return this.manager().inner().virtualMachines().powerOffAsync(this.resourceGroupName(), this.name(), null); + return this.manager().inner().getVirtualMachines().powerOffAsync(this.resourceGroupName(), this.name(), null); } @Override @@ -263,7 +266,7 @@ public void restart() { @Override public Mono restartAsync() { - return this.manager().inner().virtualMachines().restartAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getVirtualMachines().restartAsync(this.resourceGroupName(), this.name()); } @Override @@ -273,7 +276,7 @@ public void start() { @Override public Mono startAsync() { - return this.manager().inner().virtualMachines().startAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getVirtualMachines().startAsync(this.resourceGroupName(), this.name()); } @Override @@ -283,12 +286,12 @@ public void redeploy() { @Override public Mono redeployAsync() { - return this.manager().inner().virtualMachines().redeployAsync(this.resourceGroupName(), this.name()); + return this.manager().inner().getVirtualMachines().redeployAsync(this.resourceGroupName(), this.name()); } @Override public void convertToManaged() { - this.manager().inner().virtualMachines().convertToManagedDisks(this.resourceGroupName(), this.name()); + this.manager().inner().getVirtualMachines().convertToManagedDisks(this.resourceGroupName(), this.name()); this.refresh(); } @@ -297,7 +300,7 @@ public Mono convertToManagedAsync() { return this .manager() .inner() - .virtualMachines() + .getVirtualMachines() .convertToManagedDisksAsync(this.resourceGroupName(), this.name()) .flatMap(aVoid -> refreshAsync()) .then(); @@ -313,7 +316,7 @@ public PagedIterable availableSizes() { return this .manager() .inner() - .virtualMachines() + .getVirtualMachines() .listAvailableSizes(this.resourceGroupName(), this.name()) .mapPage(VirtualMachineSizeImpl::new); } @@ -332,7 +335,7 @@ public Mono captureAsync(String containerName, String vhdPrefix, boolean return this .manager() .inner() - .virtualMachines() + .getVirtualMachines() .captureAsync(this.resourceGroupName(), this.name(), parameters) .map( captureResultInner -> { @@ -354,7 +357,7 @@ public Mono refreshInstanceViewAsync() { return this .manager() .inner() - .virtualMachines() + .getVirtualMachines() .getByResourceGroupAsync(this.resourceGroupName(), this.name(), InstanceViewTypes.INSTANCE_VIEW) .map( inner -> { @@ -421,21 +424,24 @@ public Mono runCommandAsync(RunCommandInput inputCommand) { @Override public VirtualMachineImpl withNewPrimaryNetwork(Creatable creatable) { this.nicDefinitionWithPrivateIp = - this.preparePrimaryNetworkInterface(this.namer.randomName("nic", 20)).withNewPrimaryNetwork(creatable); + this.preparePrimaryNetworkInterface(this.namer.randomName("nic", 20)) + .withNewPrimaryNetwork(creatable); return this; } @Override public VirtualMachineImpl withNewPrimaryNetwork(String addressSpace) { this.nicDefinitionWithPrivateIp = - this.preparePrimaryNetworkInterface(this.namer.randomName("nic", 20)).withNewPrimaryNetwork(addressSpace); + this.preparePrimaryNetworkInterface(this.namer.randomName("nic", 20)) + .withNewPrimaryNetwork(addressSpace); return this; } @Override public VirtualMachineImpl withExistingPrimaryNetwork(Network network) { this.nicDefinitionWithSubnet = - this.preparePrimaryNetworkInterface(this.namer.randomName("nic", 20)).withExistingPrimaryNetwork(network); + this.preparePrimaryNetworkInterface(this.namer.randomName("nic", 20)) + .withExistingPrimaryNetwork(network); return this; } @@ -1503,7 +1509,7 @@ public String licenseType() { public ProximityPlacementGroup proximityPlacementGroup() { ResourceId id = ResourceId.fromString(inner().proximityPlacementGroup().id()); ProximityPlacementGroupInner plgInner = - manager().inner().proximityPlacementGroups().getByResourceGroup(id.resourceGroupName(), id.name()); + manager().inner().getProximityPlacementGroups().getByResourceGroup(id.resourceGroupName(), id.name()); if (plgInner == null) { return null; } else { @@ -1691,7 +1697,7 @@ public Mono createResourceAsync() { return this .manager() .inner() - .virtualMachines() + .getVirtualMachines() .createOrUpdateAsync(resourceGroupName(), vmName, inner()) .map( virtualMachineInner -> { @@ -1734,7 +1740,7 @@ public Mono updateResourceAsync() { return this .manager() .inner() - .virtualMachines() + .getVirtualMachines() .updateAsync(resourceGroupName(), vmName, updateParameter) .map( virtualMachineInner -> { @@ -1951,7 +1957,7 @@ private Mono createNewProximityPlacementGroupAsync() { return this .manager() .inner() - .proximityPlacementGroups() + .getProximityPlacementGroups() .createOrUpdateAsync(this.resourceGroupName(), this.newProximityPlacementGroupName, plgInner) .map( createdPlgInner -> { @@ -2120,7 +2126,7 @@ private boolean isOSDiskFromPlatformImage(StorageProfile storageProfile) { /** * Checks whether the OS disk is based on a CustomImage. * - *

A custom image is represented by {@link com.azure.management.compute.VirtualMachineCustomImage}. + *

A custom image is represented by {@link VirtualMachineCustomImage}. * * @param storageProfile the storage profile * @return true if the OS disk is configured to be based on custom image. diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineInstanceViewImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineInstanceViewImpl.java index 09cc261681fe..3a628db2823e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineInstanceViewImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineInstanceViewImpl.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.BootDiagnosticsInstanceView; -import com.azure.management.compute.DiskInstanceView; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.MaintenanceRedeployStatus; -import com.azure.management.compute.VirtualMachineAgentInstanceView; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; -import com.azure.management.compute.VirtualMachineInstanceView; -import com.azure.management.compute.models.VirtualMachineInstanceViewInner; +import com.azure.management.compute.models.BootDiagnosticsInstanceView; +import com.azure.management.compute.models.DiskInstanceView; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.MaintenanceRedeployStatus; +import com.azure.management.compute.models.VirtualMachineAgentInstanceView; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.models.VirtualMachineInstanceView; +import com.azure.management.compute.fluent.inner.VirtualMachineInstanceViewInner; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineMsiHandler.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineMsiHandler.java index 81df0f0a4a79..20109ebbde63 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineMsiHandler.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineMsiHandler.java @@ -4,11 +4,11 @@ package com.azure.management.compute.implementation; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.ResourceIdentityType; -import com.azure.management.compute.VirtualMachineIdentity; -import com.azure.management.compute.VirtualMachineIdentityUserAssignedIdentities; -import com.azure.management.compute.models.VirtualMachineInner; -import com.azure.management.compute.models.VirtualMachineUpdateInner; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.VirtualMachineIdentity; +import com.azure.management.compute.models.VirtualMachineIdentityUserAssignedIdentities; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; +import com.azure.management.compute.fluent.inner.VirtualMachineUpdateInner; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.graphrbac.implementation.RoleAssignmentHelper; import com.azure.management.msi.Identity; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOfferImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOfferImpl.java index 83742d3fcd81..b18c6f065616 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOfferImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOfferImpl.java @@ -2,10 +2,10 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineOffer; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.VirtualMachineSkus; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.VirtualMachineOffer; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.models.VirtualMachineSkus; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.arm.Region; /** The implementation for {@link VirtualMachineOffer}. */ @@ -14,7 +14,7 @@ class VirtualMachineOfferImpl implements VirtualMachineOffer { private final String offerName; private final VirtualMachineSkusImpl skus; - VirtualMachineOfferImpl(VirtualMachinePublisher publisher, String offer, VirtualMachineImagesInner client) { + VirtualMachineOfferImpl(VirtualMachinePublisher publisher, String offer, VirtualMachineImagesClient client) { this.publisher = publisher; this.offerName = offer; this.skus = new VirtualMachineSkusImpl(this, client); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOffersImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOffersImpl.java index ae92ffde4a75..de5b4bdf3501 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOffersImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineOffersImpl.java @@ -4,11 +4,11 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineOffer; -import com.azure.management.compute.VirtualMachineOffers; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.models.VirtualMachineImageResourceInner; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.VirtualMachineOffer; +import com.azure.management.compute.models.VirtualMachineOffers; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.fluent.inner.VirtualMachineImageResourceInner; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; import com.azure.management.resources.fluentcore.utils.PagedConverter; @@ -17,10 +17,10 @@ class VirtualMachineOffersImpl extends ReadableWrappersImpl implements VirtualMachineOffers { - private final VirtualMachineImagesInner innerCollection; + private final VirtualMachineImagesClient innerCollection; private final VirtualMachinePublisher publisher; - VirtualMachineOffersImpl(VirtualMachineImagesInner innerCollection, VirtualMachinePublisher publisher) { + VirtualMachineOffersImpl(VirtualMachineImagesClient innerCollection, VirtualMachinePublisher publisher) { this.innerCollection = innerCollection; this.publisher = publisher; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublisherImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublisherImpl.java index d0860ff48647..770e0e1286ec 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublisherImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublisherImpl.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineExtensionImageTypes; -import com.azure.management.compute.VirtualMachineOffers; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.models.VirtualMachineExtensionImagesInner; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.VirtualMachineExtensionImageTypes; +import com.azure.management.compute.models.VirtualMachineOffers; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.fluent.VirtualMachineExtensionImagesClient; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.arm.Region; /** The implementation for {@link VirtualMachinePublisher}. */ @@ -19,8 +19,8 @@ class VirtualMachinePublisherImpl implements VirtualMachinePublisher { VirtualMachinePublisherImpl( Region location, String publisher, - VirtualMachineImagesInner imagesClient, - VirtualMachineExtensionImagesInner extensionsClient) { + VirtualMachineImagesClient imagesClient, + VirtualMachineExtensionImagesClient extensionsClient) { this.location = location; this.publisher = publisher; this.offers = new VirtualMachineOffersImpl(imagesClient, this); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublishersImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublishersImpl.java index 616391bddb25..4eaa6a25d13a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublishersImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinePublishersImpl.java @@ -4,26 +4,27 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.VirtualMachinePublishers; -import com.azure.management.compute.models.VirtualMachineExtensionImagesInner; -import com.azure.management.compute.models.VirtualMachineImageResourceInner; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.models.VirtualMachinePublishers; +import com.azure.management.compute.fluent.VirtualMachineExtensionImagesClient; +import com.azure.management.compute.fluent.inner.VirtualMachineImageResourceInner; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; import com.azure.management.resources.fluentcore.utils.PagedConverter; /** The implementation for {@link VirtualMachinePublishers}. */ -class VirtualMachinePublishersImpl +public class VirtualMachinePublishersImpl extends ReadableWrappersImpl implements VirtualMachinePublishers { - private final VirtualMachineImagesInner imagesInnerCollection; - private final VirtualMachineExtensionImagesInner extensionsInnerCollection; + private final VirtualMachineImagesClient imagesClientCollection; + private final VirtualMachineExtensionImagesClient extensionsInnerCollection; - VirtualMachinePublishersImpl( - VirtualMachineImagesInner imagesInnerCollection, VirtualMachineExtensionImagesInner extensionsInnerCollection) { - this.imagesInnerCollection = imagesInnerCollection; + public VirtualMachinePublishersImpl( + VirtualMachineImagesClient imagesClientCollection, + VirtualMachineExtensionImagesClient extensionsInnerCollection) { + this.imagesClientCollection = imagesClientCollection; this.extensionsInnerCollection = extensionsInnerCollection; } @@ -40,7 +41,7 @@ protected VirtualMachinePublisherImpl wrapModel(VirtualMachineImageResourceInner return new VirtualMachinePublisherImpl( Region.fromName(inner.location()), inner.name(), - this.imagesInnerCollection, + this.imagesClientCollection, this.extensionsInnerCollection); } @@ -57,7 +58,7 @@ public PagedFlux listByRegionAsync(Region region) { @Override public PagedFlux listByRegionAsync(String regionName) { return PagedConverter - .convertListToPagedFlux(imagesInnerCollection.listPublishersAsync(regionName)) + .convertListToPagedFlux(imagesClientCollection.listPublishersAsync(regionName)) .mapPage(this::wrapModel); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetExtensionImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetExtensionImpl.java index a697c5059f27..bed3377773b1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetExtensionImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetExtensionImpl.java @@ -2,10 +2,10 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineExtensionImage; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetExtension; -import com.azure.management.compute.models.VirtualMachineScaleSetExtensionInner; +import com.azure.management.compute.models.VirtualMachineExtensionImage; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetExtension; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetExtensionInner; import com.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java index 1cb6aaff54c6..c8c0b859dfbf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java @@ -7,56 +7,58 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.SubResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.AdditionalCapabilities; -import com.azure.management.compute.ApiEntityReference; -import com.azure.management.compute.BillingProfile; -import com.azure.management.compute.BootDiagnostics; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.DiagnosticsProfile; -import com.azure.management.compute.DiskCreateOptionTypes; -import com.azure.management.compute.ImageReference; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.LinuxConfiguration; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.ProximityPlacementGroup; -import com.azure.management.compute.ProximityPlacementGroupType; -import com.azure.management.compute.ResourceIdentityType; -import com.azure.management.compute.RunCommandInput; -import com.azure.management.compute.RunCommandInputParameter; -import com.azure.management.compute.RunCommandResult; -import com.azure.management.compute.SshConfiguration; -import com.azure.management.compute.SshPublicKey; -import com.azure.management.compute.StorageAccountTypes; -import com.azure.management.compute.UpgradeMode; -import com.azure.management.compute.UpgradePolicy; -import com.azure.management.compute.VaultSecretGroup; -import com.azure.management.compute.VirtualHardDisk; -import com.azure.management.compute.VirtualMachineEvictionPolicyTypes; -import com.azure.management.compute.VirtualMachinePriorityTypes; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetDataDisk; -import com.azure.management.compute.VirtualMachineScaleSetExtension; -import com.azure.management.compute.VirtualMachineScaleSetExtensionProfile; -import com.azure.management.compute.VirtualMachineScaleSetIpConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetManagedDiskParameters; -import com.azure.management.compute.VirtualMachineScaleSetNetworkConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetNetworkProfile; -import com.azure.management.compute.VirtualMachineScaleSetOSDisk; -import com.azure.management.compute.VirtualMachineScaleSetOSProfile; -import com.azure.management.compute.VirtualMachineScaleSetPublicIpAddressConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; -import com.azure.management.compute.VirtualMachineScaleSetSku; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; -import com.azure.management.compute.VirtualMachineScaleSetStorageProfile; -import com.azure.management.compute.VirtualMachineScaleSetUpdate; -import com.azure.management.compute.VirtualMachineScaleSetVMs; -import com.azure.management.compute.WinRMConfiguration; -import com.azure.management.compute.WinRMListener; -import com.azure.management.compute.WindowsConfiguration; -import com.azure.management.compute.models.ProximityPlacementGroupInner; -import com.azure.management.compute.models.VirtualMachineScaleSetExtensionInner; -import com.azure.management.compute.models.VirtualMachineScaleSetInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.AdditionalCapabilities; +import com.azure.management.compute.models.ApiEntityReference; +import com.azure.management.compute.models.BillingProfile; +import com.azure.management.compute.models.BootDiagnostics; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DiagnosticsProfile; +import com.azure.management.compute.models.DiskCreateOptionTypes; +import com.azure.management.compute.models.ImageReference; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.LinuxConfiguration; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.ProximityPlacementGroup; +import com.azure.management.compute.models.ProximityPlacementGroupType; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.RunCommandInput; +import com.azure.management.compute.models.RunCommandInputParameter; +import com.azure.management.compute.models.RunCommandResult; +import com.azure.management.compute.models.SshConfiguration; +import com.azure.management.compute.models.SshPublicKey; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.UpgradeMode; +import com.azure.management.compute.models.UpgradePolicy; +import com.azure.management.compute.models.VaultSecretGroup; +import com.azure.management.compute.models.VirtualHardDisk; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineEvictionPolicyTypes; +import com.azure.management.compute.models.VirtualMachinePriorityTypes; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetDataDisk; +import com.azure.management.compute.models.VirtualMachineScaleSetExtension; +import com.azure.management.compute.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.management.compute.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetOSDisk; +import com.azure.management.compute.models.VirtualMachineScaleSetOSProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.management.compute.models.VirtualMachineScaleSetSku; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.VirtualMachineScaleSetStorageProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdate; +import com.azure.management.compute.models.VirtualMachineScaleSetVMs; +import com.azure.management.compute.models.WinRMConfiguration; +import com.azure.management.compute.models.WinRMListener; +import com.azure.management.compute.models.WindowsConfiguration; +import com.azure.management.compute.fluent.inner.ProximityPlacementGroupInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetInner; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.graphrbac.implementation.RoleAssignmentHelper; @@ -187,7 +189,7 @@ protected void initializeChildrenFromInner() { @Override public VirtualMachineScaleSetVMs virtualMachines() { return new VirtualMachineScaleSetVMsImpl( - this, this.manager().inner().virtualMachineScaleSetVMs(), this.myManager); + this, this.manager().inner().getVirtualMachineScaleSetVMs(), this.myManager); } @Override @@ -195,7 +197,7 @@ public PagedIterable listAvailableSkus() { return this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .listSkus(this.resourceGroupName(), this.name()) .mapPage(VirtualMachineScaleSetSkuImpl::new); } @@ -210,7 +212,7 @@ public Mono deallocateAsync() { return this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .deallocateAsync(this.resourceGroupName(), this.name(), null) .map(aVoid -> this.refreshAsync()) .then(); @@ -226,7 +228,7 @@ public Mono powerOffAsync() { return this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .powerOffAsync(this.resourceGroupName(), this.name(), null, null); } @@ -240,7 +242,7 @@ public Mono restartAsync() { return this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .restartAsync(this.resourceGroupName(), this.name(), null); } @@ -251,7 +253,8 @@ public void start() { @Override public Mono startAsync() { - return this.manager().inner().virtualMachineScaleSets().startAsync(this.resourceGroupName(), this.name(), null); + return this.manager().inner().getVirtualMachineScaleSets() + .startAsync(this.resourceGroupName(), this.name(), null); } @Override @@ -264,7 +267,7 @@ public Mono reimageAsync() { return this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .reimageAsync(this.resourceGroupName(), this.name(), null); } @@ -564,7 +567,7 @@ public Boolean doNotRunExtensionsOnOverprovisionedVMs() { public ProximityPlacementGroup proximityPlacementGroup() { ResourceId id = ResourceId.fromString(inner().proximityPlacementGroup().id()); ProximityPlacementGroupInner plgInner = - manager().inner().proximityPlacementGroups().getByResourceGroup(id.resourceGroupName(), id.name()); + manager().inner().getProximityPlacementGroups().getByResourceGroup(id.resourceGroupName(), id.name()); if (plgInner == null) { return null; } else { @@ -1482,7 +1485,7 @@ protected Mono createInner() { return this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .createOrUpdateAsync(resourceGroupName(), name(), inner()); }); } @@ -1530,7 +1533,7 @@ public Mono updateResourceAsync() { this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .updateAsync(resourceGroupName(), name(), updateParameter) .map( vmssInner -> { @@ -1560,7 +1563,7 @@ protected Mono getInnerAsync() { return this .manager() .inner() - .virtualMachineScaleSets() + .getVirtualMachineScaleSets() .getByResourceGroupAsync(this.resourceGroupName(), this.name()); } @@ -2281,7 +2284,7 @@ private boolean isOSDiskFromImage(VirtualMachineScaleSetOSDisk osDisk) { /** * Checks whether the OS disk is based on a CustomImage. * - *

A custom image is represented by {@link com.azure.management.compute.VirtualMachineCustomImage}. + *

A custom image is represented by {@link VirtualMachineCustomImage}. * * @param storageProfile the storage profile * @return true if the OS disk is configured to be based on custom image. @@ -2617,7 +2620,7 @@ private void createNewProximityPlacementGroup() { this .manager() .inner() - .proximityPlacementGroups() + .getProximityPlacementGroups() .createOrUpdate(this.resourceGroupName(), this.newProximityPlacementGroupName, plgInner); this.inner().withProximityPlacementGroup((new SubResource().withId(plgInner.id()))); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java index cb26738a145f..9935df17fb47 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetMsiHandler.java @@ -4,11 +4,11 @@ package com.azure.management.compute.implementation; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.ResourceIdentityType; -import com.azure.management.compute.VirtualMachineScaleSetIdentity; -import com.azure.management.compute.VirtualMachineScaleSetIdentityUserAssignedIdentities; -import com.azure.management.compute.VirtualMachineScaleSetUpdate; -import com.azure.management.compute.models.VirtualMachineScaleSetInner; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.VirtualMachineScaleSetIdentity; +import com.azure.management.compute.models.VirtualMachineScaleSetIdentityUserAssignedIdentities; +import com.azure.management.compute.models.VirtualMachineScaleSetUpdate; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetInner; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.graphrbac.implementation.RoleAssignmentHelper; import com.azure.management.msi.Identity; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetSkuImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetSkuImpl.java index a56790f097e7..4a023a86607e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetSkuImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetSkuImpl.java @@ -2,10 +2,10 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineScaleSetSku; -import com.azure.management.compute.VirtualMachineScaleSetSkuCapacity; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; -import com.azure.management.compute.models.VirtualMachineScaleSetSkuInner; +import com.azure.management.compute.models.VirtualMachineScaleSetSku; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuCapacity; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetSkuInner; import com.azure.management.resources.fluentcore.model.implementation.WrapperImpl; /** Implementation of VirtualMachineScaleSetSku. */ diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetUnmanagedDataDiskImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetUnmanagedDataDiskImpl.java index 5eaec81cc934..f84e4c8e9124 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetUnmanagedDataDiskImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetUnmanagedDataDiskImpl.java @@ -3,11 +3,11 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.DiskCreateOptionTypes; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetDataDisk; -import com.azure.management.compute.VirtualMachineScaleSetUnmanagedDataDisk; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DiskCreateOptionTypes; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetDataDisk; +import com.azure.management.compute.models.VirtualMachineScaleSetUnmanagedDataDisk; import com.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; import java.util.ArrayList; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java index 548dd01fd40d..5660babe0d12 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMImpl.java @@ -5,37 +5,38 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.DataDisk; -import com.azure.management.compute.DiagnosticsProfile; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskCreateOptionTypes; -import com.azure.management.compute.DiskState; -import com.azure.management.compute.ImageReference; -import com.azure.management.compute.ManagedDiskParameters; -import com.azure.management.compute.NetworkInterfaceReference; -import com.azure.management.compute.OSProfile; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.PowerState; -import com.azure.management.compute.Sku; -import com.azure.management.compute.StorageAccountTypes; -import com.azure.management.compute.StorageProfile; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineImage; -import com.azure.management.compute.VirtualMachineInstanceView; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetVM; -import com.azure.management.compute.VirtualMachineScaleSetVMInstanceExtension; -import com.azure.management.compute.VirtualMachineScaleSetVMNetworkProfileConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetVMProtectionPolicy; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachineUnmanagedDataDisk; -import com.azure.management.compute.models.VirtualMachineExtensionInner; -import com.azure.management.compute.models.VirtualMachineInstanceViewInner; -import com.azure.management.compute.models.VirtualMachineScaleSetVMInner; -import com.azure.management.compute.models.VirtualMachineScaleSetVMInstanceViewInner; -import com.azure.management.compute.models.VirtualMachineScaleSetVMsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DataDisk; +import com.azure.management.compute.models.DiagnosticsProfile; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskCreateOptionTypes; +import com.azure.management.compute.models.DiskState; +import com.azure.management.compute.models.ImageReference; +import com.azure.management.compute.models.ManagedDiskParameters; +import com.azure.management.compute.models.NetworkInterfaceReference; +import com.azure.management.compute.models.OSProfile; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.PowerState; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.StorageProfile; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineInstanceView; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetVM; +import com.azure.management.compute.models.VirtualMachineScaleSetVMInstanceExtension; +import com.azure.management.compute.models.VirtualMachineScaleSetVMNetworkProfileConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetVMProtectionPolicy; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineInstanceViewInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetVMInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetVMInstanceViewInner; +import com.azure.management.compute.fluent.VirtualMachineScaleSetVMsClient; import com.azure.management.network.VirtualMachineScaleSetNetworkInterface; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; @@ -56,7 +57,7 @@ class VirtualMachineScaleSetVMImpl implements VirtualMachineScaleSetVM, VirtualMachineScaleSetVM.Update { private VirtualMachineInstanceView virtualMachineInstanceView; - private final VirtualMachineScaleSetVMsInner client; + private final VirtualMachineScaleSetVMsClient client; private final ComputeManager computeManager; private final ClientLogger logger = new ClientLogger(VirtualMachineScaleSetVMImpl.class); @@ -66,7 +67,7 @@ class VirtualMachineScaleSetVMImpl VirtualMachineScaleSetVMImpl( VirtualMachineScaleSetVMInner inner, final VirtualMachineScaleSetImpl parent, - final VirtualMachineScaleSetVMsInner client, + final VirtualMachineScaleSetVMsClient client, final ComputeManager computeManager) { super(inner, parent); this.client = client; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceExtensionImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceExtensionImpl.java index 93272d6c30f5..8bc7eaf59d4c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceExtensionImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMInstanceExtensionImpl.java @@ -2,10 +2,10 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineExtensionInstanceView; -import com.azure.management.compute.VirtualMachineScaleSetVM; -import com.azure.management.compute.VirtualMachineScaleSetVMInstanceExtension; -import com.azure.management.compute.models.VirtualMachineExtensionInner; +import com.azure.management.compute.models.VirtualMachineExtensionInstanceView; +import com.azure.management.compute.models.VirtualMachineScaleSetVM; +import com.azure.management.compute.models.VirtualMachineScaleSetVMInstanceExtension; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; import com.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; import java.util.Collections; import java.util.HashMap; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMsImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMsImpl.java index 1b167823db6f..8949f519be51 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMsImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetVMsImpl.java @@ -4,11 +4,12 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineScaleSetVM; -import com.azure.management.compute.VirtualMachineScaleSetVMs; -import com.azure.management.compute.models.VirtualMachineScaleSetVMInner; -import com.azure.management.compute.models.VirtualMachineScaleSetVMsInner; -import com.azure.management.compute.models.VirtualMachineScaleSetsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.VirtualMachineScaleSetVM; +import com.azure.management.compute.models.VirtualMachineScaleSetVMs; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetVMInner; +import com.azure.management.compute.fluent.VirtualMachineScaleSetVMsClient; +import com.azure.management.compute.fluent.VirtualMachineScaleSetsClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; import java.util.ArrayList; import java.util.Arrays; @@ -22,11 +23,11 @@ class VirtualMachineScaleSetVMsImpl implements VirtualMachineScaleSetVMs { private final VirtualMachineScaleSetImpl scaleSet; - private final VirtualMachineScaleSetVMsInner client; + private final VirtualMachineScaleSetVMsClient client; private final ComputeManager computeManager; VirtualMachineScaleSetVMsImpl( - VirtualMachineScaleSetImpl scaleSet, VirtualMachineScaleSetVMsInner client, ComputeManager computeManager) { + VirtualMachineScaleSetImpl scaleSet, VirtualMachineScaleSetVMsClient client, ComputeManager computeManager) { this.scaleSet = scaleSet; this.client = client; this.computeManager = computeManager; @@ -46,7 +47,7 @@ public PagedIterable list() { } @Override - public VirtualMachineScaleSetVMsInner inner() { + public VirtualMachineScaleSetVMsClient inner() { return this.client; } @@ -64,7 +65,7 @@ public Mono deleteInstancesAsync(Collection instanceIds) { for (String instanceId : instanceIds) { instanceIdList.add(instanceId); } - VirtualMachineScaleSetsInner scaleSetInnerManager = this.scaleSet.manager().virtualMachineScaleSets().inner(); + VirtualMachineScaleSetsClient scaleSetInnerManager = this.scaleSet.manager().virtualMachineScaleSets().inner(); return scaleSetInnerManager .deleteInstancesAsync(this.scaleSet.resourceGroupName(), this.scaleSet.name(), instanceIdList); } @@ -101,7 +102,7 @@ public Mono updateInstancesAsync(Collection instanceIds) { for (String instanceId : instanceIds) { instanceIdList.add(instanceId); } - VirtualMachineScaleSetsInner scaleSetInnerManager = this.scaleSet.manager().virtualMachineScaleSets().inner(); + VirtualMachineScaleSetsClient scaleSetInnerManager = this.scaleSet.manager().virtualMachineScaleSets().inner(); return scaleSetInnerManager .updateInstancesAsync(this.scaleSet.resourceGroupName(), this.scaleSet.name(), instanceIdList); } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java index 52c3d0714508..b9b2c1c68775 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java @@ -2,20 +2,21 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.RunCommandInput; -import com.azure.management.compute.RunCommandInputParameter; -import com.azure.management.compute.RunCommandResult; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetIpConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetNetworkConfiguration; -import com.azure.management.compute.VirtualMachineScaleSetNetworkProfile; -import com.azure.management.compute.VirtualMachineScaleSetOSDisk; -import com.azure.management.compute.VirtualMachineScaleSetOSProfile; -import com.azure.management.compute.VirtualMachineScaleSetStorageProfile; -import com.azure.management.compute.VirtualMachineScaleSetVMProfile; -import com.azure.management.compute.VirtualMachineScaleSets; -import com.azure.management.compute.models.VirtualMachineScaleSetInner; -import com.azure.management.compute.models.VirtualMachineScaleSetsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.RunCommandInput; +import com.azure.management.compute.models.RunCommandInputParameter; +import com.azure.management.compute.models.RunCommandResult; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetOSDisk; +import com.azure.management.compute.models.VirtualMachineScaleSetOSProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetStorageProfile; +import com.azure.management.compute.models.VirtualMachineScaleSetVMProfile; +import com.azure.management.compute.models.VirtualMachineScaleSets; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetInner; +import com.azure.management.compute.fluent.VirtualMachineScaleSetsClient; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.network.implementation.NetworkManager; import com.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; @@ -30,19 +31,19 @@ public class VirtualMachineScaleSetsImpl VirtualMachineScaleSet, VirtualMachineScaleSetImpl, VirtualMachineScaleSetInner, - VirtualMachineScaleSetsInner, - ComputeManager> + VirtualMachineScaleSetsClient, + ComputeManager> implements VirtualMachineScaleSets { private final StorageManager storageManager; private final NetworkManager networkManager; private final GraphRbacManager rbacManager; - VirtualMachineScaleSetsImpl( + public VirtualMachineScaleSetsImpl( ComputeManager computeManager, StorageManager storageManager, NetworkManager networkManager, GraphRbacManager rbacManager) { - super(computeManager.inner().virtualMachineScaleSets(), computeManager); + super(computeManager.inner().getVirtualMachineScaleSets(), computeManager); this.storageManager = storageManager; this.networkManager = networkManager; this.rbacManager = rbacManager; @@ -162,7 +163,7 @@ public Mono runCommandVMInstanceAsync( return this .manager() .inner() - .virtualMachineScaleSetVMs() + .getVirtualMachineScaleSetVMs() .runCommandAsync(groupName, scaleSetName, vmId, inputCommand) .map(RunCommandResultImpl::new); } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizeImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizeImpl.java index d42c9fa31314..31f6b4cbee2d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizeImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizeImpl.java @@ -2,8 +2,8 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.VirtualMachineSize; -import com.azure.management.compute.models.VirtualMachineSizeInner; +import com.azure.management.compute.models.VirtualMachineSize; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeInner; import com.azure.management.resources.fluentcore.utils.Utils; /** The implementation for {@link VirtualMachineSize}. */ diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizesImpl.java index 6a0d8c85a5c5..a5c3cded62d9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSizesImpl.java @@ -4,10 +4,10 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineSize; -import com.azure.management.compute.VirtualMachineSizes; -import com.azure.management.compute.models.VirtualMachineSizeInner; -import com.azure.management.compute.models.VirtualMachineSizesInner; +import com.azure.management.compute.models.VirtualMachineSize; +import com.azure.management.compute.models.VirtualMachineSizes; +import com.azure.management.compute.fluent.inner.VirtualMachineSizeInner; +import com.azure.management.compute.fluent.VirtualMachineSizesClient; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; @@ -15,9 +15,9 @@ class VirtualMachineSizesImpl extends ReadableWrappersImpl implements VirtualMachineSizes { - private final VirtualMachineSizesInner innerCollection; + private final VirtualMachineSizesClient innerCollection; - VirtualMachineSizesImpl(VirtualMachineSizesInner innerCollection) { + VirtualMachineSizesImpl(VirtualMachineSizesClient innerCollection) { this.innerCollection = innerCollection; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkuImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkuImpl.java index baa1a4ee7ea0..bc9a234ddac1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkuImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkuImpl.java @@ -2,12 +2,12 @@ // Licensed under the MIT License. package com.azure.management.compute.implementation; -import com.azure.management.compute.Sku; -import com.azure.management.compute.VirtualMachineImagesInSku; -import com.azure.management.compute.VirtualMachineOffer; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.VirtualMachineSku; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.VirtualMachineImagesInSku; +import com.azure.management.compute.models.VirtualMachineOffer; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.models.VirtualMachineSku; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.arm.Region; /** The implementation for {@link Sku}. */ @@ -16,7 +16,7 @@ class VirtualMachineSkuImpl implements VirtualMachineSku { private final String skuName; private final VirtualMachineImagesInSku imagesInSku; - VirtualMachineSkuImpl(VirtualMachineOffer offer, String skuName, VirtualMachineImagesInner client) { + VirtualMachineSkuImpl(VirtualMachineOffer offer, String skuName, VirtualMachineImagesClient client) { this.offer = offer; this.skuName = skuName; this.imagesInSku = new VirtualMachineImagesInSkuImpl(this, client); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkusImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkusImpl.java index 53ce424c3f9e..71f0272d0ecf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkusImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachineSkusImpl.java @@ -4,11 +4,11 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.VirtualMachineOffer; -import com.azure.management.compute.VirtualMachineSku; -import com.azure.management.compute.VirtualMachineSkus; -import com.azure.management.compute.models.VirtualMachineImageResourceInner; -import com.azure.management.compute.models.VirtualMachineImagesInner; +import com.azure.management.compute.models.VirtualMachineOffer; +import com.azure.management.compute.models.VirtualMachineSku; +import com.azure.management.compute.models.VirtualMachineSkus; +import com.azure.management.compute.fluent.inner.VirtualMachineImageResourceInner; +import com.azure.management.compute.fluent.VirtualMachineImagesClient; import com.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl; import com.azure.management.resources.fluentcore.utils.PagedConverter; @@ -17,10 +17,10 @@ class VirtualMachineSkusImpl extends ReadableWrappersImpl implements VirtualMachineSkus { - private final VirtualMachineImagesInner innerCollection; + private final VirtualMachineImagesClient innerCollection; private final VirtualMachineOffer offer; - VirtualMachineSkusImpl(VirtualMachineOffer offer, VirtualMachineImagesInner innerCollection) { + VirtualMachineSkusImpl(VirtualMachineOffer offer, VirtualMachineImagesClient innerCollection) { this.innerCollection = innerCollection; this.offer = offer; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinesImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinesImpl.java index 0c0918ec11a9..aba52c6975fa 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinesImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/VirtualMachinesImpl.java @@ -3,20 +3,21 @@ package com.azure.management.compute.implementation; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.HardwareProfile; -import com.azure.management.compute.NetworkProfile; -import com.azure.management.compute.OSDisk; -import com.azure.management.compute.OSProfile; -import com.azure.management.compute.RunCommandInput; -import com.azure.management.compute.RunCommandInputParameter; -import com.azure.management.compute.RunCommandResult; -import com.azure.management.compute.StorageProfile; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineCaptureParameters; -import com.azure.management.compute.VirtualMachineSizes; -import com.azure.management.compute.VirtualMachines; -import com.azure.management.compute.models.VirtualMachineInner; -import com.azure.management.compute.models.VirtualMachinesInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.HardwareProfile; +import com.azure.management.compute.models.NetworkProfile; +import com.azure.management.compute.models.OSDisk; +import com.azure.management.compute.models.OSProfile; +import com.azure.management.compute.models.RunCommandInput; +import com.azure.management.compute.models.RunCommandInputParameter; +import com.azure.management.compute.models.RunCommandResult; +import com.azure.management.compute.models.StorageProfile; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCaptureParameters; +import com.azure.management.compute.models.VirtualMachineSizes; +import com.azure.management.compute.models.VirtualMachines; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; +import com.azure.management.compute.fluent.VirtualMachinesClient; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.network.implementation.NetworkManager; import com.azure.management.resources.fluentcore.arm.collection.implementation.TopLevelModifiableResourcesImpl; @@ -29,9 +30,9 @@ import reactor.core.publisher.Mono; /** The implementation for VirtualMachines. */ -class VirtualMachinesImpl +public class VirtualMachinesImpl extends TopLevelModifiableResourcesImpl< - VirtualMachine, VirtualMachineImpl, VirtualMachineInner, VirtualMachinesInner, ComputeManager> + VirtualMachine, VirtualMachineImpl, VirtualMachineInner, VirtualMachinesClient, ComputeManager> implements VirtualMachines { private final StorageManager storageManager; private final NetworkManager networkManager; @@ -39,16 +40,16 @@ class VirtualMachinesImpl private final VirtualMachineSizesImpl vmSizes; private final ClientLogger logger = new ClientLogger(VirtualMachinesImpl.class); - VirtualMachinesImpl( + public VirtualMachinesImpl( ComputeManager computeManager, StorageManager storageManager, NetworkManager networkManager, GraphRbacManager rbacManager) { - super(computeManager.inner().virtualMachines(), computeManager); + super(computeManager.inner().getVirtualMachines(), computeManager); this.storageManager = storageManager; this.networkManager = networkManager; this.rbacManager = rbacManager; - this.vmSizes = new VirtualMachineSizesImpl(computeManager.inner().virtualMachineSizes()); + this.vmSizes = new VirtualMachineSizesImpl(computeManager.inner().getVirtualMachineSizes()); } // Actions diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeLegacyEncryptionMonitorImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeLegacyEncryptionMonitorImpl.java index 81869d45841a..e24100eb4112 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeLegacyEncryptionMonitorImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeLegacyEncryptionMonitorImpl.java @@ -3,13 +3,14 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.DiskEncryptionSettings; -import com.azure.management.compute.DiskVolumeEncryptionMonitor; -import com.azure.management.compute.EncryptionStatus; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.models.VirtualMachineExtensionInner; -import com.azure.management.compute.models.VirtualMachineInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.DiskEncryptionSettings; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.EncryptionStatus; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import com.azure.management.resources.fluentcore.utils.Utils; import java.util.HashMap; @@ -150,7 +151,7 @@ private Mono retrieveVirtualMachineAsync() { return this .computeManager .inner() - .virtualMachines() + .getVirtualMachines() .getByResourceGroupAsync(rgName, vmName) .onErrorResume( e -> diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeNoAADEncryptionMonitorImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeNoAADEncryptionMonitorImpl.java index 9151a6d4cbab..9bd1538de213 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeNoAADEncryptionMonitorImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/implementation/WindowsVolumeNoAADEncryptionMonitorImpl.java @@ -3,12 +3,13 @@ package com.azure.management.compute.implementation; -import com.azure.management.compute.DiskInstanceView; -import com.azure.management.compute.DiskVolumeEncryptionMonitor; -import com.azure.management.compute.EncryptionStatus; -import com.azure.management.compute.InstanceViewStatus; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.models.VirtualMachineInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.models.DiskInstanceView; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.EncryptionStatus; +import com.azure.management.compute.models.InstanceViewStatus; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; import com.azure.management.resources.fluentcore.arm.ResourceUtils; import reactor.core.publisher.Mono; @@ -153,7 +154,7 @@ private Mono retrieveVirtualMachineAsync() { return this .computeManager .inner() - .virtualMachines() + .getVirtualMachines() .getByResourceGroupAsync(rgName, vmName) .onErrorResume( e -> diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AccessLevel.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AccessLevel.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AccessLevel.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AccessLevel.java index b5e05efc51bb..4ad8959f29cd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AccessLevel.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AccessLevel.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AdditionalCapabilities.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AdditionalCapabilities.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AdditionalCapabilities.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AdditionalCapabilities.java index 3d7b6d366a46..43f40534003c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AdditionalCapabilities.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AdditionalCapabilities.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AdditionalUnattendContent.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AdditionalUnattendContent.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AdditionalUnattendContent.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AdditionalUnattendContent.java index e5023e753e12..99e02c74ea8f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AdditionalUnattendContent.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AdditionalUnattendContent.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AggregatedReplicationState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AggregatedReplicationState.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AggregatedReplicationState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AggregatedReplicationState.java index b904bb3c375f..5ec58a42261e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AggregatedReplicationState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AggregatedReplicationState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiEntityReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiEntityReference.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiEntityReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiEntityReference.java index 4db276b7585b..780afe57308b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiEntityReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiEntityReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiError.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiError.java similarity index 90% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiError.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiError.java index e3b51cb16281..caaa702055ec 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiError.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiError.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; @@ -36,8 +36,5 @@ public InnerError getInnererror() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innererror != null) { - innererror.validate(); - } } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiErrorException.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiErrorException.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiErrorException.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiErrorException.java index db2bd6bfba94..659ca6fd1a0c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ApiErrorException.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ApiErrorException.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.http.HttpResponse; import com.azure.core.management.exception.ManagementException; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticOSUpgradePolicy.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticOSUpgradePolicy.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticOSUpgradePolicy.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticOSUpgradePolicy.java index 5ea6b14ced30..44c3ea7f9131 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticOSUpgradePolicy.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticOSUpgradePolicy.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticOSUpgradeProperties.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticOSUpgradeProperties.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticOSUpgradeProperties.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticOSUpgradeProperties.java index e536447f86bb..cdc987c44a44 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticOSUpgradeProperties.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticOSUpgradeProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticRepairsPolicy.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticRepairsPolicy.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticRepairsPolicy.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticRepairsPolicy.java index 63c2c8c6ffa6..fe513c17b3d4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AutomaticRepairsPolicy.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AutomaticRepairsPolicy.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySet.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySet.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySet.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySet.java index ba1416434d81..057f0d5ace89 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySet.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySet.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.AvailabilitySetInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.AvailabilitySetInner; import com.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.azure.management.resources.fluentcore.arm.models.Resource; import com.azure.management.resources.fluentcore.model.Appliable; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySetSkuTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetSkuTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySetSkuTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetSkuTypes.java index abfbf75b1108..b7d7ba9c948c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySetSkuTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetSkuTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySetUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySetUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetUpdate.java index a48b8136ebd9..b940a796da0d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySetUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySetUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySets.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySets.java similarity index 87% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySets.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySets.java index b84864801d91..1d7010167e7b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/AvailabilitySets.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/AvailabilitySets.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.AvailabilitySetsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.AvailabilitySetsClient; import com.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; @@ -29,5 +29,5 @@ public interface AvailabilitySets SupportsDeletingByResourceGroup, SupportsBatchCreation, HasManager, - HasInner { + HasInner { } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/BillingProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BillingProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/BillingProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BillingProfile.java index 193703421783..5bec6970c1a2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/BillingProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BillingProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/BootDiagnostics.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BootDiagnostics.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/BootDiagnostics.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BootDiagnostics.java index 3e5f0f679b8f..2f4775b0bf74 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/BootDiagnostics.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BootDiagnostics.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/BootDiagnosticsInstanceView.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BootDiagnosticsInstanceView.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/BootDiagnosticsInstanceView.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BootDiagnosticsInstanceView.java index 96b872252219..fd3566930336 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/BootDiagnosticsInstanceView.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/BootDiagnosticsInstanceView.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CachingTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CachingTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/CachingTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CachingTypes.java index 1475c4019c21..e1e46a2aed5b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CachingTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CachingTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComponentNames.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComponentNames.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComponentNames.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComponentNames.java index 6028d20321ff..0fd40cb6ac1c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComponentNames.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComponentNames.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeManagementClientImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeManagementClientImpl.java deleted file mode 100644 index cd3eaa2cb1e6..000000000000 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeManagementClientImpl.java +++ /dev/null @@ -1,473 +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.management.compute.models; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.util.logging.ClientLogger; -import com.azure.management.AzureServiceClient; - -/** Initializes a new instance of the ComputeManagementClientImpl type. */ -public final class ComputeManagementClientImpl extends AzureServiceClient { - private final ClientLogger logger = new ClientLogger(ComputeManagementClientImpl.class); - - /** - * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of - * the URI for every service call. - */ - private String subscriptionId; - - /** - * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @param subscriptionId the subscriptionId value. - * @return the service client itself. - */ - public ComputeManagementClientImpl setSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** server parameter. */ - private String host; - - /** - * Gets server parameter. - * - * @return the host value. - */ - public String getHost() { - return this.host; - } - - /** - * Sets server parameter. - * - * @param host the host value. - * @return the service client itself. - */ - public ComputeManagementClientImpl setHost(String host) { - this.host = host; - return this; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The OperationsInner object to access its operations. */ - private final OperationsInner operations; - - /** - * Gets the OperationsInner object to access its operations. - * - * @return the OperationsInner object. - */ - public OperationsInner operations() { - return this.operations; - } - - /** The AvailabilitySetsInner object to access its operations. */ - private final AvailabilitySetsInner availabilitySets; - - /** - * Gets the AvailabilitySetsInner object to access its operations. - * - * @return the AvailabilitySetsInner object. - */ - public AvailabilitySetsInner availabilitySets() { - return this.availabilitySets; - } - - /** The ProximityPlacementGroupsInner object to access its operations. */ - private final ProximityPlacementGroupsInner proximityPlacementGroups; - - /** - * Gets the ProximityPlacementGroupsInner object to access its operations. - * - * @return the ProximityPlacementGroupsInner object. - */ - public ProximityPlacementGroupsInner proximityPlacementGroups() { - return this.proximityPlacementGroups; - } - - /** The DedicatedHostGroupsInner object to access its operations. */ - private final DedicatedHostGroupsInner dedicatedHostGroups; - - /** - * Gets the DedicatedHostGroupsInner object to access its operations. - * - * @return the DedicatedHostGroupsInner object. - */ - public DedicatedHostGroupsInner dedicatedHostGroups() { - return this.dedicatedHostGroups; - } - - /** The DedicatedHostsInner object to access its operations. */ - private final DedicatedHostsInner dedicatedHosts; - - /** - * Gets the DedicatedHostsInner object to access its operations. - * - * @return the DedicatedHostsInner object. - */ - public DedicatedHostsInner dedicatedHosts() { - return this.dedicatedHosts; - } - - /** The VirtualMachineExtensionImagesInner object to access its operations. */ - private final VirtualMachineExtensionImagesInner virtualMachineExtensionImages; - - /** - * Gets the VirtualMachineExtensionImagesInner object to access its operations. - * - * @return the VirtualMachineExtensionImagesInner object. - */ - public VirtualMachineExtensionImagesInner virtualMachineExtensionImages() { - return this.virtualMachineExtensionImages; - } - - /** The VirtualMachineExtensionsInner object to access its operations. */ - private final VirtualMachineExtensionsInner virtualMachineExtensions; - - /** - * Gets the VirtualMachineExtensionsInner object to access its operations. - * - * @return the VirtualMachineExtensionsInner object. - */ - public VirtualMachineExtensionsInner virtualMachineExtensions() { - return this.virtualMachineExtensions; - } - - /** The VirtualMachineImagesInner object to access its operations. */ - private final VirtualMachineImagesInner virtualMachineImages; - - /** - * Gets the VirtualMachineImagesInner object to access its operations. - * - * @return the VirtualMachineImagesInner object. - */ - public VirtualMachineImagesInner virtualMachineImages() { - return this.virtualMachineImages; - } - - /** The UsagesInner object to access its operations. */ - private final UsagesInner usages; - - /** - * Gets the UsagesInner object to access its operations. - * - * @return the UsagesInner object. - */ - public UsagesInner usages() { - return this.usages; - } - - /** The VirtualMachinesInner object to access its operations. */ - private final VirtualMachinesInner virtualMachines; - - /** - * Gets the VirtualMachinesInner object to access its operations. - * - * @return the VirtualMachinesInner object. - */ - public VirtualMachinesInner virtualMachines() { - return this.virtualMachines; - } - - /** The VirtualMachineSizesInner object to access its operations. */ - private final VirtualMachineSizesInner virtualMachineSizes; - - /** - * Gets the VirtualMachineSizesInner object to access its operations. - * - * @return the VirtualMachineSizesInner object. - */ - public VirtualMachineSizesInner virtualMachineSizes() { - return this.virtualMachineSizes; - } - - /** The ImagesInner object to access its operations. */ - private final ImagesInner images; - - /** - * Gets the ImagesInner object to access its operations. - * - * @return the ImagesInner object. - */ - public ImagesInner images() { - return this.images; - } - - /** The VirtualMachineScaleSetsInner object to access its operations. */ - private final VirtualMachineScaleSetsInner virtualMachineScaleSets; - - /** - * Gets the VirtualMachineScaleSetsInner object to access its operations. - * - * @return the VirtualMachineScaleSetsInner object. - */ - public VirtualMachineScaleSetsInner virtualMachineScaleSets() { - return this.virtualMachineScaleSets; - } - - /** The VirtualMachineScaleSetExtensionsInner object to access its operations. */ - private final VirtualMachineScaleSetExtensionsInner virtualMachineScaleSetExtensions; - - /** - * Gets the VirtualMachineScaleSetExtensionsInner object to access its operations. - * - * @return the VirtualMachineScaleSetExtensionsInner object. - */ - public VirtualMachineScaleSetExtensionsInner virtualMachineScaleSetExtensions() { - return this.virtualMachineScaleSetExtensions; - } - - /** The VirtualMachineScaleSetRollingUpgradesInner object to access its operations. */ - private final VirtualMachineScaleSetRollingUpgradesInner virtualMachineScaleSetRollingUpgrades; - - /** - * Gets the VirtualMachineScaleSetRollingUpgradesInner object to access its operations. - * - * @return the VirtualMachineScaleSetRollingUpgradesInner object. - */ - public VirtualMachineScaleSetRollingUpgradesInner virtualMachineScaleSetRollingUpgrades() { - return this.virtualMachineScaleSetRollingUpgrades; - } - - /** The VirtualMachineScaleSetVMsInner object to access its operations. */ - private final VirtualMachineScaleSetVMsInner virtualMachineScaleSetVMs; - - /** - * Gets the VirtualMachineScaleSetVMsInner object to access its operations. - * - * @return the VirtualMachineScaleSetVMsInner object. - */ - public VirtualMachineScaleSetVMsInner virtualMachineScaleSetVMs() { - return this.virtualMachineScaleSetVMs; - } - - /** The LogAnalyticsInner object to access its operations. */ - private final LogAnalyticsInner logAnalytics; - - /** - * Gets the LogAnalyticsInner object to access its operations. - * - * @return the LogAnalyticsInner object. - */ - public LogAnalyticsInner logAnalytics() { - return this.logAnalytics; - } - - /** The VirtualMachineRunCommandsInner object to access its operations. */ - private final VirtualMachineRunCommandsInner virtualMachineRunCommands; - - /** - * Gets the VirtualMachineRunCommandsInner object to access its operations. - * - * @return the VirtualMachineRunCommandsInner object. - */ - public VirtualMachineRunCommandsInner virtualMachineRunCommands() { - return this.virtualMachineRunCommands; - } - - /** The ResourceSkusInner object to access its operations. */ - private final ResourceSkusInner resourceSkus; - - /** - * Gets the ResourceSkusInner object to access its operations. - * - * @return the ResourceSkusInner object. - */ - public ResourceSkusInner resourceSkus() { - return this.resourceSkus; - } - - /** The DisksInner object to access its operations. */ - private final DisksInner disks; - - /** - * Gets the DisksInner object to access its operations. - * - * @return the DisksInner object. - */ - public DisksInner disks() { - return this.disks; - } - - /** The SnapshotsInner object to access its operations. */ - private final SnapshotsInner snapshots; - - /** - * Gets the SnapshotsInner object to access its operations. - * - * @return the SnapshotsInner object. - */ - public SnapshotsInner snapshots() { - return this.snapshots; - } - - /** The DiskEncryptionSetsInner object to access its operations. */ - private final DiskEncryptionSetsInner diskEncryptionSets; - - /** - * Gets the DiskEncryptionSetsInner object to access its operations. - * - * @return the DiskEncryptionSetsInner object. - */ - public DiskEncryptionSetsInner diskEncryptionSets() { - return this.diskEncryptionSets; - } - - /** The GalleriesInner object to access its operations. */ - private final GalleriesInner galleries; - - /** - * Gets the GalleriesInner object to access its operations. - * - * @return the GalleriesInner object. - */ - public GalleriesInner galleries() { - return this.galleries; - } - - /** The GalleryImagesInner object to access its operations. */ - private final GalleryImagesInner galleryImages; - - /** - * Gets the GalleryImagesInner object to access its operations. - * - * @return the GalleryImagesInner object. - */ - public GalleryImagesInner galleryImages() { - return this.galleryImages; - } - - /** The GalleryImageVersionsInner object to access its operations. */ - private final GalleryImageVersionsInner galleryImageVersions; - - /** - * Gets the GalleryImageVersionsInner object to access its operations. - * - * @return the GalleryImageVersionsInner object. - */ - public GalleryImageVersionsInner galleryImageVersions() { - return this.galleryImageVersions; - } - - /** The GalleryApplicationsInner object to access its operations. */ - private final GalleryApplicationsInner galleryApplications; - - /** - * Gets the GalleryApplicationsInner object to access its operations. - * - * @return the GalleryApplicationsInner object. - */ - public GalleryApplicationsInner galleryApplications() { - return this.galleryApplications; - } - - /** The GalleryApplicationVersionsInner object to access its operations. */ - private final GalleryApplicationVersionsInner galleryApplicationVersions; - - /** - * Gets the GalleryApplicationVersionsInner object to access its operations. - * - * @return the GalleryApplicationVersionsInner object. - */ - public GalleryApplicationVersionsInner galleryApplicationVersions() { - return this.galleryApplicationVersions; - } - - /** The ContainerServicesInner object to access its operations. */ - private final ContainerServicesInner containerServices; - - /** - * Gets the ContainerServicesInner object to access its operations. - * - * @return the ContainerServicesInner object. - */ - public ContainerServicesInner containerServices() { - return this.containerServices; - } - - /** Initializes an instance of ComputeManagementClient client. */ - public ComputeManagementClientImpl() { - this( - new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build(), - AzureEnvironment.AZURE); - } - - /** - * Initializes an instance of ComputeManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - */ - public ComputeManagementClientImpl(HttpPipeline httpPipeline) { - this(httpPipeline, AzureEnvironment.AZURE); - } - - /** - * Initializes an instance of ComputeManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param environment The Azure environment. - */ - public ComputeManagementClientImpl(HttpPipeline httpPipeline, AzureEnvironment environment) { - super(httpPipeline, environment); - this.httpPipeline = httpPipeline; - this.operations = new OperationsInner(this); - this.availabilitySets = new AvailabilitySetsInner(this); - this.proximityPlacementGroups = new ProximityPlacementGroupsInner(this); - this.dedicatedHostGroups = new DedicatedHostGroupsInner(this); - this.dedicatedHosts = new DedicatedHostsInner(this); - this.virtualMachineExtensionImages = new VirtualMachineExtensionImagesInner(this); - this.virtualMachineExtensions = new VirtualMachineExtensionsInner(this); - this.virtualMachineImages = new VirtualMachineImagesInner(this); - this.usages = new UsagesInner(this); - this.virtualMachines = new VirtualMachinesInner(this); - this.virtualMachineSizes = new VirtualMachineSizesInner(this); - this.images = new ImagesInner(this); - this.virtualMachineScaleSets = new VirtualMachineScaleSetsInner(this); - this.virtualMachineScaleSetExtensions = new VirtualMachineScaleSetExtensionsInner(this); - this.virtualMachineScaleSetRollingUpgrades = new VirtualMachineScaleSetRollingUpgradesInner(this); - this.virtualMachineScaleSetVMs = new VirtualMachineScaleSetVMsInner(this); - this.logAnalytics = new LogAnalyticsInner(this); - this.virtualMachineRunCommands = new VirtualMachineRunCommandsInner(this); - this.resourceSkus = new ResourceSkusInner(this); - this.disks = new DisksInner(this); - this.snapshots = new SnapshotsInner(this); - this.diskEncryptionSets = new DiskEncryptionSetsInner(this); - this.galleries = new GalleriesInner(this); - this.galleryImages = new GalleryImagesInner(this); - this.galleryImageVersions = new GalleryImageVersionsInner(this); - this.galleryApplications = new GalleryApplicationsInner(this); - this.galleryApplicationVersions = new GalleryApplicationVersionsInner(this); - this.containerServices = new ContainerServicesInner(this); - } -} diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeResourceType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeResourceType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeResourceType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeResourceType.java index fb45d81b35f3..f89db5ad658b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeResourceType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeResourceType.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.ExpandableStringEnum; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeRoles.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeRoles.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeRoles.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeRoles.java index aa4187ae62b1..dae632a64206 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeRoles.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeRoles.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSku.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSku.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSku.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSku.java index 6b341bd418dc..c8b89b9daee3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSku.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSku.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.ResourceSkuInner; +import com.azure.management.compute.fluent.inner.ResourceSkuInner; import com.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.HasInner; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkuName.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkuName.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkuName.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkuName.java index 07e9f4f91bb0..e190e237a0ea 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkuName.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkuName.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.ExpandableStringEnum; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkuTier.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkuTier.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkuTier.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkuTier.java index e8e11b1f32da..b7a135bb8ed6 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkuTier.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkuTier.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.ExpandableStringEnum; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkus.java similarity index 90% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkus.java index 2f338988e96a..78c99ff6422a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeSkus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeSkus.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.ResourceSkusInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.ResourceSkusClient; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.models.HasManager; import com.azure.management.resources.fluentcore.collection.SupportsListing; @@ -19,7 +19,7 @@ public interface ComputeSkus extends SupportsListing, SupportsListingByRegion, - HasInner, + HasInner, HasManager { /** * Lists all the skus with the specified resource type. diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsage.java similarity index 87% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsage.java index be600a9cbd0f..8b64e459f434 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsage.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.UsageInner; +import com.azure.management.compute.fluent.inner.UsageInner; import com.azure.management.resources.fluentcore.model.HasInner; /** An immutable client-side representation of an Azure compute resource usage info object. */ diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsageUnit.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsageUnit.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsageUnit.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsageUnit.java index 714e425be6d7..b261460ad136 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsageUnit.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsageUnit.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsages.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsages.java similarity index 89% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsages.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsages.java index 3465fb395fac..f2b8191dee87 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ComputeUsages.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ComputeUsages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListingByRegion; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceAgentPoolProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceAgentPoolProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceAgentPoolProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceAgentPoolProfile.java index c23a13c3b131..fd94c2f4694d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceAgentPoolProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceAgentPoolProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceCustomProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceCustomProfile.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceCustomProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceCustomProfile.java index 122befaf33bb..5e73fb48e281 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceCustomProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceCustomProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceDiagnosticsProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceDiagnosticsProfile.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceDiagnosticsProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceDiagnosticsProfile.java index a7e63387ddbe..d459f0b69c18 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceDiagnosticsProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceDiagnosticsProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceLinuxProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceLinuxProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceLinuxProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceLinuxProfile.java index e5b56998ad52..434b16bf62da 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceLinuxProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceLinuxProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceMasterProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceMasterProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceMasterProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceMasterProfile.java index 19516b32a82c..c669cb190531 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceMasterProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceMasterProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceMasterProfileCount.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceMasterProfileCount.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceMasterProfileCount.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceMasterProfileCount.java index 2276fa345d19..614f95d06dd2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceMasterProfileCount.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceMasterProfileCount.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceOrchestratorProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceOrchestratorProfile.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceOrchestratorProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceOrchestratorProfile.java index 1edd4fe41baa..202e96d5ab82 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceOrchestratorProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceOrchestratorProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceOrchestratorTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceOrchestratorTypes.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceOrchestratorTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceOrchestratorTypes.java index bab9469cf095..cc3567e85510 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceOrchestratorTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceOrchestratorTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServicePrincipalProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServicePrincipalProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServicePrincipalProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServicePrincipalProfile.java index ec729f913c82..62d58c91493f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServicePrincipalProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServicePrincipalProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceSshConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceSshConfiguration.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceSshConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceSshConfiguration.java index 410e7ad988a5..f3c986b7d359 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceSshConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceSshConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceSshPublicKey.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceSshPublicKey.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceSshPublicKey.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceSshPublicKey.java index 6ded5a200e65..ca81fb4b96f6 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceSshPublicKey.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceSshPublicKey.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceVMDiagnostics.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceVMDiagnostics.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceVMDiagnostics.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceVMDiagnostics.java index 1c539ee629e7..755f6f66af92 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceVMDiagnostics.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceVMDiagnostics.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceVMSizeTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceVMSizeTypes.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceVMSizeTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceVMSizeTypes.java index 46b59da3ea72..402f62fa6701 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceVMSizeTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceVMSizeTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceWindowsProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceWindowsProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceWindowsProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceWindowsProfile.java index 83465447af1e..7e8de923c6aa 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ContainerServiceWindowsProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ContainerServiceWindowsProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationData.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationData.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationData.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationData.java index e7f34008887c..3050d9e94d51 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationData.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationData.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationSource.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationSource.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationSource.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationSource.java index 478bf8b866b0..b09b772e905b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationSource.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationSource.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.management.resources.fluentcore.arm.ResourceUtils; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationSourceType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationSourceType.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationSourceType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationSourceType.java index 3cfa9f95c446..5d3e993190c4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/CreationSourceType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/CreationSourceType.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; /** The source type of managed disk or snapshot. */ public enum CreationSourceType { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DataDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DataDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DataDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DataDisk.java index 00add43139ce..57edb2146217 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DataDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DataDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DataDiskImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DataDiskImage.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DataDiskImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DataDiskImage.java index d860304c4a81..9ba24fcb2a81 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DataDiskImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DataDiskImage.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostAllocatableVM.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostAllocatableVM.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostAllocatableVM.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostAllocatableVM.java index e6531f560f21..8ebc9bd676ec 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostAllocatableVM.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostAllocatableVM.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostAvailableCapacity.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostAvailableCapacity.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostAvailableCapacity.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostAvailableCapacity.java index 2659502bc712..5173be06f1a4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostAvailableCapacity.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostAvailableCapacity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostGroupUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupUpdate.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostGroupUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupUpdate.java index 864a02f04600..eedb383828d0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostGroupUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostGroupUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostInstanceView.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostInstanceView.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostInstanceView.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostInstanceView.java index 589c96cc4b84..9c15175d1add 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostInstanceView.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostInstanceView.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostLicenseTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostLicenseTypes.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostLicenseTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostLicenseTypes.java index 3028fd033cbc..3ac4ee13de34 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostLicenseTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostLicenseTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostUpdate.java index 49365f858a9c..6dc25a8f3b26 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DedicatedHostUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DedicatedHostUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiagnosticsProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiagnosticsProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiagnosticsProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiagnosticsProfile.java index e129bd543698..1e711ac39300 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiagnosticsProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiagnosticsProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiffDiskOptions.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiffDiskOptions.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiffDiskOptions.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiffDiskOptions.java index 18110906f446..712bf3a68f6a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiffDiskOptions.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiffDiskOptions.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiffDiskSettings.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiffDiskSettings.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiffDiskSettings.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiffDiskSettings.java index 47de8cb032c1..d6ec5a890123 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiffDiskSettings.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiffDiskSettings.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disallowed.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disallowed.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disallowed.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disallowed.java index 4ed991eb2cd7..b4e4d5feec07 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disallowed.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disallowed.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disk.java index 4440ca96e3ca..12925b944808 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disk.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.DiskInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.DiskInner; import com.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.azure.management.resources.fluentcore.arm.models.Resource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskCreateOption.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskCreateOption.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskCreateOption.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskCreateOption.java index 91da00169c32..1dd80e09cac9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskCreateOption.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskCreateOption.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskCreateOptionTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskCreateOptionTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskCreateOptionTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskCreateOptionTypes.java index d4e6b8da3f3f..f81f45d057d5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskCreateOptionTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskCreateOptionTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSetIdentityType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetIdentityType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSetIdentityType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetIdentityType.java index c17329a5301c..014d2e204cc0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSetIdentityType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetIdentityType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSetUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetUpdate.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSetUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetUpdate.java index 571b45cd274a..f70c2a1b81b7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSetUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSetUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSettings.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSettings.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSettings.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSettings.java index 503adaaccc8b..5b5952ebd2ce 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskEncryptionSettings.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskEncryptionSettings.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskInstanceView.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskInstanceView.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskInstanceView.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskInstanceView.java index 5ed611401451..f449dfedc7b2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskInstanceView.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskInstanceView.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskSku.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskSku.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskSku.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskSku.java index 19579b2abc35..6ff27c3c3815 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskSku.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskSku.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskSkuTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskSkuTypes.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskSkuTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskSkuTypes.java index a341f197120f..05104c23be8c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskSkuTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskSkuTypes.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import java.util.Collection; import java.util.HashMap; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskState.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskState.java index 1a70c5aa97e1..18a96656b78e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskStorageAccountTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskStorageAccountTypes.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskStorageAccountTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskStorageAccountTypes.java index ef4c7125f4ab..51a4bab05b55 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskStorageAccountTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskStorageAccountTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskUpdate.java index 1b132391a269..f50ac4a13936 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskVolumeEncryptionMonitor.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskVolumeEncryptionMonitor.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskVolumeEncryptionMonitor.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskVolumeEncryptionMonitor.java index 84171bf703bd..a5f590a3b2fd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskVolumeEncryptionMonitor.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskVolumeEncryptionMonitor.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.management.resources.fluentcore.model.Refreshable; import java.util.Map; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskVolumeType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskVolumeType.java similarity index 92% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskVolumeType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskVolumeType.java index b76d963209a9..cfa70ff3f3b5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/DiskVolumeType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/DiskVolumeType.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; /** Defines values for DiskVolumeType. */ public enum DiskVolumeType { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disks.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disks.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disks.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disks.java index 9a124e9c03f1..21219d43a8b2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Disks.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Disks.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.DisksInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.DisksClient; import com.azure.management.resources.fluentcore.arm.collection.SupportsBatchDeletion; import com.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; @@ -32,7 +32,7 @@ public interface Disks SupportsBatchCreation, SupportsBatchDeletion, HasManager, - HasInner { + HasInner { /** * Grants access to a disk. diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Encryption.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Encryption.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Encryption.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Encryption.java index c66a9d28a304..c65cba1db139 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Encryption.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Encryption.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSetIdentity.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSetIdentity.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSetIdentity.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSetIdentity.java index c9ef7851a802..1ff2ec297711 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSetIdentity.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSetIdentity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSettingsCollection.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSettingsCollection.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSettingsCollection.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSettingsCollection.java index 018241af6508..2c7141ab744e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSettingsCollection.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSettingsCollection.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSettingsElement.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSettingsElement.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSettingsElement.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSettingsElement.java index a325a54a6864..4dc9424628c2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionSettingsElement.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionSettingsElement.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionStatus.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionStatus.java index 5d59866615dd..0b2667d42104 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionStatus.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionType.java index bb844b680290..6b1ea72458b8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/EncryptionType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/EncryptionType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Galleries.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Galleries.java similarity index 88% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Galleries.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Galleries.java index a3e5972e3878..8899ab4e00a5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Galleries.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Galleries.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.GalleriesInner; +import com.azure.management.compute.fluent.GalleriesClient; import com.azure.management.resources.fluentcore.arm.collection.SupportsBatchDeletion; import com.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; @@ -22,5 +22,5 @@ public interface Galleries SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, - HasInner { + HasInner { } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Gallery.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Gallery.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Gallery.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Gallery.java index b07b94ddde54..c34fdc23d30f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Gallery.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Gallery.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.GalleryInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.GalleryInner; import com.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.azure.management.resources.fluentcore.arm.models.HasManager; import com.azure.management.resources.fluentcore.arm.models.HasResourceGroup; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationUpdate.java index 0fcc6686846d..c3e849b733f1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionPropertiesProvisioningState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionPropertiesProvisioningState.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionPropertiesProvisioningState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionPropertiesProvisioningState.java index 93d7f73ed8cc..26e5d7cad770 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionPropertiesProvisioningState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionPropertiesProvisioningState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionPublishingProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionPublishingProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionPublishingProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionPublishingProfile.java index 46b299a67fa9..e49905fbf674 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionPublishingProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionPublishingProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionUpdate.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionUpdate.java index 635bbcad0565..65df83c47078 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryApplicationVersionUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryApplicationVersionUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactPublishingProfileBase.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactPublishingProfileBase.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactPublishingProfileBase.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactPublishingProfileBase.java index daf4cc618412..b725bb365b6e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactPublishingProfileBase.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactPublishingProfileBase.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactSource.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactSource.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactSource.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactSource.java index 6966d67b6096..fc713cafd6cd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactSource.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactSource.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactVersionSource.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactVersionSource.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactVersionSource.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactVersionSource.java index 6a57b3e42c8d..1987657deefc 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryArtifactVersionSource.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryArtifactVersionSource.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryDataDiskImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryDataDiskImage.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryDataDiskImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryDataDiskImage.java index ce285198e8b0..c88f75845c95 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryDataDiskImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryDataDiskImage.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryDiskImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryDiskImage.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryDiskImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryDiskImage.java index 321928395674..6f5a7e536b8d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryDiskImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryDiskImage.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryIdentifier.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryIdentifier.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryIdentifier.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryIdentifier.java index f71cb5f5ce0c..ec38b4550c11 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryIdentifier.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryIdentifier.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImage.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImage.java index 32f48c43fe7f..77f8804bd985 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImage.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.GalleryImageInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.GalleryImageInner; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.models.HasManager; import com.azure.management.resources.fluentcore.model.Appliable; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageIdentifier.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageIdentifier.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageIdentifier.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageIdentifier.java index b8ab844d5205..52bb4ed7dd82 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageIdentifier.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageIdentifier.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImagePropertiesProvisioningState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImagePropertiesProvisioningState.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImagePropertiesProvisioningState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImagePropertiesProvisioningState.java index ca563824ecdc..72854dbb8972 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImagePropertiesProvisioningState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImagePropertiesProvisioningState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageUpdate.java index 6a1bb5c1681b..bf65e6a2dd33 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersion.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersion.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersion.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersion.java index de24bc569758..0db351bc2be2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersion.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersion.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.GalleryImageVersionInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.GalleryImageVersionInner; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.models.HasManager; import com.azure.management.resources.fluentcore.model.Appliable; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionPropertiesProvisioningState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionPropertiesProvisioningState.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionPropertiesProvisioningState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionPropertiesProvisioningState.java index 6190e850a0a6..d108c1c40cbe 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionPropertiesProvisioningState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionPropertiesProvisioningState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionPublishingProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionPublishingProfile.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionPublishingProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionPublishingProfile.java index a84cff5cd1ea..f0be1ced34cd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionPublishingProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionPublishingProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionStorageProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionStorageProfile.java similarity index 91% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionStorageProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionStorageProfile.java index 16f516cf6c9e..c024730eae9b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionStorageProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionStorageProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; @@ -22,10 +22,10 @@ public final class GalleryImageVersionStorageProfile { private GalleryArtifactVersionSource source; /* - * This is the OS disk image. + * This is the disk image base class. */ @JsonProperty(value = "osDiskImage") - private GalleryOSDiskImage osDiskImage; + private GalleryDiskImage osDiskImage; /* * A list of data disk images. @@ -54,11 +54,11 @@ public GalleryImageVersionStorageProfile withSource(GalleryArtifactVersionSource } /** - * Get the osDiskImage property: This is the OS disk image. + * Get the osDiskImage property: This is the disk image base class. * * @return the osDiskImage value. */ - public GalleryOSDiskImage osDiskImage() { + public GalleryDiskImage osDiskImage() { return this.osDiskImage; } @@ -68,7 +68,7 @@ public GalleryOSDiskImage osDiskImage() { * @param osDiskImage the osDiskImage value to set. * @return the GalleryImageVersionStorageProfile object itself. */ - public GalleryImageVersionStorageProfile withOsDiskImage(GalleryOSDiskImage osDiskImage) { + public GalleryImageVersionStorageProfile withOsDiskImage(GalleryDiskImage osDiskImage) { this.osDiskImage = osDiskImage; return this; } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionUpdate.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionUpdate.java index bd1f3fd013c4..695c579d4245 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersionUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersionUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersions.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersions.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersions.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersions.java index 0cd4ca2473e5..7b3824830706 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImageVersions.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImageVersions.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.models.GalleryImageVersionsInner; +import com.azure.management.compute.fluent.GalleryImageVersionsClient; import com.azure.management.resources.fluentcore.collection.SupportsCreating; import com.azure.management.resources.fluentcore.model.HasInner; import reactor.core.publisher.Mono; @@ -14,7 +14,7 @@ /** Entry point to gallery image versions management API in Azure. */ @Fluent public interface GalleryImageVersions - extends SupportsCreating, HasInner { + extends SupportsCreating, HasInner { /** * Retrieves information about a gallery image version. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImages.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImages.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImages.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImages.java index 3f3f5d682267..c75f0ff8004b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryImages.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryImages.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.models.GalleryImagesInner; +import com.azure.management.compute.fluent.GalleryImagesClient; import com.azure.management.resources.fluentcore.collection.SupportsCreating; import com.azure.management.resources.fluentcore.model.HasInner; import reactor.core.publisher.Mono; @@ -14,7 +14,7 @@ /** Entry point to gallery images management API in Azure. */ @Fluent public interface GalleryImages - extends SupportsCreating, HasInner { + extends SupportsCreating, HasInner { /** * Retrieves information about an image in a gallery. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryOSDiskImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryOSDiskImage.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryOSDiskImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryOSDiskImage.java index 104720297481..a5326799183f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryOSDiskImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryOSDiskImage.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryPropertiesProvisioningState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryPropertiesProvisioningState.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryPropertiesProvisioningState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryPropertiesProvisioningState.java index dd374085a2fb..25d0d24f1d07 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryPropertiesProvisioningState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryPropertiesProvisioningState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryUpdate.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryUpdate.java index 9d3bdf436657..26f52b73b25f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GalleryUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GalleryUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GrantAccessData.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GrantAccessData.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/GrantAccessData.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GrantAccessData.java index 08aad2a9b5a8..ce9d5ccd3360 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/GrantAccessData.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/GrantAccessData.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HardwareProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HardwareProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/HardwareProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HardwareProfile.java index bac5181ebef8..d6b7bdc793c8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HardwareProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HardwareProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HostCaching.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HostCaching.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/HostCaching.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HostCaching.java index 4d09c0fe1a12..75deabf2446b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HostCaching.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HostCaching.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGeneration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGeneration.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGeneration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGeneration.java index 5972c213ec3e..ee39cf695d75 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGeneration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGeneration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGenerationType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGenerationType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGenerationType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGenerationType.java index 6a3c7ea15aaf..4980dd4f330c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGenerationType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGenerationType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGenerationTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGenerationTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGenerationTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGenerationTypes.java index 06b01242e163..03b6dc4e2648 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/HyperVGenerationTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/HyperVGenerationTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageDataDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageDataDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageDataDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageDataDisk.java index 7501076c7af8..b5d11a3fd5ad 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageDataDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageDataDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageDiskReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageDiskReference.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageDiskReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageDiskReference.java index 3f615ddca453..00da0342964f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageDiskReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageDiskReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageOSDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageOSDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageOSDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageOSDisk.java index 7b9510defef5..eb2b32d6a46a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageOSDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageOSDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImagePurchasePlan.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImagePurchasePlan.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImagePurchasePlan.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImagePurchasePlan.java index cfab7a204534..1b875734372b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImagePurchasePlan.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImagePurchasePlan.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageReference.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageReference.java index 577758bf0f40..4575515de38f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageStorageProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageStorageProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageStorageProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageStorageProfile.java index fb95eeb043dd..ccef08cad838 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageStorageProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageStorageProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageUpdate.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageUpdate.java index 69923b7617d4..110e237940c2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ImageUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ImageUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/InnerError.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InnerError.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/InnerError.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InnerError.java index 92598a0c0aa3..de0aff71cee0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/InnerError.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InnerError.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/InstanceViewStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InstanceViewStatus.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/InstanceViewStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InstanceViewStatus.java index 62865825f613..c25dc0b79b16 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/InstanceViewStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InstanceViewStatus.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/InstanceViewTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InstanceViewTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/InstanceViewTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InstanceViewTypes.java index a61aeddcba22..c2873fcc9762 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/InstanceViewTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/InstanceViewTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/IntervalInMins.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/IntervalInMins.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/IntervalInMins.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/IntervalInMins.java index e9c21d8c1c67..229b0635f2de 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/IntervalInMins.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/IntervalInMins.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/IpVersion.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/IpVersion.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/IpVersion.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/IpVersion.java index 20f72440d024..a73868d6e784 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/IpVersion.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/IpVersion.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultAndKeyReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultAndKeyReference.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultAndKeyReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultAndKeyReference.java index f66eb76058a4..7c37ae8f2b60 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultAndKeyReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultAndKeyReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultAndSecretReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultAndSecretReference.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultAndSecretReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultAndSecretReference.java index 2fe7e54c2bcc..2dadc01242df 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultAndSecretReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultAndSecretReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultKeyReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultKeyReference.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultKeyReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultKeyReference.java index 94f34fa05d23..b80ebc4723bf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultKeyReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultKeyReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultSecretReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultSecretReference.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultSecretReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultSecretReference.java index 6746cc951f57..bfee96fbd658 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KeyVaultSecretReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KeyVaultSecretReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KnownLinuxVirtualMachineImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KnownLinuxVirtualMachineImage.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/KnownLinuxVirtualMachineImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KnownLinuxVirtualMachineImage.java index fdc45be8302f..54adec9a5fc5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KnownLinuxVirtualMachineImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KnownLinuxVirtualMachineImage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; /** The popular Azure Linux images. */ public enum KnownLinuxVirtualMachineImage { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KnownWindowsVirtualMachineImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KnownWindowsVirtualMachineImage.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/KnownWindowsVirtualMachineImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KnownWindowsVirtualMachineImage.java index 85318bb058cc..21b8e3ba5bc0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/KnownWindowsVirtualMachineImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/KnownWindowsVirtualMachineImage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; /** The popular Azure Windows images. */ public enum KnownWindowsVirtualMachineImage { diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LinuxConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LinuxConfiguration.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/LinuxConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LinuxConfiguration.java index 47622bf377e1..348916195a67 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LinuxConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LinuxConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LinuxVMDiskEncryptionConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LinuxVMDiskEncryptionConfiguration.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/LinuxVMDiskEncryptionConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LinuxVMDiskEncryptionConfiguration.java index 682d64b9cf68..13d08f6ac3ec 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LinuxVMDiskEncryptionConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LinuxVMDiskEncryptionConfiguration.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; /** Type representing encryption settings to be applied to a Linux virtual machine. */ public class LinuxVMDiskEncryptionConfiguration diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsInner.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsInner.java deleted file mode 100644 index 9f4a2f308f59..000000000000 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsInner.java +++ /dev/null @@ -1,545 +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.management.compute.models; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.management.compute.LogAnalyticsInputBase; -import com.azure.management.compute.RequestRateByIntervalInput; -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 LogAnalytics. */ -public final class LogAnalyticsInner { - private final ClientLogger logger = new ClientLogger(LogAnalyticsInner.class); - - /** The proxy service used to perform REST calls. */ - private final LogAnalyticsService service; - - /** The service client containing this operation class. */ - private final ComputeManagementClientImpl client; - - /** - * Initializes an instance of LogAnalyticsInner. - * - * @param client the instance of the service client containing this operation class. - */ - LogAnalyticsInner(ComputeManagementClientImpl client) { - this.service = - RestProxy.create(LogAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ComputeManagementClientLogAnalytics to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ComputeManagementCli") - private interface LogAnalyticsService { - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getRequestRateByInterval") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportRequestRateByInterval( - @HostParam("$host") String host, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RequestRateByIntervalInput parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getThrottledRequests") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportThrottledRequests( - @HostParam("$host") String host, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LogAnalyticsInputBase parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getRequestRateByInterval") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginExportRequestRateByInterval( - @HostParam("$host") String host, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RequestRateByIntervalInput parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getThrottledRequests") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginExportThrottledRequests( - @HostParam("$host") String host, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LogAnalyticsInputBase parameters, - Context context); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> exportRequestRateByIntervalWithResponseAsync( - String location, RequestRateByIntervalInput parameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .exportRequestRateByInterval( - this.client.getHost(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportRequestRateByIntervalAsync( - String location, RequestRateByIntervalInput parameters) { - Mono>> mono = - exportRequestRateByIntervalWithResponseAsync(location, parameters); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - LogAnalyticsOperationResultInner.class, - LogAnalyticsOperationResultInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner exportRequestRateByInterval( - String location, RequestRateByIntervalInput parameters) { - return exportRequestRateByIntervalAsync(location, parameters).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> exportThrottledRequestsWithResponseAsync( - String location, LogAnalyticsInputBase parameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .exportThrottledRequests( - this.client.getHost(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportThrottledRequestsAsync( - String location, LogAnalyticsInputBase parameters) { - Mono>> mono = exportThrottledRequestsWithResponseAsync(location, parameters); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - LogAnalyticsOperationResultInner.class, - LogAnalyticsOperationResultInner.class) - .last() - .flatMap(AsyncPollResponse::getFinalResult); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner exportThrottledRequests(String location, LogAnalyticsInputBase parameters) { - return exportThrottledRequestsAsync(location, parameters).block(); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportRequestRateByIntervalWithResponseAsync( - String location, RequestRateByIntervalInput parameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .beginExportRequestRateByInterval( - this.client.getHost(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportRequestRateByIntervalWithResponseAsync( - String location, RequestRateByIntervalInput parameters, Context context) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-03-01"; - return service - .beginExportRequestRateByInterval( - this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportRequestRateByIntervalAsync( - String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalWithResponseAsync(location, parameters) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportRequestRateByInterval( - String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalAsync(location, parameters).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportThrottledRequestsWithResponseAsync( - String location, LogAnalyticsInputBase parameters) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-03-01"; - return FluxUtil - .withContext( - context -> - service - .beginExportThrottledRequests( - this.client.getHost(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportThrottledRequestsWithResponseAsync( - String location, LogAnalyticsInputBase parameters, Context context) { - if (this.client.getHost() == null) { - return Mono - .error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-03-01"; - return service - .beginExportThrottledRequests( - this.client.getHost(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportThrottledRequestsAsync( - String location, LogAnalyticsInputBase parameters) { - return beginExportThrottledRequestsWithResponseAsync(location, parameters) - .flatMap( - (SimpleResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics 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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportThrottledRequests( - String location, LogAnalyticsInputBase parameters) { - return beginExportThrottledRequestsAsync(location, parameters).block(); - } -} diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LogAnalyticsInputBase.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsInputBase.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/LogAnalyticsInputBase.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsInputBase.java index 4f0b1c143e7b..97aef9a643dd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LogAnalyticsInputBase.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsInputBase.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LogAnalyticsOutput.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsOutput.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/LogAnalyticsOutput.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsOutput.java index 4c6ee4c96c59..5e1692bf036d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/LogAnalyticsOutput.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/LogAnalyticsOutput.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/MaintenanceOperationResultCodeTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/MaintenanceOperationResultCodeTypes.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/MaintenanceOperationResultCodeTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/MaintenanceOperationResultCodeTypes.java index a95972828003..efdbb2ff8083 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/MaintenanceOperationResultCodeTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/MaintenanceOperationResultCodeTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/MaintenanceRedeployStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/MaintenanceRedeployStatus.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/MaintenanceRedeployStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/MaintenanceRedeployStatus.java index 085709325259..70b9f4cf01cd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/MaintenanceRedeployStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/MaintenanceRedeployStatus.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ManagedArtifact.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ManagedArtifact.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ManagedArtifact.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ManagedArtifact.java index 0c83a33694e6..c9a21df61543 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ManagedArtifact.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ManagedArtifact.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ManagedDiskParameters.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ManagedDiskParameters.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ManagedDiskParameters.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ManagedDiskParameters.java index 3eed94570ce2..2174560bd261 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ManagedDiskParameters.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ManagedDiskParameters.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/NetworkInterfaceReference.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/NetworkInterfaceReference.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/NetworkInterfaceReference.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/NetworkInterfaceReference.java index 9fbe722cc392..1bbd465c3e4e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/NetworkInterfaceReference.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/NetworkInterfaceReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/NetworkProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/NetworkProfile.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/NetworkProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/NetworkProfile.java index 924a92d5f60d..f9865abb82bb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/NetworkProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/NetworkProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSDisk.java index 85f020b414b1..5d34849027c0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSDiskImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSDiskImage.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSDiskImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSDiskImage.java index e32c2f144b18..70cecd345a6d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSDiskImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSDiskImage.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSProfile.java index 3140d7bbd7cb..f39a898562f2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OSProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OSProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OperatingSystemStateTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperatingSystemStateTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/OperatingSystemStateTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperatingSystemStateTypes.java index 17204d01d68e..2490a8d35f95 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OperatingSystemStateTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperatingSystemStateTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OperatingSystemTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperatingSystemTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/OperatingSystemTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperatingSystemTypes.java index 819b45a44956..cde61aefef59 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/OperatingSystemTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/OperatingSystemTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/PassNames.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PassNames.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/PassNames.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PassNames.java index a56865f6f49e..38da51a01cd7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/PassNames.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PassNames.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Plan.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Plan.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Plan.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Plan.java index a4e1ce1bd39e..e59523ff5cf3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Plan.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Plan.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/PowerState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PowerState.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/PowerState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PowerState.java index d448a8bbebd9..c6484d96a63c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/PowerState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PowerState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProtocolTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProtocolTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProtocolTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProtocolTypes.java index f601f283688d..d232f52ef349 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProtocolTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProtocolTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroup.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroup.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroup.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroup.java index b34eea82f1db..86256349ea11 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroup.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroup.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.ProximityPlacementGroupInner; +import com.azure.management.compute.fluent.inner.ProximityPlacementGroupInner; import com.azure.management.resources.fluentcore.model.HasInner; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroupType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroupType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupType.java index 5b054f664cb8..b0a5418c43fa 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroupType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroupUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupUpdate.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroupUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupUpdate.java index 297f000f550c..7b595d2ffb16 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ProximityPlacementGroupUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ProximityPlacementGroupUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/PurchasePlan.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PurchasePlan.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/PurchasePlan.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PurchasePlan.java index 09962fca5d45..10d7af76fd36 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/PurchasePlan.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/PurchasePlan.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RecommendedMachineConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RecommendedMachineConfiguration.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RecommendedMachineConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RecommendedMachineConfiguration.java index a46366da041e..4e0d22ea788d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RecommendedMachineConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RecommendedMachineConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RegionalReplicationStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RegionalReplicationStatus.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RegionalReplicationStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RegionalReplicationStatus.java index b519e9566619..c59963b81663 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RegionalReplicationStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RegionalReplicationStatus.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationState.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationState.java index 830beff16bd4..3e5a6f21c7a6 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationStatus.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationStatus.java index 9ab80a8f209b..fbea8e1d9ef9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationStatus.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationStatusTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationStatusTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationStatusTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationStatusTypes.java index 45e840e9a0ce..bc864bc9ab1c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ReplicationStatusTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ReplicationStatusTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RequestRateByIntervalInput.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RequestRateByIntervalInput.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RequestRateByIntervalInput.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RequestRateByIntervalInput.java index e9f83050dbdb..5dd3f68e8796 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RequestRateByIntervalInput.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RequestRateByIntervalInput.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceIdentityType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceIdentityType.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceIdentityType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceIdentityType.java index 21488da07c8c..db4c36a2d7ad 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceIdentityType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceIdentityType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceRange.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceRange.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceRange.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceRange.java index ec3b2f1d4ed6..dbb923769af8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceRange.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceRange.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapabilities.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapabilities.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapabilities.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapabilities.java index b5850008d003..d8a8ecda9965 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapabilities.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapabilities.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapacity.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapacity.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapacity.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapacity.java index 1bb648806ae3..19a6601ca77e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapacity.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapacity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapacityScaleType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapacityScaleType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapacityScaleType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapacityScaleType.java index e10c94c60be1..487d4ca40da3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCapacityScaleType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCapacityScaleType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCosts.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCosts.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCosts.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCosts.java index d71b82d17ff2..e76c99741ccd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuCosts.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuCosts.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuLocationInfo.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuLocationInfo.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuLocationInfo.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuLocationInfo.java index a42b2ac5cb66..2170265a99ca 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuLocationInfo.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuLocationInfo.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionInfo.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionInfo.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionInfo.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionInfo.java index 68d98c2e7055..7d1393aef961 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionInfo.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionInfo.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictions.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictions.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictions.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictions.java index 544184d633ad..4fa1458448fa 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictions.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictions.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionsReasonCode.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionsReasonCode.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionsReasonCode.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionsReasonCode.java index 5a26e7ebbfa7..9e1a24f1583b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionsReasonCode.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionsReasonCode.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionsType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionsType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionsType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionsType.java index bbbb27643454..0b4ef1e9e728 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuRestrictionsType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuRestrictionsType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuZoneDetails.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuZoneDetails.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuZoneDetails.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuZoneDetails.java index 350799cf624c..b3d6e6ff2ddf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ResourceSkuZoneDetails.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ResourceSkuZoneDetails.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollbackStatusInfo.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollbackStatusInfo.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollbackStatusInfo.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollbackStatusInfo.java index f2cf7d86ad5a..d7ea76df5a07 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollbackStatusInfo.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollbackStatusInfo.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeActionType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeActionType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeActionType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeActionType.java index 01a02ede356e..a987127efe87 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeActionType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeActionType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradePolicy.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradePolicy.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradePolicy.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradePolicy.java index 68c22122d491..b3d407bfc2d3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradePolicy.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradePolicy.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeProgressInfo.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeProgressInfo.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeProgressInfo.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeProgressInfo.java index 426073e86d9b..655d4d04189e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeProgressInfo.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeProgressInfo.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeRunningStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeRunningStatus.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeRunningStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeRunningStatus.java index f0ec2e74da11..98bc612f2f4f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeRunningStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeRunningStatus.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeStatusCode.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeStatusCode.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeStatusCode.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeStatusCode.java index 736a4066b7c0..0d6dcbc7fcd6 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RollingUpgradeStatusCode.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeStatusCode.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandInput.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandInput.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandInput.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandInput.java index 103211a0a863..bf05f3b704a7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandInput.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandInput.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandInputParameter.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandInputParameter.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandInputParameter.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandInputParameter.java index 7d0d52d785ac..8abfc9ee81be 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandInputParameter.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandInputParameter.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandParameterDefinition.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandParameterDefinition.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandParameterDefinition.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandParameterDefinition.java index ef365217136b..30b26a8996d2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandParameterDefinition.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandParameterDefinition.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandResult.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandResult.java similarity index 81% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandResult.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandResult.java index 9f73ffe01b3d..4a211883bbb0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/RunCommandResult.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RunCommandResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.RunCommandResultInner; +import com.azure.management.compute.fluent.inner.RunCommandResultInner; import com.azure.management.resources.fluentcore.model.HasInner; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ScaleInPolicy.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ScaleInPolicy.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ScaleInPolicy.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ScaleInPolicy.java index 5aff0fd690a0..0d52dc2463b4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ScaleInPolicy.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ScaleInPolicy.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ScheduledEventsProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ScheduledEventsProfile.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ScheduledEventsProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ScheduledEventsProfile.java index c7de42080607..16d78590dbfd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ScheduledEventsProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ScheduledEventsProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SettingNames.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SettingNames.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SettingNames.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SettingNames.java index 794e597349ac..d32b12d03bac 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SettingNames.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SettingNames.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Sku.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Sku.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Sku.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Sku.java index 826ab540a17e..2775f8ed85c9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Sku.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Sku.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Snapshot.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Snapshot.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Snapshot.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Snapshot.java index 14ee56058975..e62e25f34181 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Snapshot.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Snapshot.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.SnapshotInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.SnapshotInner; import com.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.azure.management.resources.fluentcore.arm.models.Resource; import com.azure.management.resources.fluentcore.model.Appliable; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotSku.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotSku.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotSku.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotSku.java index 1caa557c90bb..7c6ea40e4e3f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotSku.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotSku.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotSkuType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotSkuType.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotSkuType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotSkuType.java index e1caef45bd14..66738502a491 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotSkuType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotSkuType.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import java.util.Collection; import java.util.HashMap; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotStorageAccountTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotStorageAccountTypes.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotStorageAccountTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotStorageAccountTypes.java index 851daf441820..004193dc8ea7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotStorageAccountTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotStorageAccountTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotUpdate.java index d16415fcc6da..e571509353d7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SnapshotUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SnapshotUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Snapshots.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Snapshots.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/Snapshots.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Snapshots.java index 9288bc03522f..a768e7aac2f0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/Snapshots.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/Snapshots.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.SnapshotsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.SnapshotsClient; import com.azure.management.resources.fluentcore.arm.collection.SupportsBatchDeletion; import com.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; @@ -32,7 +32,7 @@ public interface Snapshots SupportsBatchCreation, SupportsBatchDeletion, HasManager, - HasInner { + HasInner { /** * Grants access to the snapshot asynchronously. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SourceVault.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SourceVault.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SourceVault.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SourceVault.java index 16555dd6ecd0..2d0da5dc7844 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SourceVault.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SourceVault.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SshConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SshConfiguration.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SshConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SshConfiguration.java index 47f323420343..82801dad67e9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SshConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SshConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SshPublicKey.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SshPublicKey.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SshPublicKey.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SshPublicKey.java index bb317ccb5a74..bed60fa31dd4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SshPublicKey.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SshPublicKey.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StatusLevelTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StatusLevelTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/StatusLevelTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StatusLevelTypes.java index d84f4b09a410..dae6d3687983 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StatusLevelTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StatusLevelTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageAccountType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageAccountType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageAccountType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageAccountType.java index 2219b9ad38bb..08af3432fcdf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageAccountType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageAccountType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageAccountTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageAccountTypes.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageAccountTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageAccountTypes.java index 568e4b5dfcac..df72c9f7ad43 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageAccountTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageAccountTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageProfile.java index 6486aba3a250..9730ccd29f1a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/StorageProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/StorageProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SubResourceReadOnly.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SubResourceReadOnly.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/SubResourceReadOnly.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SubResourceReadOnly.java index 1c4d3b1c3cd6..d6e8c2838289 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/SubResourceReadOnly.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/SubResourceReadOnly.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/TargetRegion.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/TargetRegion.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/TargetRegion.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/TargetRegion.java index 8ea7df7c5d18..5e51149f8993 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/TargetRegion.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/TargetRegion.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/TerminateNotificationProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/TerminateNotificationProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/TerminateNotificationProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/TerminateNotificationProfile.java index a2b4ede9be23..d97fde01a445 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/TerminateNotificationProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/TerminateNotificationProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ThrottledRequestsInput.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ThrottledRequestsInput.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/ThrottledRequestsInput.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ThrottledRequestsInput.java index 0638df211b0b..a6b7a7df1b40 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/ThrottledRequestsInput.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/ThrottledRequestsInput.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpdateResource.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpdateResource.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpdateResource.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpdateResource.java index 8fe2a46ec738..31caf99ed57b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpdateResource.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpdateResource.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpdateResourceAutoGenerated.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpdateResourceAutoGenerated.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpdateResourceAutoGenerated.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpdateResourceAutoGenerated.java index b77e11593913..7a8521b1590a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpdateResourceAutoGenerated.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpdateResourceAutoGenerated.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeMode.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeMode.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeMode.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeMode.java index 5e21103e2571..07f3765c3f1a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeMode.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeMode.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationHistoricalStatusInfoProperties.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoricalStatusInfoProperties.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationHistoricalStatusInfoProperties.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoricalStatusInfoProperties.java index bba90268e8b3..a9c171720c14 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationHistoricalStatusInfoProperties.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoricalStatusInfoProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationHistoryStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoryStatus.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationHistoryStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoryStatus.java index 14225c337a9a..ea4aaf2b80ff 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationHistoryStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationHistoryStatus.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationInvoker.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationInvoker.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationInvoker.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationInvoker.java index a4844c03b5b6..1301fb0bd7b4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeOperationInvoker.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeOperationInvoker.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradePolicy.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradePolicy.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradePolicy.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradePolicy.java index 935b1e047ac8..cd9b61f998ac 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradePolicy.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradePolicy.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeState.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeState.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeState.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeState.java index 1b4b5be629d7..a057683a7189 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UpgradeState.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UpgradeState.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UsageName.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsageName.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UsageName.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsageName.java index 0cdc0341f28f..455eaf0d8de8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UsageName.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UsageName.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UserArtifactSource.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UserArtifactSource.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/UserArtifactSource.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UserArtifactSource.java index 3caf44ab5e79..351a3316c731 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/UserArtifactSource.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/UserArtifactSource.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VMScaleSetConvertToSinglePlacementGroupInput.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VMScaleSetConvertToSinglePlacementGroupInput.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VMScaleSetConvertToSinglePlacementGroupInput.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VMScaleSetConvertToSinglePlacementGroupInput.java index 8364048f0ac8..ee7a9323832c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VMScaleSetConvertToSinglePlacementGroupInput.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VMScaleSetConvertToSinglePlacementGroupInput.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VaultCertificate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VaultCertificate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VaultCertificate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VaultCertificate.java index 67b6919fb4d5..869c9c6789e5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VaultCertificate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VaultCertificate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VaultSecretGroup.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VaultSecretGroup.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VaultSecretGroup.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VaultSecretGroup.java index 595c1dd8a7b8..41e04973f2ba 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VaultSecretGroup.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VaultSecretGroup.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualHardDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualHardDisk.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualHardDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualHardDisk.java index 283e30e5a752..982a8b33e0bc 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualHardDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualHardDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachine.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachine.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachine.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachine.java index d0c35170caf9..de4a62eaeaae 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachine.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachine.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.VirtualMachineInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.msi.Identity; import com.azure.management.network.Network; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineAgentInstanceView.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineAgentInstanceView.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineAgentInstanceView.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineAgentInstanceView.java index 36e4c79bd873..3d1f4cacda2f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineAgentInstanceView.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineAgentInstanceView.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCaptureParameters.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCaptureParameters.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCaptureParameters.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCaptureParameters.java index d25aa61b9294..cbfcaed79feb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCaptureParameters.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCaptureParameters.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCustomImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCustomImage.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCustomImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCustomImage.java index 22110a2cc53d..3164b0d1a770 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCustomImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCustomImage.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.ImageInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.ImageInner; import com.azure.management.resources.fluentcore.arm.models.ChildResource; import com.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.azure.management.resources.fluentcore.arm.models.Resource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCustomImages.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCustomImages.java similarity index 89% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCustomImages.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCustomImages.java index d183e67d8ac9..2afcd7afb8d3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineCustomImages.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineCustomImages.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.ImagesInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.ImagesClient; import com.azure.management.resources.fluentcore.arm.collection.SupportsBatchDeletion; import com.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; @@ -31,5 +31,5 @@ public interface VirtualMachineCustomImages SupportsBatchCreation, SupportsBatchDeletion, HasManager, - HasInner { + HasInner { } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineDataDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineDataDisk.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineDataDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineDataDisk.java index 5bcd4ca96ce3..fd3e58f72cde 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineDataDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineDataDisk.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.models.HasId; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEncryption.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEncryption.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEncryption.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEncryption.java index 60a56767211f..a5706a5c9089 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEncryption.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEncryption.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import reactor.core.publisher.Mono; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEncryptionConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEncryptionConfiguration.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEncryptionConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEncryptionConfiguration.java index dff74e0b9607..0df1f5dfc190 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEncryptionConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEncryptionConfiguration.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.management.resources.fluentcore.arm.ResourceUtils; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEvictionPolicyTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEvictionPolicyTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEvictionPolicyTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEvictionPolicyTypes.java index 924542bad229..df18ef8d4cda 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineEvictionPolicyTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineEvictionPolicyTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtension.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtension.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtension.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtension.java index fd253dbadba2..a72abf3c02ba 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtension.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtension.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.models.ExternalChildResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionBase.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionBase.java similarity index 92% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionBase.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionBase.java index fcfd517dcc70..09210d339e43 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionBase.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionBase.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionInner; import com.azure.management.resources.fluentcore.model.HasInner; import java.util.Map; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionHandlerInstanceView.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionHandlerInstanceView.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionHandlerInstanceView.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionHandlerInstanceView.java index 5a72f4d23d37..0c8c5f725ca1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionHandlerInstanceView.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionHandlerInstanceView.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImage.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImage.java index 0e8297348e40..134466658f95 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImage.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; import com.azure.management.resources.fluentcore.model.HasInner; /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageType.java similarity index 88% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageType.java index 98fbe826d342..28f94531acbb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageType.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; import com.azure.management.resources.fluentcore.arm.models.HasName; import com.azure.management.resources.fluentcore.model.HasInner; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageTypes.java similarity index 89% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageTypes.java index 4caac5adfc9d..e6ec62fec010 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageTypes.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListing; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageVersion.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageVersion.java similarity index 89% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageVersion.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageVersion.java index ce36fee3b625..3e3d1e9d5cc3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageVersion.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageVersion.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineExtensionImageInner; +import com.azure.management.compute.fluent.inner.VirtualMachineExtensionImageInner; import com.azure.management.resources.fluentcore.arm.models.HasName; import com.azure.management.resources.fluentcore.model.HasInner; import reactor.core.publisher.Mono; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageVersions.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageVersions.java similarity index 90% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageVersions.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageVersions.java index 78a6b616c258..57d03b09f111 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImageVersions.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImageVersions.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListing; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImages.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImages.java similarity index 92% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImages.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImages.java index 68fd9d860437..b017a46861e4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionImages.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionImages.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListingByRegion; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionInstanceView.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionInstanceView.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionInstanceView.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionInstanceView.java index 5576d1aebaff..a54bd52c5a75 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionInstanceView.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionInstanceView.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionUpdate.java index b7c07ef29926..a9b3df4f2535 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineExtensionUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineExtensionUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineHealthStatus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineHealthStatus.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineHealthStatus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineHealthStatus.java index 85ccf9fad75d..a55dac5fd4b9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineHealthStatus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineHealthStatus.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineIdentity.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineIdentity.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineIdentity.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineIdentity.java index 74f6b5e9ea46..0fa34d56981f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineIdentity.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineIdentity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; @@ -45,8 +45,8 @@ public class VirtualMachineIdentity { * form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - @JsonProperty(value = "userAssignedIdentities") @JsonInclude(content = JsonInclude.Include.ALWAYS) + @JsonProperty(value = "userAssignedIdentities") private Map userAssignedIdentities; /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineIdentityUserAssignedIdentities.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineIdentityUserAssignedIdentities.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineIdentityUserAssignedIdentities.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineIdentityUserAssignedIdentities.java index 96e617ea1224..798710ea6577 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineIdentityUserAssignedIdentities.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineIdentityUserAssignedIdentities.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImage.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImage.java similarity index 92% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImage.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImage.java index 0b760fa2514f..8abb5948adaf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImage.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImage.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineImageInner; +import com.azure.management.compute.fluent.inner.VirtualMachineImageInner; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.HasInner; import java.util.Map; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImages.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImages.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImages.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImages.java index a5c6dbc8c99d..38c3c49ebcff 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImages.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImagesInSku.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImagesInSku.java similarity index 89% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImagesInSku.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImagesInSku.java index e7d8bcfd156e..7d15caeb0f94 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineImagesInSku.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineImagesInSku.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListing; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineInstanceView.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInstanceView.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineInstanceView.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInstanceView.java index f1f8fe9ba364..d1d521089715 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineInstanceView.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineInstanceView.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineInstanceViewInner; +import com.azure.management.compute.fluent.inner.VirtualMachineInstanceViewInner; import com.azure.management.resources.fluentcore.model.HasInner; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineOffer.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineOffer.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineOffer.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineOffer.java index 74ff1602eb68..c93a7771a00f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineOffer.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineOffer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineOffers.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineOffers.java similarity index 88% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineOffers.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineOffers.java index 28c03b18ea96..310bb2d7803d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineOffers.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineOffers.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListing; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePriorityTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePriorityTypes.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePriorityTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePriorityTypes.java index fa483e082411..6d64ac6f09d1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePriorityTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePriorityTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePublisher.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePublisher.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePublisher.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePublisher.java index 51a969765e82..812b077f82c0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePublisher.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePublisher.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePublishers.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePublishers.java similarity index 89% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePublishers.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePublishers.java index 8fd03c8cc867..d7b7a06189c1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachinePublishers.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachinePublishers.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListingByRegion; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineReimageParameters.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineReimageParameters.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineReimageParameters.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineReimageParameters.java index fbed4b9c5fdc..d12aa6bfc78a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineReimageParameters.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineReimageParameters.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSet.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSet.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSet.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSet.java index a28c97daaef3..00152649e3fd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSet.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSet.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.VirtualMachineScaleSetInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetInner; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.msi.Identity; import com.azure.management.network.ApplicationSecurityGroup; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetDataDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetDataDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetDataDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetDataDisk.java index 1c0e74553ffd..a8f829e9aac1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetDataDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetDataDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetExtension.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtension.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetExtension.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtension.java index f5d7d9dcfc64..dc25079c3649 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetExtension.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtension.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineScaleSetExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetExtensionInner; import com.azure.management.resources.fluentcore.arm.models.ChildResource; import com.azure.management.resources.fluentcore.model.Attachable; import com.azure.management.resources.fluentcore.model.HasInner; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetExtensionProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionProfile.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetExtensionProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionProfile.java index 6de067ae87c5..23bb974863b2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetExtensionProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetExtensionProfile.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.management.compute.models.VirtualMachineScaleSetExtensionInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetExtensionInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIdentity.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIdentity.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIdentity.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIdentity.java index 57d9903b9c17..35a74e6fb924 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIdentity.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIdentity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; @@ -45,8 +45,8 @@ public class VirtualMachineScaleSetIdentity { * ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - @JsonProperty(value = "userAssignedIdentities") @JsonInclude(content = JsonInclude.Include.ALWAYS) + @JsonProperty(value = "userAssignedIdentities") private Map userAssignedIdentities; /** diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIdentityUserAssignedIdentities.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIdentityUserAssignedIdentities.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIdentityUserAssignedIdentities.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIdentityUserAssignedIdentities.java index f0635cd96ead..04fe550d9d1a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIdentityUserAssignedIdentities.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIdentityUserAssignedIdentities.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetInstanceViewStatusesSummary.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetInstanceViewStatusesSummary.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java index 237d58330052..06b905b25e95 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetInstanceViewStatusesSummary.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetInstanceViewStatusesSummary.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIpConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIpConfiguration.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIpConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIpConfiguration.java index 4b9e187ef2e8..8ac415670ae6 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIpConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIpConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIpTag.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIpTag.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIpTag.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIpTag.java index 4695a6181885..32dc915accf5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetIpTag.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetIpTag.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetManagedDiskParameters.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetManagedDiskParameters.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetManagedDiskParameters.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetManagedDiskParameters.java index d572304b0607..5cde4250f448 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetManagedDiskParameters.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetManagedDiskParameters.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkConfiguration.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkConfiguration.java index c713128cf02c..6ea2354d68ed 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java index 6038aa9aff76..8b969c9c292f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkProfile.java index 2cb95ceb06bf..89bfd69a95f4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetNetworkProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetNetworkProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetOSDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetOSDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetOSDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetOSDisk.java index a4267cc635d2..51b05d1b77f7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetOSDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetOSDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetOSProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetOSProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetOSProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetOSProfile.java index 92139d8ebefa..04aab1a3f4d7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetOSProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetOSProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetPublicIpAddressConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetPublicIpAddressConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java index ec828b093e3e..d9dc0d4039ea 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetPublicIpAddressConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java index e34bff6be6ad..1f9b2a39208d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetReimageParameters.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetReimageParameters.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetReimageParameters.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetReimageParameters.java index 72d9b7b4ecde..ac1f198d1776 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetReimageParameters.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetReimageParameters.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetScaleInRules.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetScaleInRules.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetScaleInRules.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetScaleInRules.java index d412ee40781f..134a606be26d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetScaleInRules.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetScaleInRules.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSku.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSku.java similarity index 92% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSku.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSku.java index 66db0e356f43..01105bec8d5e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSku.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSku.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuCapacity.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuCapacity.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuCapacity.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuCapacity.java index efa3cf43325a..515964487c88 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuCapacity.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuCapacity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuScaleType.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuScaleType.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuScaleType.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuScaleType.java index 073752675799..50335940f980 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuScaleType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuScaleType.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuTypes.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuTypes.java index 83ff9e361ecb..5ce282b72ac7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetSkuTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetSkuTypes.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import java.util.Collection; import java.util.HashMap; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetStorageProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetStorageProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetStorageProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetStorageProfile.java index 844bc0e68aaf..f0d352780d35 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetStorageProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetStorageProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUnmanagedDataDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUnmanagedDataDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUnmanagedDataDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUnmanagedDataDisk.java index ed0b3635239e..b9417bde0bc8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUnmanagedDataDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUnmanagedDataDisk.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.models.ChildResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdate.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdate.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdate.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdate.java index a814aff888f4..3f41f83833f4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdate.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdate.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateIpConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateIpConfiguration.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateIpConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateIpConfiguration.java index dba340212bdc..24f563738880 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateIpConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateIpConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateNetworkConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateNetworkConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java index f16d73a424f5..fd6167b68e3a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateNetworkConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateNetworkConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateNetworkProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateNetworkProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateNetworkProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateNetworkProfile.java index e92a7afc67e1..b0d7458f2ec2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateNetworkProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateNetworkProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateOSDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateOSDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateOSDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateOSDisk.java index 7996ed016b6e..1e6d1921bf9a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateOSDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateOSDisk.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateOSProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateOSProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateOSProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateOSProfile.java index 9b13bfdbf644..03cf37a9ccc5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateOSProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateOSProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java index c769b2d10365..1961858209d0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdatePublicIpAddressConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateStorageProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateStorageProfile.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateStorageProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateStorageProfile.java index f4e045cdd21c..61577d2ae7ea 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateStorageProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateStorageProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateVMProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateVMProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateVMProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateVMProfile.java index 70b083b7836d..15b252a2b5ef 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetUpdateVMProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetUpdateVMProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVM.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVM.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVM.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVM.java index 67441e70a288..838ae8749be7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVM.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVM.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.models.VirtualMachineScaleSetVMInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetVMInner; import com.azure.management.network.VirtualMachineScaleSetNetworkInterface; import com.azure.management.resources.fluentcore.arm.models.ChildResource; import com.azure.management.resources.fluentcore.arm.models.Resource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMExtensionsSummary.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMExtensionsSummary.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMExtensionsSummary.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMExtensionsSummary.java index e2a32294b4f7..60bdcec1241d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMExtensionsSummary.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMExtensionsSummary.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceExtension.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceExtension.java similarity index 93% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceExtension.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceExtension.java index 5755ca9b83cd..f3df6432be03 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceExtension.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceExtension.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.models.ChildResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceIDs.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceIDs.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceIDs.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceIDs.java index 404724cab5ef..a23988db7f4d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceIDs.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceIDs.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceRequiredIDs.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceRequiredIDs.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java index 9794b05101c4..f03d5b4400e5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMInstanceRequiredIDs.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMInstanceRequiredIDs.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMNetworkProfileConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMNetworkProfileConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java index 0f4ea9b17d13..ca4bc281e619 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMNetworkProfileConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMNetworkProfileConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMProfile.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMProfile.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMProfile.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMProfile.java index 88ead8d95644..01122ec8f002 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMProfile.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMProfile.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMProtectionPolicy.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMProtectionPolicy.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMProtectionPolicy.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMProtectionPolicy.java index 614e26c0b3c5..7aec90befdf9 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMProtectionPolicy.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMProtectionPolicy.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMReimageParameters.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMReimageParameters.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMReimageParameters.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMReimageParameters.java index b6fb65eb1b32..608a2fee6496 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMReimageParameters.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMReimageParameters.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMs.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMs.java similarity index 95% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMs.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMs.java index e69fbb59b26c..0b051c902393 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSetVMs.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSetVMs.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; -import com.azure.management.compute.models.VirtualMachineScaleSetVMsInner; +import com.azure.management.compute.fluent.VirtualMachineScaleSetVMsClient; import com.azure.management.resources.fluentcore.collection.SupportsListing; import com.azure.management.resources.fluentcore.model.HasInner; import java.util.Collection; @@ -13,7 +13,7 @@ /** Entry point to virtual machine scale set instance management API. */ @Fluent public interface VirtualMachineScaleSetVMs - extends SupportsListing, HasInner { + extends SupportsListing, HasInner { /** * Deletes the specified virtual machine instances from the scale set. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSets.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSets.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSets.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSets.java index 932be56a2907..c1fc21319bef 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineScaleSets.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineScaleSets.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementException; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.VirtualMachineScaleSetsInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.VirtualMachineScaleSetsClient; import com.azure.management.resources.fluentcore.arm.collection.SupportsBatchDeletion; import com.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; @@ -35,7 +35,7 @@ public interface VirtualMachineScaleSets SupportsBatchCreation, SupportsBatchDeletion, HasManager, - HasInner { + HasInner { /** * Shuts down the virtual machines in the scale set and releases the compute resources. * diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSize.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSize.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSize.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSize.java index f7ded29b49bc..9abd3e725e42 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSize.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSize.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.models.HasName; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSizeTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeTypes.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSizeTypes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeTypes.java index 4217828fefa9..65301452bc10 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSizeTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizeTypes.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSizes.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizes.java similarity index 89% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSizes.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizes.java index 03ebcfdece20..5564aebad446 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSizes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSizes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListingByRegion; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSku.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSku.java similarity index 94% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSku.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSku.java index 6f99843019da..2ef4a799e2db 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSku.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSku.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSkus.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSkus.java similarity index 88% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSkus.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSkus.java index cc92c388c348..db7de5bfbd1b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineSkus.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineSkus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.collection.SupportsListing; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineStatusCodeCount.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineStatusCodeCount.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineStatusCodeCount.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineStatusCodeCount.java index 4bead8a7932d..4178391afae7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineStatusCodeCount.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineStatusCodeCount.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineUnmanagedDataDisk.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineUnmanagedDataDisk.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineUnmanagedDataDisk.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineUnmanagedDataDisk.java index 8dc04b09fda5..d3f9ac2429f0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachineUnmanagedDataDisk.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachineUnmanagedDataDisk.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.management.resources.fluentcore.arm.models.ChildResource; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachines.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachines.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachines.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachines.java index aa85ef191916..2fd14e94fdfe 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/VirtualMachines.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/VirtualMachines.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; -import com.azure.management.compute.implementation.ComputeManager; -import com.azure.management.compute.models.VirtualMachinesInner; +import com.azure.management.compute.ComputeManager; +import com.azure.management.compute.fluent.VirtualMachinesClient; import com.azure.management.resources.fluentcore.arm.collection.SupportsBatchDeletion; import com.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; import com.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; @@ -31,7 +31,7 @@ public interface VirtualMachines SupportsBatchCreation, SupportsBatchDeletion, HasManager, - HasInner { + HasInner { /** @return available virtual machine sizes */ VirtualMachineSizes sizes(); diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WinRMConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WinRMConfiguration.java similarity index 97% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/WinRMConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WinRMConfiguration.java index fcefaf2006dc..a6fce0fa2699 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WinRMConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WinRMConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WinRMListener.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WinRMListener.java similarity index 98% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/WinRMListener.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WinRMListener.java index 1af1d556d9de..78cb1b26a2d8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WinRMListener.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WinRMListener.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WindowsConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WindowsConfiguration.java similarity index 99% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/WindowsConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WindowsConfiguration.java index e046886c62c0..89c056c2658f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WindowsConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WindowsConfiguration.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.management.compute; +package com.azure.management.compute.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WindowsVMDiskEncryptionConfiguration.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WindowsVMDiskEncryptionConfiguration.java similarity index 96% rename from sdk/compute/mgmt/src/main/java/com/azure/management/compute/WindowsVMDiskEncryptionConfiguration.java rename to sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WindowsVMDiskEncryptionConfiguration.java index fb8ff85a7e84..03cb14de6b92 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/WindowsVMDiskEncryptionConfiguration.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/WindowsVMDiskEncryptionConfiguration.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.management.compute; +package com.azure.management.compute.models; /** Type representing encryption configuration to be applied to a Windows virtual machine. */ public class WindowsVMDiskEncryptionConfiguration diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/package-info.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/package-info.java index f0a71b70f549..57659cf4490c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/package-info.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/package-info.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. /** Package containing the implementations and inner classes for ComputeManagementClient. Compute Client. */ package com.azure.management.compute.models; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/package-info.java b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/package-info.java index 6b95cc5c1e82..5e779ed953f1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/management/compute/package-info.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/management/compute/package-info.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations and inner classes for ComputeManagementClient. Compute Client. */ +/** Package containing the classes for ComputeManagementClient. Compute Client. */ package com.azure.management.compute; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeManagementTest.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeManagementTest.java index 8c0c3b3aadf0..db62c3291f2a 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeManagementTest.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeManagementTest.java @@ -4,7 +4,6 @@ package com.azure.management.compute; import com.azure.core.http.HttpPipeline; -import com.azure.management.compute.implementation.ComputeManager; import com.azure.management.graphrbac.implementation.GraphRbacManager; import com.azure.management.keyvault.implementation.KeyVaultManager; import com.azure.management.network.LoadBalancer; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeSkuTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeSkuTests.java index 5d8787ed6802..8e7402503298 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeSkuTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeSkuTests.java @@ -5,6 +5,9 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.ComputeResourceType; +import com.azure.management.compute.models.ComputeSku; +import com.azure.management.compute.models.EncryptionStatus; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeUsageOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeUsageOperationsTests.java index 51b20939bf1d..28857e5acd58 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeUsageOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ComputeUsageOperationsTests.java @@ -4,6 +4,7 @@ package com.azure.management.compute; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.ComputeUsage; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import org.junit.jupiter.api.Assertions; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ManagedDiskOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ManagedDiskOperationsTests.java index 84bb77389cdc..44c2ad92a29a 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ManagedDiskOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/ManagedDiskOperationsTests.java @@ -5,6 +5,12 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.CreationSourceType; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskCreateOption; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.Snapshot; +import com.azure.management.compute.models.SnapshotSkuType; import com.azure.management.resources.ResourceGroup; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/SharedGalleryImageTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/SharedGalleryImageTests.java index e338168b9ad6..186be2a74572 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/SharedGalleryImageTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/SharedGalleryImageTests.java @@ -5,7 +5,19 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.Gallery; +import com.azure.management.compute.models.GalleryImage; +import com.azure.management.compute.models.GalleryImageVersion; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemStateTypes; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.TargetRegion; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineAvailabilityZoneOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineAvailabilityZoneOperationsTests.java index 4867553e3fa3..03d0004b595c 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineAvailabilityZoneOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineAvailabilityZoneOperationsTests.java @@ -4,6 +4,13 @@ package com.azure.management.compute; import com.azure.core.http.HttpPipeline; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.ProximityPlacementGroupType; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.LoadBalancerFrontend; import com.azure.management.network.LoadBalancerPublicFrontend; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineBootDiagnosticsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineBootDiagnosticsTests.java index eb4475695766..d94d466eb963 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineBootDiagnosticsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineBootDiagnosticsTests.java @@ -4,6 +4,9 @@ package com.azure.management.compute; import com.azure.core.http.HttpPipeline; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.Creatable; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineCustomImageOperationsTest.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineCustomImageOperationsTest.java index effafde80c91..2e15a975e072 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineCustomImageOperationsTest.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineCustomImageOperationsTest.java @@ -5,7 +5,18 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.HyperVGenerationTypes; +import com.azure.management.compute.models.ImageDataDisk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemStateTypes; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java index f5869ea45acc..8ec97b3cc8a4 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEMSILMSIOperationsTests.java @@ -5,7 +5,9 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.graphrbac.RoleAssignment; import com.azure.management.msi.Identity; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEncryptionOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEncryptionOperationsTests.java index 2c63b3f7e9cd..9770ed5b2b57 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEncryptionOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineEncryptionOperationsTests.java @@ -4,6 +4,11 @@ package com.azure.management.compute; import com.azure.core.http.HttpPipeline; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.DiskVolumeEncryptionMonitor; +import com.azure.management.compute.models.EncryptionStatus; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import org.junit.jupiter.api.Assertions; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionImageOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionImageOperationsTests.java index c20c77d77427..a40e2de5abee 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionImageOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionImageOperationsTests.java @@ -4,6 +4,13 @@ package com.azure.management.compute; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachineExtensionImage; +import com.azure.management.compute.models.VirtualMachineExtensionImageType; +import com.azure.management.compute.models.VirtualMachineExtensionImageTypes; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersion; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersions; +import com.azure.management.compute.models.VirtualMachinePublisher; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import org.junit.jupiter.api.Assertions; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionOperationsTests.java index 9b4807132a4d..dd1750c5819c 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineExtensionOperationsTests.java @@ -5,6 +5,10 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineExtension; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.azure.management.storage.models.StorageAccount; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineImageOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineImageOperationsTests.java index 0a316f9aca19..765bfc3f7b22 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineImageOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineImageOperationsTests.java @@ -4,6 +4,11 @@ package com.azure.management.compute; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.DataDiskImage; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineOffer; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.models.VirtualMachineSku; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import org.junit.jupiter.api.Assertions; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedDiskOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedDiskOperationsTests.java index bbc63e625f64..44dda37d758f 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedDiskOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedDiskOperationsTests.java @@ -4,6 +4,19 @@ package com.azure.management.compute; import com.azure.core.http.HttpPipeline; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.ImageDataDisk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemStateTypes; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.ResourceGroup; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.Creatable; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java index 073a1b9471cb..ae9efdd81b23 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineManagedServiceIdentityOperationsTests.java @@ -5,6 +5,11 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.graphrbac.RoleAssignment; import com.azure.management.resources.ResourceGroup; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineOperationsTests.java index 2ff63e377552..7d8003977fed 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineOperationsTests.java @@ -6,6 +6,20 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.exception.ManagementException; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.PowerState; +import com.azure.management.compute.models.ProximityPlacementGroupType; +import com.azure.management.compute.models.RunCommandInputParameter; +import com.azure.management.compute.models.RunCommandResult; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineEvictionPolicyTypes; +import com.azure.management.compute.models.VirtualMachineInstanceView; +import com.azure.management.compute.models.VirtualMachinePriorityTypes; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; import com.azure.management.network.NetworkSecurityGroup; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineRelatedResourcesDeletionTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineRelatedResourcesDeletionTests.java index 2364ce48a493..831b211f7d73 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineRelatedResourcesDeletionTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineRelatedResourcesDeletionTests.java @@ -5,6 +5,10 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.exception.ManagementException; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; import com.azure.management.network.PublicIpAddress; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetBootDiagnosticsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetBootDiagnosticsTests.java index 269b3e853f31..9fc92bd6c765 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetBootDiagnosticsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetBootDiagnosticsTests.java @@ -4,7 +4,10 @@ package com.azure.management.compute; import com.azure.core.http.HttpPipeline; -import com.azure.management.compute.models.VirtualMachineScaleSetInner; +import com.azure.management.compute.fluent.inner.VirtualMachineScaleSetInner; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.LoadBalancerSkuType; import com.azure.management.network.Network; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java index 7f5d3399d0b0..d3a90283f813 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetEMSILMSIOperationsTests.java @@ -5,7 +5,10 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.graphrbac.RoleAssignment; import com.azure.management.msi.Identity; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetManagedDiskOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetManagedDiskOperationsTests.java index c61d38b8bb27..d6ebceeb5a1d 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetManagedDiskOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetManagedDiskOperationsTests.java @@ -5,6 +5,18 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.VirtualMachineScaleSetVM; +import com.azure.management.compute.models.VirtualMachineScaleSetVMs; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.Network; import com.azure.management.resources.ResourceGroup; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetOperationsTests.java index 21b68426dbcf..eb4594d77d94 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/VirtualMachineScaleSetOperationsTests.java @@ -11,6 +11,23 @@ import com.azure.core.http.netty.NettyAsyncHttpClientBuilder; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.SubResource; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.PowerState; +import com.azure.management.compute.models.ResourceIdentityType; +import com.azure.management.compute.models.Sku; +import com.azure.management.compute.models.UpgradeMode; +import com.azure.management.compute.models.VaultCertificate; +import com.azure.management.compute.models.VaultSecretGroup; +import com.azure.management.compute.models.VirtualMachineEvictionPolicyTypes; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.models.VirtualMachinePriorityTypes; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetExtension; +import com.azure.management.compute.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.VirtualMachineScaleSetVM; +import com.azure.management.compute.models.VirtualMachineScaleSetVMs; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.graphrbac.RoleAssignment; import com.azure.management.keyvault.Secret; diff --git a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/implementation/SerializationTests.java b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/implementation/SerializationTests.java index a869a6eba3f7..bbe2bc054807 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/management/compute/implementation/SerializationTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/management/compute/implementation/SerializationTests.java @@ -4,9 +4,9 @@ import com.azure.core.management.serializer.AzureJacksonAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.management.compute.VirtualMachineIdentity; -import com.azure.management.compute.VirtualMachineIdentityUserAssignedIdentities; -import com.azure.management.compute.models.VirtualMachineInner; +import com.azure.management.compute.models.VirtualMachineIdentity; +import com.azure.management.compute.models.VirtualMachineIdentityUserAssignedIdentities; +import com.azure.management.compute.fluent.inner.VirtualMachineInner; import java.io.IOException; import java.util.HashMap; import java.util.Map; diff --git a/sdk/management/azure/src/main/java/com/azure/management/Azure.java b/sdk/management/azure/src/main/java/com/azure/management/Azure.java index 407e623de5f7..de52baeeac78 100644 --- a/sdk/management/azure/src/main/java/com/azure/management/Azure.java +++ b/sdk/management/azure/src/main/java/com/azure/management/Azure.java @@ -13,19 +13,19 @@ import com.azure.management.appservice.FunctionApps; import com.azure.management.appservice.WebApps; import com.azure.management.appservice.implementation.AppServiceManager; -import com.azure.management.compute.AvailabilitySets; -import com.azure.management.compute.ComputeSkus; -import com.azure.management.compute.ComputeUsages; -import com.azure.management.compute.Disks; -import com.azure.management.compute.Galleries; -import com.azure.management.compute.GalleryImageVersions; -import com.azure.management.compute.GalleryImages; -import com.azure.management.compute.Snapshots; -import com.azure.management.compute.VirtualMachineCustomImages; -import com.azure.management.compute.VirtualMachineImages; -import com.azure.management.compute.VirtualMachineScaleSets; -import com.azure.management.compute.VirtualMachines; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.models.AvailabilitySets; +import com.azure.management.compute.models.ComputeSkus; +import com.azure.management.compute.models.ComputeUsages; +import com.azure.management.compute.models.Disks; +import com.azure.management.compute.models.Galleries; +import com.azure.management.compute.models.GalleryImageVersions; +import com.azure.management.compute.models.GalleryImages; +import com.azure.management.compute.models.Snapshots; +import com.azure.management.compute.models.VirtualMachineCustomImages; +import com.azure.management.compute.models.VirtualMachineImages; +import com.azure.management.compute.models.VirtualMachineScaleSets; +import com.azure.management.compute.models.VirtualMachines; +import com.azure.management.compute.ComputeManager; import com.azure.management.containerregistry.Registries; import com.azure.management.containerregistry.RegistryTaskRuns; import com.azure.management.containerregistry.RegistryTasks; diff --git a/sdk/management/azure/src/test/java/com/azure/management/ApplicationGatewayTests.java b/sdk/management/azure/src/test/java/com/azure/management/ApplicationGatewayTests.java index a4a22ade32b1..f7b78b04864f 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/ApplicationGatewayTests.java +++ b/sdk/management/azure/src/test/java/com/azure/management/ApplicationGatewayTests.java @@ -4,8 +4,8 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.exception.ManagementException; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.network.ApplicationGateway; import com.azure.management.network.ApplicationGatewayBackend; import com.azure.management.network.ApplicationGatewayBackendHealth; diff --git a/sdk/management/azure/src/test/java/com/azure/management/AzureTests.java b/sdk/management/azure/src/test/java/com/azure/management/AzureTests.java index e554fa4fb7bc..04e30d50708c 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/AzureTests.java +++ b/sdk/management/azure/src/test/java/com/azure/management/AzureTests.java @@ -5,15 +5,15 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.exception.ManagementException; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.PowerState; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineImage; -import com.azure.management.compute.VirtualMachineOffer; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachineSku; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.PowerState; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineOffer; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineSku; import com.azure.management.msi.implementation.MSIManager; import com.azure.management.network.Access; import com.azure.management.network.ConnectionMonitor; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestAvailabilitySet.java b/sdk/management/azure/src/test/java/com/azure/management/TestAvailabilitySet.java index 71798ffb7d33..052dc14432e8 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestAvailabilitySet.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestAvailabilitySet.java @@ -3,9 +3,9 @@ package com.azure.management; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySets; -import com.azure.management.compute.VirtualMachineSize; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySets; +import com.azure.management.compute.models.VirtualMachineSize; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import org.junit.jupiter.api.Assertions; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestLoadBalancer.java b/sdk/management/azure/src/test/java/com/azure/management/TestLoadBalancer.java index a3fee24b12bb..a2a9c153ec9d 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestLoadBalancer.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestLoadBalancer.java @@ -2,12 +2,12 @@ // Licensed under the MIT License. package com.azure.management; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.ComputeManager; import com.azure.management.network.IpAllocationMethod; import com.azure.management.network.LoadBalancer; import com.azure.management.network.LoadBalancerBackend; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestNetworkWatcher.java b/sdk/management/azure/src/test/java/com/azure/management/TestNetworkWatcher.java index 8b4d1f7b9355..d4fadfb8892e 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestNetworkWatcher.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestNetworkWatcher.java @@ -3,10 +3,10 @@ package com.azure.management; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; import com.azure.management.network.NetworkInterfaces; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestResourceStreaming.java b/sdk/management/azure/src/test/java/com/azure/management/TestResourceStreaming.java index 64a8534ade3b..a24f96c437ce 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestResourceStreaming.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestResourceStreaming.java @@ -3,10 +3,10 @@ package com.azure.management; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.resources.ResourceGroup; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.arm.models.Resource; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestUtils.java b/sdk/management/azure/src/test/java/com/azure/management/TestUtils.java index 735dea496d8b..6080093450c8 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestUtils.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestUtils.java @@ -3,8 +3,8 @@ package com.azure.management; -import com.azure.management.compute.DataDisk; -import com.azure.management.compute.VirtualMachine; +import com.azure.management.compute.models.DataDisk; +import com.azure.management.compute.models.VirtualMachine; /** Test utilities. */ public final class TestUtils { diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachine.java b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachine.java index 601c3e5da9ec..45fe7999e21c 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachine.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachine.java @@ -3,12 +3,12 @@ package com.azure.management; -import com.azure.management.compute.Disk; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.Indexable; import com.google.common.util.concurrent.SettableFuture; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineCustomData.java b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineCustomData.java index c09c93819f8e..9af740dada41 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineCustomData.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineCustomData.java @@ -3,10 +3,10 @@ package com.azure.management; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.network.PublicIpAddress; import com.azure.management.network.PublicIpAddresses; import com.azure.management.resources.core.TestBase; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineDataDisk.java b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineDataDisk.java index cf15bc761adc..e2c56e3cfb96 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineDataDisk.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineDataDisk.java @@ -3,12 +3,12 @@ package com.azure.management; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachineUnmanagedDataDisk; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.resources.fluentcore.arm.Region; import org.junit.jupiter.api.Assertions; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineInAvailabilitySet.java b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineInAvailabilitySet.java index def412c47e94..6c9614275d7a 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineInAvailabilitySet.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineInAvailabilitySet.java @@ -3,10 +3,10 @@ package com.azure.management; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.resources.fluentcore.arm.Region; import org.junit.jupiter.api.Assertions; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineNics.java b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineNics.java index 5922f249336f..73d543db1b67 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineNics.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineNics.java @@ -3,10 +3,10 @@ package com.azure.management; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; import com.azure.management.network.PublicIpAddress; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSizes.java b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSizes.java index 0a56337fabae..155a9716e406 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSizes.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSizes.java @@ -4,10 +4,10 @@ package com.azure.management; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSize; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSize; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import org.junit.jupiter.api.Assertions; diff --git a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSsh.java b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSsh.java index a0f352f55db4..eabb74799bda 100644 --- a/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSsh.java +++ b/sdk/management/azure/src/test/java/com/azure/management/TestVirtualMachineSsh.java @@ -3,10 +3,10 @@ package com.azure.management; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachines; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachines; import com.azure.management.network.PublicIpAddress; import com.azure.management.network.PublicIpAddresses; import com.azure.management.resources.core.TestBase; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ConvertVirtualMachineToManagedDisks.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ConvertVirtualMachineToManagedDisks.java index 21b52c8bedc7..1f30436911fd 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ConvertVirtualMachineToManagedDisks.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ConvertVirtualMachineToManagedDisks.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.azure.management.samples.Utils; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVHD.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVHD.java index 180eca6128c4..2d33bd208941 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVHD.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVHD.java @@ -8,17 +8,17 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.jcraft.jsch.JSchException; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.OperatingSystemStateTypes; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.OperatingSystemStateTypes; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.samples.SSHShell; import com.azure.management.samples.Utils; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVM.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVM.java index 42c407b3e569..45e79942aed1 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVM.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingCustomImageFromVM.java @@ -10,13 +10,13 @@ import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.jcraft.jsch.JSchException; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.samples.SSHShell; import com.azure.management.samples.Utils; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromSnapshot.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromSnapshot.java index 495c677fd780..280efd6fbd18 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromSnapshot.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromSnapshot.java @@ -8,15 +8,15 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.Snapshot; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.Snapshot; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.azure.management.samples.Utils; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromVhd.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromVhd.java index 57fa03542988..6e2d3d9bab16 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromVhd.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachineUsingSpecializedDiskFromVhd.java @@ -8,15 +8,15 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineSizeTypes; -import com.azure.management.compute.VirtualMachineUnmanagedDataDisk; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.azure.management.samples.Utils; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesAsyncTrackingRelatedResources.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesAsyncTrackingRelatedResources.java index 84973d8e57ab..b04b9768f72f 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesAsyncTrackingRelatedResources.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesAsyncTrackingRelatedResources.java @@ -9,10 +9,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; import com.azure.management.network.PublicIpAddress; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesInParallel.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesInParallel.java index 3441d7ed6338..fa2625330b1e 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesInParallel.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesInParallel.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.PublicIpAddress; import com.azure.management.resources.ResourceGroup; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java index 5f48006e9d8f..343a527f1541 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/CreateVirtualMachinesUsingCustomImageOrSpecializedVHD.java @@ -8,10 +8,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.azure.management.samples.SSHShell; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListComputeSkus.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListComputeSkus.java index cb65585e3b74..d5bf8d7e37e2 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListComputeSkus.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListComputeSkus.java @@ -9,8 +9,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.ComputeResourceType; -import com.azure.management.compute.ComputeSku; +import com.azure.management.compute.models.ComputeResourceType; +import com.azure.management.compute.models.ComputeSku; import com.azure.management.resources.fluentcore.arm.AvailabilityZoneId; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineExtensionImages.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineExtensionImages.java index a79ed9bab867..d9302d0918c9 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineExtensionImages.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineExtensionImages.java @@ -9,10 +9,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.VirtualMachineExtensionImage; -import com.azure.management.compute.VirtualMachineExtensionImageType; -import com.azure.management.compute.VirtualMachineExtensionImageVersion; -import com.azure.management.compute.VirtualMachinePublisher; +import com.azure.management.compute.models.VirtualMachineExtensionImage; +import com.azure.management.compute.models.VirtualMachineExtensionImageType; +import com.azure.management.compute.models.VirtualMachineExtensionImageVersion; +import com.azure.management.compute.models.VirtualMachinePublisher; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineImages.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineImages.java index c1f7d5fdc301..e45d663e8318 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineImages.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ListVirtualMachineImages.java @@ -9,10 +9,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.VirtualMachineImage; -import com.azure.management.compute.VirtualMachineOffer; -import com.azure.management.compute.VirtualMachinePublisher; -import com.azure.management.compute.VirtualMachineSku; +import com.azure.management.compute.models.VirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineOffer; +import com.azure.management.compute.models.VirtualMachinePublisher; +import com.azure.management.compute.models.VirtualMachineSku; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageAvailabilitySet.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageAvailabilitySet.java index 91c05a3fbd9a..7fd386a730bf 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageAvailabilitySet.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageAvailabilitySet.java @@ -8,12 +8,12 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.Creatable; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageManagedDisks.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageManagedDisks.java index 11167a7a7557..96f618595795 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageManagedDisks.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageManagedDisks.java @@ -10,18 +10,18 @@ import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.jcraft.jsch.JSchException; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.OperatingSystemTypes; -import com.azure.management.compute.Snapshot; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.OperatingSystemTypes; +import com.azure.management.compute.models.Snapshot; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.Network; import com.azure.management.network.PublicIpAddress; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageResourceFromMSIEnabledVirtualMachineBelongsToAADGroup.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageResourceFromMSIEnabledVirtualMachineBelongsToAADGroup.java index 2a5043bc7ac4..839947727317 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageResourceFromMSIEnabledVirtualMachineBelongsToAADGroup.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageResourceFromMSIEnabledVirtualMachineBelongsToAADGroup.java @@ -8,10 +8,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.graphrbac.ActiveDirectoryGroup; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.resources.ResourceGroup; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageScaleSetUserAssignedMSIFromServicePrincipal.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageScaleSetUserAssignedMSIFromServicePrincipal.java index f03c00d052b9..ec52716eb594 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageScaleSetUserAssignedMSIFromServicePrincipal.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageScaleSetUserAssignedMSIFromServicePrincipal.java @@ -12,10 +12,10 @@ import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.ComputeManager; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.graphrbac.ServicePrincipal; import com.azure.management.msi.Identity; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageStorageFromMSIEnabledVirtualMachine.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageStorageFromMSIEnabledVirtualMachine.java index 7c55ec813977..0c1ad8c8e117 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageStorageFromMSIEnabledVirtualMachine.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageStorageFromMSIEnabledVirtualMachine.java @@ -8,10 +8,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java index 11681dfbd201..75a9b859fbd7 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageUserAssignedMSIEnabledVirtualMachine.java @@ -9,11 +9,11 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.RunCommandInput; -import com.azure.management.compute.RunCommandResult; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.RunCommandInput; +import com.azure.management.compute.models.RunCommandResult; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.graphrbac.BuiltInRole; import com.azure.management.msi.Identity; import com.azure.management.resources.ResourceGroup; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachine.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachine.java index d8caf41d1de0..ad13887d9279 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachine.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachine.java @@ -8,11 +8,11 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.Disk; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.Creatable; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineAsync.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineAsync.java index 87066d687f48..6f3a2a23ca4b 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineAsync.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineAsync.java @@ -8,11 +8,11 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.Disk; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.Creatable; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineExtension.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineExtension.java index a345666a298c..2108807a8e27 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineExtension.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineExtension.java @@ -8,10 +8,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; import com.azure.management.samples.Utils; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSet.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSet.java index 4820325ad449..de44ad7044f1 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSet.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSet.java @@ -9,17 +9,17 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.ImageReference; -import com.azure.management.compute.StorageAccountTypes; -import com.azure.management.compute.VirtualMachineScaleSetVM; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.ImageReference; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.VirtualMachineScaleSetVM; import com.azure.management.network.LoadBalancerInboundNatRule; import com.azure.management.network.Network; import com.azure.management.network.PublicIpAddress; import com.azure.management.network.LoadBalancer; import com.azure.management.network.TransportProtocol; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; import com.azure.management.network.VirtualMachineScaleSetNetworkInterface; import com.azure.management.network.VirtualMachineScaleSetNicIpConfiguration; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetAsync.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetAsync.java index ad04873e5cb9..fded6b3f3bac 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetAsync.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetAsync.java @@ -8,11 +8,11 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.StorageAccountTypes; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.StorageAccountTypes; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.LoadBalancerInboundNatRule; import com.azure.management.network.Network; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetWithUnmanagedDisks.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetWithUnmanagedDisks.java index 986773feacb3..f2936558f443 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetWithUnmanagedDisks.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineScaleSetWithUnmanagedDisks.java @@ -9,15 +9,15 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.ImageReference; -import com.azure.management.compute.VirtualMachineScaleSetVM; +import com.azure.management.compute.models.ImageReference; +import com.azure.management.compute.models.VirtualMachineScaleSetVM; import com.azure.management.network.LoadBalancerInboundNatRule; import com.azure.management.network.Network; import com.azure.management.network.PublicIpAddress; import com.azure.management.network.LoadBalancer; import com.azure.management.network.TransportProtocol; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; import com.azure.management.network.VirtualMachineScaleSetNetworkInterface; import com.azure.management.network.VirtualMachineScaleSetNicIpConfiguration; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithDisk.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithDisk.java index a8e5e3606dd6..2aafafa41183 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithDisk.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithDisk.java @@ -8,13 +8,13 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.Disk; -import com.azure.management.compute.DiskSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineDataDisk; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.DiskSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.model.Creatable; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithUnmanagedDisks.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithUnmanagedDisks.java index b1aefb90ba4a..4466bbe223e7 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithUnmanagedDisks.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachineWithUnmanagedDisks.java @@ -8,12 +8,12 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.CachingTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineUnmanagedDataDisk; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.CachingTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineUnmanagedDataDisk; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachinesInParallel.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachinesInParallel.java index 032cf1a0eda6..65753fa281cd 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachinesInParallel.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageVirtualMachinesInParallel.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.resources.ResourceGroup; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachine.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachine.java index ebbcccd1c54f..0f3f1a7c9ede 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachine.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachine.java @@ -8,10 +8,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.Disk; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.Disk; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.PublicIpAddress; import com.azure.management.network.PublicIPSkuType; import com.azure.management.resources.fluentcore.arm.AvailabilityZoneId; diff --git a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachineScaleSet.java b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachineScaleSet.java index d65957c07c62..027c45d48298 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachineScaleSet.java +++ b/sdk/management/samples/src/main/java/com/azure/management/compute/samples/ManageZonalVirtualMachineScaleSet.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachineScaleSet; -import com.azure.management.compute.VirtualMachineScaleSetSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachineScaleSet; +import com.azure.management.compute.models.VirtualMachineScaleSetSkuTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.LoadBalancerSkuType; import com.azure.management.network.Network; diff --git a/sdk/management/samples/src/main/java/com/azure/management/dns/samples/ManageDns.java b/sdk/management/samples/src/main/java/com/azure/management/dns/samples/ManageDns.java index fb017fc10328..2f21df84d556 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/dns/samples/ManageDns.java +++ b/sdk/management/samples/src/main/java/com/azure/management/dns/samples/ManageDns.java @@ -12,9 +12,9 @@ import com.azure.management.appservice.PricingTier; import com.azure.management.appservice.CustomHostnameDnsRecordType; import com.azure.management.appservice.WebApp; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.dns.ARecordSet; import com.azure.management.dns.CNameRecordSet; import com.azure.management.dns.DnsRecordSet; diff --git a/sdk/management/samples/src/main/java/com/azure/management/graphrbac/samples/ManageServicePrincipal.java b/sdk/management/samples/src/main/java/com/azure/management/graphrbac/samples/ManageServicePrincipal.java index c441278925c8..8a2bdcb86e41 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/graphrbac/samples/ManageServicePrincipal.java +++ b/sdk/management/samples/src/main/java/com/azure/management/graphrbac/samples/ManageServicePrincipal.java @@ -8,7 +8,7 @@ //import com.azure.core.management.AzureEnvironment; //import com.azure.identity.DefaultAzureCredentialBuilder; //import com.azure.management.Azure; -//import com.azure.management.compute.VirtualMachine; +//import com.azure.management.compute.models.VirtualMachine; //import com.azure.management.graphrbac.ActiveDirectoryApplication; //import com.azure.management.graphrbac.BuiltInRole; //import com.azure.management.graphrbac.ServicePrincipal; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/CreateSimpleInternetFacingLoadBalancer.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/CreateSimpleInternetFacingLoadBalancer.java index 283fc1f86ae3..c01d547de271 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/CreateSimpleInternetFacingLoadBalancer.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/CreateSimpleInternetFacingLoadBalancer.java @@ -9,11 +9,11 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.Network; import com.azure.management.network.TransportProtocol; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageApplicationGateway.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageApplicationGateway.java index 05068f5f590d..b935702deb3e 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageApplicationGateway.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageApplicationGateway.java @@ -9,9 +9,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.ApplicationGateway; import com.azure.management.network.Network; import com.azure.management.network.PublicIpAddress; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageIPAddress.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageIPAddress.java index 156490d75b7b..e35b85374848 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageIPAddress.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageIPAddress.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.NetworkInterface; import com.azure.management.network.PublicIpAddress; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternalLoadBalancer.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternalLoadBalancer.java index 4edadbb7ded5..0ed79e7965aa 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternalLoadBalancer.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternalLoadBalancer.java @@ -9,11 +9,11 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternetFacingLoadBalancer.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternetFacingLoadBalancer.java index b4fb063e115f..3ef699ec9939 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternetFacingLoadBalancer.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageInternetFacingLoadBalancer.java @@ -9,11 +9,11 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.AvailabilitySetSkuTypes; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.AvailabilitySetSkuTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.LoadBalancer; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkInterface.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkInterface.java index f127128fc035..8694c86bce31 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkInterface.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkInterface.java @@ -9,9 +9,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkSecurityGroup.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkSecurityGroup.java index 832f690d114f..a726edf94bb5 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkSecurityGroup.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkSecurityGroup.java @@ -9,9 +9,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.NetworkInterface; import com.azure.management.network.NetworkSecurityGroup; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkWatcher.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkWatcher.java index 6315c2685033..15e0799ba5f4 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkWatcher.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageNetworkWatcher.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Direction; import com.azure.management.network.FlowLogSettings; import com.azure.management.network.IpFlowProtocol; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java index 15b3ce9a1e4a..cf646c71a0dd 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualMachinesInParallelWithNetwork.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.NetworkSecurityGroup; import com.azure.management.network.SecurityRuleProtocol; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetwork.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetwork.java index da5dc35975c6..ca2ee9bbfa2d 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetwork.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetwork.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.NetworkSecurityGroup; import com.azure.management.network.SecurityRuleProtocol; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetworkAsync.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetworkAsync.java index cc2f23d7be87..58a93040cb2f 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetworkAsync.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVirtualNetworkAsync.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.NetworkSecurityGroup; import com.azure.management.network.SecurityRuleProtocol; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVpnGatewayVNet2VNetConnection.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVpnGatewayVNet2VNetConnection.java index 641118b0f8cc..b31b44163727 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVpnGatewayVNet2VNetConnection.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/ManageVpnGatewayVNet2VNetConnection.java @@ -8,8 +8,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.network.ConnectivityCheck; import com.azure.management.network.Network; import com.azure.management.network.NetworkWatcher; diff --git a/sdk/management/samples/src/main/java/com/azure/management/network/samples/VerifyNetworkPeeringWithNetworkWatcher.java b/sdk/management/samples/src/main/java/com/azure/management/network/samples/VerifyNetworkPeeringWithNetworkWatcher.java index 4c78f18e55d1..684bbc537ebc 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/network/samples/VerifyNetworkPeeringWithNetworkWatcher.java +++ b/sdk/management/samples/src/main/java/com/azure/management/network/samples/VerifyNetworkPeeringWithNetworkWatcher.java @@ -8,8 +8,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.network.ConnectivityCheck; import com.azure.management.network.Network; import com.azure.management.network.NetworkPeering; diff --git a/sdk/management/samples/src/main/java/com/azure/management/samples/DockerUtils.java b/sdk/management/samples/src/main/java/com/azure/management/samples/DockerUtils.java index cfc24dbc60b0..4f6227c10693 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/samples/DockerUtils.java +++ b/sdk/management/samples/src/main/java/com/azure/management/samples/DockerUtils.java @@ -4,9 +4,9 @@ package com.azure.management.samples; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.NicIpConfiguration; import com.azure.management.network.PublicIpAddress; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/management/samples/src/main/java/com/azure/management/samples/Utils.java b/sdk/management/samples/src/main/java/com/azure/management/samples/Utils.java index 24117e7f5192..339ccd3f4087 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/samples/Utils.java +++ b/sdk/management/samples/src/main/java/com/azure/management/samples/Utils.java @@ -33,12 +33,12 @@ import com.azure.management.appservice.PublishingProfile; import com.azure.management.appservice.SslState; import com.azure.management.appservice.WebAppBase; -import com.azure.management.compute.AvailabilitySet; -import com.azure.management.compute.DataDisk; -import com.azure.management.compute.ImageDataDisk; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineCustomImage; -import com.azure.management.compute.VirtualMachineExtension; +import com.azure.management.compute.models.AvailabilitySet; +import com.azure.management.compute.models.DataDisk; +import com.azure.management.compute.models.ImageDataDisk; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineCustomImage; +import com.azure.management.compute.models.VirtualMachineExtension; import com.azure.management.containerregistry.AccessKeyType; import com.azure.management.containerregistry.Registry; import com.azure.management.containerregistry.RegistryCredentials; diff --git a/sdk/management/samples/src/main/java/com/azure/management/sql/samples/ManageSqlDatabasesAcrossDifferentDataCenters.java b/sdk/management/samples/src/main/java/com/azure/management/sql/samples/ManageSqlDatabasesAcrossDifferentDataCenters.java index 8add45edd6af..fe90a87aa09e 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/sql/samples/ManageSqlDatabasesAcrossDifferentDataCenters.java +++ b/sdk/management/samples/src/main/java/com/azure/management/sql/samples/ManageSqlDatabasesAcrossDifferentDataCenters.java @@ -9,9 +9,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownWindowsVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownWindowsVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.PublicIpAddress; import com.azure.management.resources.fluentcore.arm.Region; diff --git a/sdk/management/samples/src/main/java/com/azure/management/storage/samples/ManageStorageAccountNetworkRules.java b/sdk/management/samples/src/main/java/com/azure/management/storage/samples/ManageStorageAccountNetworkRules.java index 6b1ca4222598..9941b380afdd 100644 --- a/sdk/management/samples/src/main/java/com/azure/management/storage/samples/ManageStorageAccountNetworkRules.java +++ b/sdk/management/samples/src/main/java/com/azure/management/storage/samples/ManageStorageAccountNetworkRules.java @@ -8,9 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.management.Azure; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; -import com.azure.management.compute.VirtualMachineSizeTypes; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; +import com.azure.management.compute.models.VirtualMachineSizeTypes; import com.azure.management.network.Network; import com.azure.management.network.PublicIpAddress; import com.azure.management.network.ServiceEndpointType; diff --git a/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/AlertsTests.java b/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/AlertsTests.java index 75529cfa730f..c663257968c6 100644 --- a/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/AlertsTests.java +++ b/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/AlertsTests.java @@ -5,8 +5,8 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; -import com.azure.management.compute.KnownLinuxVirtualMachineImage; -import com.azure.management.compute.VirtualMachine; +import com.azure.management.compute.models.KnownLinuxVirtualMachineImage; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.resources.core.TestUtilities; import com.azure.management.resources.fluentcore.arm.Region; import com.azure.management.resources.fluentcore.profile.AzureProfile; diff --git a/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorActivityAndMetricsTests.java b/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorActivityAndMetricsTests.java index 240caa0a6d30..e523596bc419 100644 --- a/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorActivityAndMetricsTests.java +++ b/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorActivityAndMetricsTests.java @@ -5,7 +5,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.exception.ManagementException; -import com.azure.management.compute.VirtualMachine; +import com.azure.management.compute.models.VirtualMachine; import com.azure.management.resources.core.TestUtilities; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; diff --git a/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorManagementTest.java b/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorManagementTest.java index cf155c522735..3ce3af397ff1 100644 --- a/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorManagementTest.java +++ b/sdk/monitor/mgmt/src/test/java/com/azure/management/monitor/MonitorManagementTest.java @@ -5,7 +5,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.management.appservice.implementation.AppServiceManager; -import com.azure.management.compute.implementation.ComputeManager; +import com.azure.management.compute.ComputeManager; // import com.azure.management.eventhub.implementation.EventHubManager; import com.azure.management.monitor.implementation.MonitorManager; import com.azure.management.resources.core.TestBase;