diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md index debcd7bec318..d7a7186e2d1c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-02-22) +- Azure Resource Manager DevTestLabs client library for Java. This package contains Microsoft Azure SDK for DevTestLabs Management SDK. The DevTest Labs Client. Package tag package-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-15) diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md index 889ade30fe18..c45594670d14 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DevTestLabs client library for Java. -This package contains Microsoft Azure SDK for DevTestLabs Management SDK. The DevTest Labs Client. Package tag package-2018-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for DevTestLabs Management SDK. The DevTest Labs Client. Package tag package-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-devtestlabs - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md new file mode 100644 index 000000000000..60c02f59e7a2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/SAMPLE.md @@ -0,0 +1,4678 @@ +# Code snippets and samples + + +## ArmTemplates + +- [Get](#armtemplates_get) +- [List](#armtemplates_list) + +## ArtifactSources + +- [CreateOrUpdate](#artifactsources_createorupdate) +- [Delete](#artifactsources_delete) +- [Get](#artifactsources_get) +- [List](#artifactsources_list) +- [Update](#artifactsources_update) + +## Artifacts + +- [GenerateArmTemplate](#artifacts_generatearmtemplate) +- [Get](#artifacts_get) +- [List](#artifacts_list) + +## BastionHosts + +- [CreateOrUpdate](#bastionhosts_createorupdate) +- [Delete](#bastionhosts_delete) +- [Get](#bastionhosts_get) +- [List](#bastionhosts_list) +- [Update](#bastionhosts_update) + +## Costs + +- [CreateOrUpdate](#costs_createorupdate) +- [Get](#costs_get) +- [List](#costs_list) + +## CustomImages + +- [CreateOrUpdate](#customimages_createorupdate) +- [Delete](#customimages_delete) +- [Get](#customimages_get) +- [List](#customimages_list) +- [Update](#customimages_update) + +## Disks + +- [Attach](#disks_attach) +- [CreateOrUpdate](#disks_createorupdate) +- [Delete](#disks_delete) +- [Detach](#disks_detach) +- [Get](#disks_get) +- [List](#disks_list) +- [Update](#disks_update) + +## Environments + +- [CreateOrUpdate](#environments_createorupdate) +- [Delete](#environments_delete) +- [Get](#environments_get) +- [List](#environments_list) +- [Update](#environments_update) + +## Formulas + +- [CreateOrUpdate](#formulas_createorupdate) +- [Delete](#formulas_delete) +- [Get](#formulas_get) +- [List](#formulas_list) +- [Update](#formulas_update) + +## GalleryImages + +- [Get](#galleryimages_get) +- [List](#galleryimages_list) + +## GlobalSchedules + +- [CreateOrUpdate](#globalschedules_createorupdate) +- [Delete](#globalschedules_delete) +- [Execute](#globalschedules_execute) +- [GetByResourceGroup](#globalschedules_getbyresourcegroup) +- [List](#globalschedules_list) +- [ListByResourceGroup](#globalschedules_listbyresourcegroup) +- [Retarget](#globalschedules_retarget) +- [Update](#globalschedules_update) + +## LabSecrets + +- [CreateOrUpdate](#labsecrets_createorupdate) +- [Delete](#labsecrets_delete) +- [Get](#labsecrets_get) +- [List](#labsecrets_list) +- [Update](#labsecrets_update) + +## Labs + +- [ClaimAnyVm](#labs_claimanyvm) +- [CreateEnvironment](#labs_createenvironment) +- [CreateOrUpdate](#labs_createorupdate) +- [Delete](#labs_delete) +- [EnsureCurrentUserProfile](#labs_ensurecurrentuserprofile) +- [ExportResourceUsage](#labs_exportresourceusage) +- [GenerateUploadUri](#labs_generateuploaduri) +- [GetByResourceGroup](#labs_getbyresourcegroup) +- [ImportVirtualMachine](#labs_importvirtualmachine) +- [List](#labs_list) +- [ListByResourceGroup](#labs_listbyresourcegroup) +- [ListVhds](#labs_listvhds) +- [Update](#labs_update) + +## NotificationChannels + +- [CreateOrUpdate](#notificationchannels_createorupdate) +- [Delete](#notificationchannels_delete) +- [Get](#notificationchannels_get) +- [List](#notificationchannels_list) +- [Notify](#notificationchannels_notify) +- [Update](#notificationchannels_update) + +## Operations + +- [Get](#operations_get) + +## Policies + +- [CreateOrUpdate](#policies_createorupdate) +- [Delete](#policies_delete) +- [Get](#policies_get) +- [List](#policies_list) +- [Update](#policies_update) + +## PolicySets + +- [EvaluatePolicies](#policysets_evaluatepolicies) +- [List](#policysets_list) + +## ProviderOperations + +- [List](#provideroperations_list) + +## Schedules + +- [CreateOrUpdate](#schedules_createorupdate) +- [Delete](#schedules_delete) +- [Execute](#schedules_execute) +- [Get](#schedules_get) +- [List](#schedules_list) +- [ListApplicable](#schedules_listapplicable) +- [Update](#schedules_update) + +## Secrets + +- [CreateOrUpdate](#secrets_createorupdate) +- [Delete](#secrets_delete) +- [Get](#secrets_get) +- [List](#secrets_list) +- [Update](#secrets_update) + +## ServiceFabricSchedules + +- [CreateOrUpdate](#servicefabricschedules_createorupdate) +- [Delete](#servicefabricschedules_delete) +- [Execute](#servicefabricschedules_execute) +- [Get](#servicefabricschedules_get) +- [List](#servicefabricschedules_list) +- [Update](#servicefabricschedules_update) + +## ServiceFabrics + +- [CreateOrUpdate](#servicefabrics_createorupdate) +- [Delete](#servicefabrics_delete) +- [Get](#servicefabrics_get) +- [List](#servicefabrics_list) +- [ListApplicableSchedules](#servicefabrics_listapplicableschedules) +- [Start](#servicefabrics_start) +- [Stop](#servicefabrics_stop) +- [Update](#servicefabrics_update) + +## ServiceRunners + +- [CreateOrUpdate](#servicerunners_createorupdate) +- [Delete](#servicerunners_delete) +- [Get](#servicerunners_get) +- [List](#servicerunners_list) + +## SharedGalleries + +- [CreateOrUpdate](#sharedgalleries_createorupdate) +- [Delete](#sharedgalleries_delete) +- [Get](#sharedgalleries_get) +- [List](#sharedgalleries_list) +- [Update](#sharedgalleries_update) + +## SharedImages + +- [CreateOrUpdate](#sharedimages_createorupdate) +- [Delete](#sharedimages_delete) +- [Get](#sharedimages_get) +- [List](#sharedimages_list) +- [Update](#sharedimages_update) + +## Users + +- [CreateOrUpdate](#users_createorupdate) +- [Delete](#users_delete) +- [Get](#users_get) +- [List](#users_list) +- [Update](#users_update) + +## VirtualMachineSchedules + +- [CreateOrUpdate](#virtualmachineschedules_createorupdate) +- [Delete](#virtualmachineschedules_delete) +- [Execute](#virtualmachineschedules_execute) +- [Get](#virtualmachineschedules_get) +- [List](#virtualmachineschedules_list) +- [Update](#virtualmachineschedules_update) + +## VirtualMachines + +- [AddDataDisk](#virtualmachines_adddatadisk) +- [ApplyArtifacts](#virtualmachines_applyartifacts) +- [Claim](#virtualmachines_claim) +- [ClearArtifactResults](#virtualmachines_clearartifactresults) +- [CreateOrUpdate](#virtualmachines_createorupdate) +- [Delete](#virtualmachines_delete) +- [DetachDataDisk](#virtualmachines_detachdatadisk) +- [Get](#virtualmachines_get) +- [GetRdpFileContents](#virtualmachines_getrdpfilecontents) +- [List](#virtualmachines_list) +- [ListApplicableSchedules](#virtualmachines_listapplicableschedules) +- [Redeploy](#virtualmachines_redeploy) +- [Resize](#virtualmachines_resize) +- [Restart](#virtualmachines_restart) +- [Start](#virtualmachines_start) +- [Stop](#virtualmachines_stop) +- [TransferDisks](#virtualmachines_transferdisks) +- [UnClaim](#virtualmachines_unclaim) +- [Update](#virtualmachines_update) + +## VirtualNetworks + +- [CreateOrUpdate](#virtualnetworks_createorupdate) +- [Delete](#virtualnetworks_delete) +- [Get](#virtualnetworks_get) +- [List](#virtualnetworks_list) +- [Update](#virtualnetworks_update) +### ArmTemplates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ArmTemplates Get. */ +public final class ArmTemplatesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArmTemplates_Get.json + */ + /** + * Sample code: ArmTemplates_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .getWithResponse( + "resourceGroupName", "{labName}", "{artifactSourceName}", "{armTemplateName}", Context.NONE); + } +} +``` + +### ArmTemplates_List + +```java +import com.azure.core.util.Context; + +/** Samples for ArmTemplates List. */ +public final class ArmTemplatesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArmTemplates_List.json + */ + /** + * Sample code: ArmTemplates_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, Context.NONE); + } +} +``` + +### ArtifactSources_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.SourceControlType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources CreateOrUpdate. */ +public final class ArtifactSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_CreateOrUpdate.json + */ + /** + * Sample code: ArtifactSources_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .define("{artifactSourceName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDisplayName("{displayName}") + .withUri("{artifactSourceUri}") + .withSourceType(SourceControlType.fromString("{VsoGit|GitHub|StorageAccount}")) + .withFolderPath("{folderPath}") + .withArmTemplateFolderPath("{armTemplateFolderPath}") + .withBranchRef("{branchRef}") + .withSecurityToken("{securityToken}") + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ArtifactSources_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Delete. */ +public final class ArtifactSourcesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_Delete.json + */ + /** + * Sample code: ArtifactSources_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .deleteWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE); + } +} +``` + +### ArtifactSources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Get. */ +public final class ArtifactSourcesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_Get.json + */ + /** + * Sample code: ArtifactSources_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE); + } +} +``` + +### ArtifactSources_List + +```java +import com.azure.core.util.Context; + +/** Samples for ArtifactSources List. */ +public final class ArtifactSourcesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_List.json + */ + /** + * Sample code: ArtifactSources_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.artifactSources().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### ArtifactSources_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ArtifactSource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources Update. */ +public final class ArtifactSourcesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_Update.json + */ + /** + * Sample code: ArtifactSources_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ArtifactSource resource = + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Artifacts_GenerateArmTemplate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.FileUploadOptions; +import com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest; + +/** Samples for Artifacts GenerateArmTemplate. */ +public final class ArtifactsGenerateArmTemplateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Artifacts_GenerateArmTemplate.json + */ + /** + * Sample code: Artifacts_GenerateArmTemplate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGenerateArmTemplate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .generateArmTemplateWithResponse( + "resourceGroupName", + "{labName}", + "{artifactSourceName}", + "{artifactName}", + new GenerateArmTemplateRequest() + .withVirtualMachineName("{vmName}") + .withLocation("{location}") + .withFileUploadOptions(FileUploadOptions.NONE), + Context.NONE); + } +} +``` + +### Artifacts_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Artifacts Get. */ +public final class ArtifactsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Artifacts_Get.json + */ + /** + * Sample code: Artifacts_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", "{artifactName}", Context.NONE); + } +} +``` + +### Artifacts_List + +```java +import com.azure.core.util.Context; + +/** Samples for Artifacts List. */ +public final class ArtifactsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Artifacts_List.json + */ + /** + * Sample code: Artifacts_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, Context.NONE); + } +} +``` + +### BastionHosts_CreateOrUpdate + +```java +/** Samples for BastionHosts CreateOrUpdate. */ +public final class BastionHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_CreateOrUpdate.json + */ + /** + * Sample code: BastionHosts_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .define("{bastionHostName}") + .withRegion("{location}") + .withExistingVirtualnetwork("resourceGroupName", "{labName}", "{virtualNetworkName}") + .create(); + } +} +``` + +### BastionHosts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for BastionHosts Delete. */ +public final class BastionHostsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_Delete.json + */ + /** + * Sample code: BastionHosts_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .delete("resourceGroupName", "{labName}", "{virtualNetworkName}", "{bastionHostName}", Context.NONE); + } +} +``` + +### BastionHosts_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BastionHosts Get. */ +public final class BastionHostsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_Get.json + */ + /** + * Sample code: BastionHosts_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .getWithResponse( + "resourceGroupName", "{labName}", "{virtualNetworkName}", "{bastionHostName}", Context.NONE); + } +} +``` + +### BastionHosts_List + +```java +import com.azure.core.util.Context; + +/** Samples for BastionHosts List. */ +public final class BastionHostsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_List.json + */ + /** + * Sample code: BastionHosts_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .list("resourceGroupName", "{labName}", "{virtualNetworkName}", null, null, null, Context.NONE); + } +} +``` + +### BastionHosts_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.BastionHost; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BastionHosts Update. */ +public final class BastionHostsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_Update.json + */ + /** + * Sample code: BastionHosts_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + BastionHost resource = + manager + .bastionHosts() + .getWithResponse( + "resourceGroupName", "{labName}", "{virtualNetworkName}", "{bastionHostName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Costs_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdStatus; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Costs CreateOrUpdate. */ +public final class CostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Costs_CreateOrUpdate.json + */ + /** + * Sample code: Costs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .costs() + .define("targetCost") + .withExistingLab("resourceGroupName", "{labName}") + .withCurrencyCode("USD") + .withStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00Z")) + .withEndDateTime(OffsetDateTime.parse("2020-12-31T23:59:59Z")) + .withStatus(TargetCostStatus.ENABLED) + .withTarget(100) + .withCostThresholds( + Arrays + .asList( + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000001") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(25.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000002") + .withDisplayOnChart(CostThresholdStatus.ENABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.ENABLED) + .withThresholdValue(50.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000003") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(75.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000004") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(100.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000005") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(125.0))) + .withCycleStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00.000Z")) + .withCycleEndDateTime(OffsetDateTime.parse("2020-12-31T00:00:00.000Z")) + .withCycleType(ReportingCycleType.CALENDAR_MONTH) + .create(); + } +} +``` + +### Costs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Costs Get. */ +public final class CostsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Costs_Get.json + */ + /** + * Sample code: Costs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.costs().getWithResponse("resourceGroupName", "{labName}", "targetCost", null, Context.NONE); + } +} +``` + +### Costs_List + +```java +import com.azure.core.util.Context; + +/** Samples for Costs List. */ +public final class CostsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Costs_List.json + */ + /** + * Sample code: Costs_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.costs().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### CustomImages_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages CreateOrUpdate. */ +public final class CustomImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_CreateOrUpdate.json + */ + /** + * Sample code: CustomImages_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .customImages() + .define("{customImageName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDescription("My Custom Image") + .withSourceVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}") + .withLinuxOsState(LinuxOsState.NON_DEPROVISIONED) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CustomImages_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for CustomImages Delete. */ +public final class CustomImagesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_Delete.json + */ + /** + * Sample code: CustomImages_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().delete("resourceGroupName", "{labName}", "{customImageName}", Context.NONE); + } +} +``` + +### CustomImages_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CustomImages Get. */ +public final class CustomImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_Get.json + */ + /** + * Sample code: CustomImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().getWithResponse("resourceGroupName", "{labName}", "{customImageName}", Context.NONE); + } +} +``` + +### CustomImages_List + +```java +import com.azure.core.util.Context; + +/** Samples for CustomImages List. */ +public final class CustomImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_List.json + */ + /** + * Sample code: CustomImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### CustomImages_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.CustomImage; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages Update. */ +public final class CustomImagesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_Update.json + */ + /** + * Sample code: CustomImages_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + CustomImage resource = + manager + .customImages() + .getWithResponse("resourceGroupName", "{labName}", "{customImageName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Disks_Attach + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; + +/** Samples for Disks Attach. */ +public final class DisksAttachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Attach.json + */ + /** + * Sample code: Disks_Attach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksAttach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .attach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new AttachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} +``` + +### Disks_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for Disks CreateOrUpdate. */ +public final class DisksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_CreateOrUpdate.json + */ + /** + * Sample code: Disks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .define("{diskName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userId}") + .withDiskType(StorageType.STANDARD) + .withDiskSizeGiB(1023) + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName") + .create(); + } +} +``` + +### Disks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Disks Delete. */ +public final class DisksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Delete.json + */ + /** + * Sample code: Disks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().delete("resourceGroupName", "{labName}", "{userId}", "{diskName}", Context.NONE); + } +} +``` + +### Disks_Detach + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties; + +/** Samples for Disks Detach. */ +public final class DisksDetachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Detach.json + */ + /** + * Sample code: Disks_Detach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDetach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .detach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new DetachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} +``` + +### Disks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Disks Get. */ +public final class DisksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Get.json + */ + /** + * Sample code: Disks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().getWithResponse("resourceGroupName", "{labName}", "@me", "{diskName}", Context.NONE); + } +} +``` + +### Disks_List + +```java +import com.azure.core.util.Context; + +/** Samples for Disks List. */ +public final class DisksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_List.json + */ + /** + * Sample code: Disks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().list("resourceGroupName", "{labName}", "@me", null, null, null, Context.NONE); + } +} +``` + +### Disks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Disk; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Disks Update. */ +public final class DisksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Update.json + */ + /** + * Sample code: Disks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Disk resource = + manager + .disks() + .getWithResponse("resourceGroupName", "{labName}", "@me", "diskName", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Environments_CreateOrUpdate + +```java +/** Samples for Environments CreateOrUpdate. */ +public final class EnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_CreateOrUpdate.json + */ + /** + * Sample code: Environments_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .environments() + .define("{environmentName}") + .withRegion((String) null) + .withExistingUser("resourceGroupName", "{labName}", "@me") + .create(); + } +} +``` + +### Environments_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Environments Delete. */ +public final class EnvironmentsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_Delete.json + */ + /** + * Sample code: Environments_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().delete("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE); + } +} +``` + +### Environments_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Environments Get. */ +public final class EnvironmentsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_Get.json + */ + /** + * Sample code: Environments_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE); + } +} +``` + +### Environments_List + +```java +import com.azure.core.util.Context; + +/** Samples for Environments List. */ +public final class EnvironmentsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_List.json + */ + /** + * Sample code: Environments_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().list("resourceGroupName", "{labName}", "@me", null, null, null, Context.NONE); + } +} +``` + +### Environments_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; + +/** Samples for Environments Update. */ +public final class EnvironmentsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_Update.json + */ + /** + * Sample code: Environments_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + DtlEnvironment resource = + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Formulas_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.TransportProtocol; +import java.util.Arrays; + +/** Samples for Formulas CreateOrUpdate. */ +public final class FormulasCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_CreateOrUpdate.json + */ + /** + * Sample code: Formulas_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .formulas() + .define("{formulaName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withDescription("Formula using a Linux base") + .withLocationPropertiesLocation("{location}") + .withNotes("Ubuntu Server 20.10") + .withSize("Standard_B1ms") + .withUsername("user") + .withIsAuthenticationWithSshKey(false) + .withLabSubnetName("Dtl{labName}Subnet") + .withLabVirtualNetworkId("/virtualnetworks/dtl{labName}") + .withDisallowPublicIpAddress(true) + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs") + .withParameters(Arrays.asList()))) + .withAllowClaim(false) + .withStorageType(StorageType.STANDARD) + .withOffer("0001-com-ubuntu-server-groovy") + .withPublisher("canonical") + .withSku("20_10") + .withOsTypeGalleryImageReferenceOsType("Linux") + .withVersion("latest") + .withInboundNatRules( + Arrays.asList(new InboundNatRule().withTransportProtocol(TransportProtocol.TCP).withBackendPort(22))) + .create(); + } +} +``` + +### Formulas_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Formulas Delete. */ +public final class FormulasDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_Delete.json + */ + /** + * Sample code: Formulas_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().deleteWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE); + } +} +``` + +### Formulas_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Formulas Get. */ +public final class FormulasGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_Get.json + */ + /** + * Sample code: Formulas_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().getWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE); + } +} +``` + +### Formulas_List + +```java +import com.azure.core.util.Context; + +/** Samples for Formulas List. */ +public final class FormulasListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_List.json + */ + /** + * Sample code: Formulas_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### Formulas_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Formula; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Formulas Update. */ +public final class FormulasUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_Update.json + */ + /** + * Sample code: Formulas_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Formula resource = + manager + .formulas() + .getWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### GalleryImages_Get + +```java +import com.azure.core.util.Context; + +/** Samples for GalleryImages Get. */ +public final class GalleryImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GalleryImages_Get.json + */ + /** + * Sample code: GalleryImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void galleryImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.galleryImages().getWithResponse("resourceGroupName", "{labName}", "{name}", Context.NONE); + } +} +``` + +### GalleryImages_List + +```java +import com.azure.core.util.Context; + +/** Samples for GalleryImages List. */ +public final class GalleryImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GalleryImages_List.json + */ + /** + * Sample code: GalleryImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void galleryImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.galleryImages().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### GlobalSchedules_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; + +/** Samples for GlobalSchedules CreateOrUpdate. */ +public final class GlobalSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_CreateOrUpdate.json + */ + /** + * Sample code: GlobalSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .define("labvmautostart") + .withRegion("southeastasia") + .withExistingResourceGroup("resourceGroupName") + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsStartupTask") + .withTimeZoneId("Hawaiian Standard Time") + .withWeekdays(Arrays.asList("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")) + .withTime("0700") + .create(); + } +} +``` + +### GlobalSchedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Delete. */ +public final class GlobalSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Delete.json + */ + /** + * Sample code: GlobalSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().deleteWithResponse("resourceGroupName", "labvmautostart", Context.NONE); + } +} +``` + +### GlobalSchedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Execute. */ +public final class GlobalSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Execute.json + */ + /** + * Sample code: GlobalSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().execute("resourceGroupName", "labvmautostart", Context.NONE); + } +} +``` + +### GlobalSchedules_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules GetByResourceGroup. */ +public final class GlobalSchedulesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Get.json + */ + /** + * Sample code: GlobalSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", Context.NONE); + } +} +``` + +### GlobalSchedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules List. */ +public final class GlobalSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_ListBySubscription.json + */ + /** + * Sample code: GlobalSchedules_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListBySubscription( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().list(null, null, null, Context.NONE); + } +} +``` + +### GlobalSchedules_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules ListByResourceGroup. */ +public final class GlobalSchedulesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_ListByResourceGroup.json + */ + /** + * Sample code: GlobalSchedules_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListByResourceGroup( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().listByResourceGroup("resourceGroupName", null, null, null, Context.NONE); + } +} +``` + +### GlobalSchedules_Retarget + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; + +/** Samples for GlobalSchedules Retarget. */ +public final class GlobalSchedulesRetargetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Retarget.json + */ + /** + * Sample code: GlobalSchedules_Retarget. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesRetarget(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .retarget( + "resourceGroupName", + "{scheduleName}", + new RetargetScheduleProperties() + .withCurrentResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{targetLab}") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{currentLab}"), + Context.NONE); + } +} +``` + +### GlobalSchedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Schedule; +import java.util.HashMap; +import java.util.Map; + +/** Samples for GlobalSchedules Update. */ +public final class GlobalSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Update.json + */ + /** + * Sample code: GlobalSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Schedule resource = + manager + .globalSchedules() + .getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LabSecrets_CreateOrUpdate + +```java +/** Samples for LabSecrets CreateOrUpdate. */ +public final class LabSecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_CreateOrUpdate.json + */ + /** + * Sample code: LabSecrets_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labSecrets() + .define("{secretName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withValue("{secretValue}") + .withEnabledForArtifacts(true) + .withEnabledForVmCreation(true) + .withEnabledForArmEnvironments(true) + .create(); + } +} +``` + +### LabSecrets_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for LabSecrets Delete. */ +public final class LabSecretsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_Delete.json + */ + /** + * Sample code: LabSecrets_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labSecrets().delete("resourceGroupName", "{labName}", "{secretName}", Context.NONE); + } +} +``` + +### LabSecrets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LabSecrets Get. */ +public final class LabSecretsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_Get.json + */ + /** + * Sample code: LabSecrets_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labSecrets().getWithResponse("resourceGroupName", "{labName}", "{secretName}", Context.NONE); + } +} +``` + +### LabSecrets_List + +```java +import com.azure.core.util.Context; + +/** Samples for LabSecrets List. */ +public final class LabSecretsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_List.json + */ + /** + * Sample code: LabSecrets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labSecrets().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### LabSecrets_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.LabSecret; +import java.util.HashMap; +import java.util.Map; + +/** Samples for LabSecrets Update. */ +public final class LabSecretsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_Update.json + */ + /** + * Sample code: LabSecrets_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + LabSecret resource = + manager + .labSecrets() + .getWithResponse("resourceGroupName", "{labName}", "{secretName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Labs_ClaimAnyVm + +```java +import com.azure.core.util.Context; + +/** Samples for Labs ClaimAnyVm. */ +public final class LabsClaimAnyVmSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ClaimAnyVm.json + */ + /** + * Sample code: Labs_ClaimAnyVm. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsClaimAnyVm(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().claimAnyVm("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_CreateEnvironment + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateEnvironment. */ +public final class LabsCreateEnvironmentSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_CreateEnvironment.json + */ + /** + * Sample code: Labs_CreateEnvironment. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateEnvironment(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .createEnvironment( + "resourceGroupName", + "{labName}", + new LabVirtualMachineCreationParameterInner() + .withName("{vmName}") + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withSize("Standard_A2_v2") + .withUsername("{userName}") + .withPassword("{userPassword}") + .withLabSubnetName("{virtualnetwork-subnet-name}") + .withLabVirtualNetworkId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}") + .withDisallowPublicIpAddress(true) + .withAllowClaim(true) + .withStorageType(StorageType.STANDARD) + .withOffer("UbuntuServer") + .withPublisher("Canonical") + .withSku("16.04-LTS") + .withOsTypeGalleryImageReferenceOsType("Linux") + .withVersion("Latest"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Labs_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateOrUpdate. */ +public final class LabsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_CreateOrUpdate.json + */ + /** + * Sample code: Labs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .define("{labName}") + .withRegion("{location}") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("tagName1", "tagValue1")) + .withLabStorageType(StorageType.fromString("{Standard|Premium}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Labs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Labs Delete. */ +public final class LabsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_Delete.json + */ + /** + * Sample code: Labs_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().delete("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_EnsureCurrentUserProfile + +```java +import com.azure.core.util.Context; + +/** Samples for Labs EnsureCurrentUserProfile. */ +public final class LabsEnsureCurrentUserProfileSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_EnsureCurrentUserProfile.json + */ + /** + * Sample code: Labs_EnsureCurrentUserProfile. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsEnsureCurrentUserProfile(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().ensureCurrentUserProfileWithResponse("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_ExportResourceUsage + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; +import java.time.OffsetDateTime; + +/** Samples for Labs ExportResourceUsage. */ +public final class LabsExportResourceUsageSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ExportResourceUsage.json + */ + /** + * Sample code: Labs_ExportResourceUsage. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsExportResourceUsage(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .exportResourceUsage( + "resourceGroupName", + "{labName}", + new ExportResourceUsageParameters() + .withBlobStorageAbsoluteSasUri( + "https://invalid.blob.core.windows.net/export.blob?sv=2015-07-08&sig={sas}&sp=rcw") + .withUsageStartDate(OffsetDateTime.parse("2020-12-01T00:00:00Z")), + Context.NONE); + } +} +``` + +### Labs_GenerateUploadUri + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; + +/** Samples for Labs GenerateUploadUri. */ +public final class LabsGenerateUploadUriSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_GenerateUploadUri.json + */ + /** + * Sample code: Labs_GenerateUploadUri. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGenerateUploadUri(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .generateUploadUriWithResponse( + "resourceGroupName", + "{labName}", + new GenerateUploadUriParameter().withBlobName("{blob-name}"), + Context.NONE); + } +} +``` + +### Labs_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Labs GetByResourceGroup. */ +public final class LabsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_Get.json + */ + /** + * Sample code: Labs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().getByResourceGroupWithResponse("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_ImportVirtualMachine + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; + +/** Samples for Labs ImportVirtualMachine. */ +public final class LabsImportVirtualMachineSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ImportVirtualMachine.json + */ + /** + * Sample code: Labs_ImportVirtualMachine. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsImportVirtualMachine(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .importVirtualMachine( + "resourceGroupName", + "{labName}", + new ImportLabVirtualMachineRequest() + .withSourceVirtualMachineResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{otherResourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + .withDestinationVirtualMachineName("{vmName}"), + Context.NONE); + } +} +``` + +### Labs_List + +```java +import com.azure.core.util.Context; + +/** Samples for Labs List. */ +public final class LabsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ListBySubscription.json + */ + /** + * Sample code: Labs_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListBySubscription(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().list(null, null, null, Context.NONE); + } +} +``` + +### Labs_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Labs ListByResourceGroup. */ +public final class LabsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ListByResourceGroup.json + */ + /** + * Sample code: Labs_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListByResourceGroup(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listByResourceGroup("resourceGroupName", null, null, null, Context.NONE); + } +} +``` + +### Labs_ListVhds + +```java +import com.azure.core.util.Context; + +/** Samples for Labs ListVhds. */ +public final class LabsListVhdsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ListVhds.json + */ + /** + * Sample code: Labs_ListVhds. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListVhds(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listVhds("resourceGroupName", "{labName}", Context.NONE); + } +} +``` + +### Labs_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Lab; + +/** Samples for Labs Update. */ +public final class LabsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_Update.json + */ + /** + * Sample code: Labs_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Lab resource = + manager.labs().getByResourceGroupWithResponse("resourceGroupName", "{labName}", Context.NONE).getValue(); + resource.update().apply(); + } +} +``` + +### NotificationChannels_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.Event; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import java.util.Arrays; + +/** Samples for NotificationChannels CreateOrUpdate. */ +public final class NotificationChannelsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_CreateOrUpdate.json + */ + /** + * Sample code: NotificationChannels_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .define("{notificationChannelName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("en") + .withDescription("Integration configured for auto-shutdown") + .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN))) + .create(); + } +} +``` + +### NotificationChannels_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Delete. */ +public final class NotificationChannelsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Delete.json + */ + /** + * Sample code: NotificationChannels_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .deleteWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE); + } +} +``` + +### NotificationChannels_Get + +```java +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Get. */ +public final class NotificationChannelsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Get.json + */ + /** + * Sample code: NotificationChannels_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE); + } +} +``` + +### NotificationChannels_List + +```java +import com.azure.core.util.Context; + +/** Samples for NotificationChannels List. */ +public final class NotificationChannelsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_List.json + */ + /** + * Sample code: NotificationChannels_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.notificationChannels().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### NotificationChannels_Notify + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import com.azure.resourcemanager.devtestlabs.models.NotifyParameters; + +/** Samples for NotificationChannels Notify. */ +public final class NotificationChannelsNotifySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Notify.json + */ + /** + * Sample code: NotificationChannels_Notify. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsNotify(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .notifyWithResponse( + "resourceGroupName", + "{labName}", + "{notificationChannelName}", + new NotifyParameters() + .withEventName(NotificationChannelEventType.AUTO_SHUTDOWN) + .withJsonPayload( + "{\"eventType\":\"AutoShutdown\",\"subscriptionId\":\"{subscriptionId}\",\"resourceGroupName\":\"resourceGroupName\",\"labName\":\"{labName}\"}"), + Context.NONE); + } +} +``` + +### NotificationChannels_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannel; + +/** Samples for NotificationChannels Update. */ +public final class NotificationChannelsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Update.json + */ + /** + * Sample code: NotificationChannels_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + NotificationChannel resource = + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Operations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Operations Get. */ +public final class OperationsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Operations_Get.json + */ + /** + * Sample code: Operations_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void operationsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.operations().getWithResponse(null, "{operationName}", Context.NONE); + } +} +``` + +### Policies_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; +import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; +import com.azure.resourcemanager.devtestlabs.models.PolicyStatus; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies CreateOrUpdate. */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_CreateOrUpdate.json + */ + /** + * Sample code: Policies_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .define("{policyName}") + .withRegion("{location}") + .withExistingPolicyset("resourceGroupName", "{labName}", "{policySetName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDescription("{policyDescription}") + .withStatus(PolicyStatus.fromString("{policyStatus}")) + .withFactName(PolicyFactName.fromString("{policyFactName}")) + .withFactData("{policyFactData}") + .withThreshold("{policyThreshold}") + .withEvaluatorType(PolicyEvaluatorType.fromString("{policyEvaluatorType}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Policies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Policies Delete. */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_Delete.json + */ + /** + * Sample code: Policies_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .deleteWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE); + } +} +``` + +### Policies_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Policies Get. */ +public final class PoliciesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_Get.json + */ + /** + * Sample code: Policies_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .getWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE); + } +} +``` + +### Policies_List + +```java +import com.azure.core.util.Context; + +/** Samples for Policies List. */ +public final class PoliciesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_List.json + */ + /** + * Sample code: Policies_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.policies().list("resourceGroupName", "{labName}", "{policySetName}", null, null, null, Context.NONE); + } +} +``` + +### Policies_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Policy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies Update. */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_Update.json + */ + /** + * Sample code: Policies_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Policy resource = + manager + .policies() + .getWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PolicySets_EvaluatePolicies + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesProperties; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; +import java.util.Arrays; + +/** Samples for PolicySets EvaluatePolicies. */ +public final class PolicySetsEvaluatePoliciesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/PolicySets_EvaluatePolicies.json + */ + /** + * Sample code: PolicySets_EvaluatePolicies. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policySetsEvaluatePolicies(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policySets() + .evaluatePoliciesWithResponse( + "resourceGroupName", + "{labName}", + "{policySetName}", + new EvaluatePoliciesRequest() + .withPolicies( + Arrays + .asList(new EvaluatePoliciesProperties().withFactName("LabVmCount").withValueOffset("1"))), + Context.NONE); + } +} +``` + +### PolicySets_List + +```java +import com.azure.core.util.Context; + +/** Samples for PolicySets List. */ +public final class PolicySetsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/PolicySets_List.json + */ + /** + * Sample code: PolicySets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policySetsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.policySets().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### ProviderOperations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ProviderOperations List. */ +public final class ProviderOperationsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ProviderOperations_List.json + */ + /** + * Sample code: ProviderOperations_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void providerOperationsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.providerOperations().list(Context.NONE); + } +} +``` + +### Schedules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Schedules CreateOrUpdate. */ +public final class SchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_CreateOrUpdate.json + */ + /** + * Sample code: Schedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType("{myLabVmTaskType}") + .withTimeZoneId("Pacific Standard Time") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}") + .withWeekdays(Arrays.asList("Monday", "Wednesday", "Friday")) + .withTime("{timeOfTheDayTheScheduleWillOccurOnThoseDays}") + .withMinute(30) + .withStatusNotificationSettingsStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Schedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Delete. */ +public final class SchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Delete.json + */ + /** + * Sample code: Schedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().deleteWithResponse("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} +``` + +### Schedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Execute. */ +public final class SchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Execute.json + */ + /** + * Sample code: Schedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().execute("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} +``` + +### Schedules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Get. */ +public final class SchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Get.json + */ + /** + * Sample code: Schedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().getWithResponse("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} +``` + +### Schedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules List. */ +public final class SchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_List.json + */ + /** + * Sample code: Schedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### Schedules_ListApplicable + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules ListApplicable. */ +public final class SchedulesListApplicableSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_ListApplicable.json + */ + /** + * Sample code: Schedules_ListApplicable. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesListApplicable(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().listApplicable("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} +``` + +### Schedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Schedules Update. */ +public final class SchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Update.json + */ + /** + * Sample code: Schedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Secrets_CreateOrUpdate + +```java +/** Samples for Secrets CreateOrUpdate. */ +public final class SecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_CreateOrUpdate.json + */ + /** + * Sample code: Secrets_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .define("{secretName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withValue("{secret}") + .create(); + } +} +``` + +### Secrets_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets Delete. */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .deleteWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE); + } +} +``` + +### Secrets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.secrets().getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE); + } +} +``` + +### Secrets_List + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets List. */ +public final class SecretsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_List.json + */ + /** + * Sample code: Secrets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.secrets().list("resourceGroupName", "{labName}", "{userName}", null, null, null, Context.NONE); + } +} +``` + +### Secrets_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Secret; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Secrets Update. */ +public final class SecretsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_Update.json + */ + /** + * Sample code: Secrets_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Secret resource = + manager + .secrets() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceFabricSchedules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabricSchedules CreateOrUpdate. */ +public final class ServiceFabricSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabricSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType( + "{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}") + .withTimeZoneId("Pacific Standard Time") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}") + .withWeekdays( + Arrays.asList("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")) + .withTime("19:00") + .withMinute(0) + .withStatusNotificationSettingsStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhoolUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceFabricSchedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Delete. */ +public final class ServiceFabricSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Delete.json + */ + /** + * Sample code: ServiceFabricSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .deleteWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} +``` + +### ServiceFabricSchedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Execute. */ +public final class ServiceFabricSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Execute.json + */ + /** + * Sample code: ServiceFabricSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .execute("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} +``` + +### ServiceFabricSchedules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Get. */ +public final class ServiceFabricSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Get.json + */ + /** + * Sample code: ServiceFabricSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .getWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} +``` + +### ServiceFabricSchedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules List. */ +public final class ServiceFabricSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_List.json + */ + /** + * Sample code: ServiceFabricSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .list("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", null, null, null, Context.NONE); + } +} +``` + +### ServiceFabricSchedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabricSchedules Update. */ +public final class ServiceFabricSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Update.json + */ + /** + * Sample code: ServiceFabricSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceFabrics_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics CreateOrUpdate. */ +public final class ServiceFabricsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabrics_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .define("{serviceFabricName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withExternalServiceFabricId("{serviceFabricId}") + .withEnvironmentId("{environmentId}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceFabrics_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Delete. */ +public final class ServiceFabricsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Delete.json + */ + /** + * Sample code: ServiceFabrics_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .delete("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Get. */ +public final class ServiceFabricsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Get.json + */ + /** + * Sample code: ServiceFabrics_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE); + } +} +``` + +### ServiceFabrics_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics List. */ +public final class ServiceFabricsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_List.json + */ + /** + * Sample code: ServiceFabrics_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .list("resourceGroupName", "{labName}", "{userName}", null, null, null, null, Context.NONE); + } +} +``` + +### ServiceFabrics_ListApplicableSchedules + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics ListApplicableSchedules. */ +public final class ServiceFabricsListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_ListApplicableSchedules.json + */ + /** + * Sample code: ServiceFabrics_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .listApplicableSchedulesWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Start + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Start. */ +public final class ServiceFabricsStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Start.json + */ + /** + * Sample code: ServiceFabrics_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .start("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Stop. */ +public final class ServiceFabricsStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Stop.json + */ + /** + * Sample code: ServiceFabrics_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .stop("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} +``` + +### ServiceFabrics_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics Update. */ +public final class ServiceFabricsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Update.json + */ + /** + * Sample code: ServiceFabrics_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ServiceFabric resource = + manager + .serviceFabrics() + .getWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceRunners_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceRunners CreateOrUpdate. */ +public final class ServiceRunnersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_CreateOrUpdate.json + */ + /** + * Sample code: ServiceRunners_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .define("{servicerunnerName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withTypeIdentityType(ManagedIdentityType.fromString("{identityType}")) + .withPrincipalId("{identityPrincipalId}") + .withTenantId("{identityTenantId}") + .withClientSecretUrl("{identityClientSecretUrl}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceRunners_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Delete. */ +public final class ServiceRunnersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_Delete.json + */ + /** + * Sample code: ServiceRunners_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.serviceRunners().delete("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} +``` + +### ServiceRunners_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Get. */ +public final class ServiceRunnersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_Get.json + */ + /** + * Sample code: ServiceRunners_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} +``` + +### ServiceRunners_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRunners List. */ +public final class ServiceRunnersListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_List.json + */ + /** + * Sample code: ServiceRunners_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.serviceRunners().list("resourceGroupName", "{devtestlabName}", null, null, null, Context.NONE); + } +} +``` + +### SharedGalleries_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedGalleries CreateOrUpdate. */ +public final class SharedGalleriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_CreateOrUpdate.json + */ + /** + * Sample code: SharedGalleries_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedGalleries() + .define("{sharedGalleryName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withGalleryId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.compute/galleries/{sharedGalleryName}") + .withAllowAllImages(EnableState.fromString("{Enabled|Disabled}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SharedGalleries_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SharedGalleries Delete. */ +public final class SharedGalleriesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_Delete.json + */ + /** + * Sample code: SharedGalleries_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedGalleries() + .deleteWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", Context.NONE); + } +} +``` + +### SharedGalleries_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SharedGalleries Get. */ +public final class SharedGalleriesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_Get.json + */ + /** + * Sample code: SharedGalleries_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedGalleries() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", Context.NONE); + } +} +``` + +### SharedGalleries_List + +```java +import com.azure.core.util.Context; + +/** Samples for SharedGalleries List. */ +public final class SharedGalleriesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_List.json + */ + /** + * Sample code: SharedGalleries_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.sharedGalleries().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} +``` + +### SharedGalleries_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.SharedGallery; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedGalleries Update. */ +public final class SharedGalleriesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_Update.json + */ + /** + * Sample code: SharedGalleries_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + SharedGallery resource = + manager + .sharedGalleries() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SharedImages_CreateOrUpdate + +```java +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.azure.resourcemanager.devtestlabs.models.ImageType; +import com.azure.resourcemanager.devtestlabs.models.OsType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedImages CreateOrUpdate. */ +public final class SharedImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_CreateOrUpdate.json + */ + /** + * Sample code: SharedImages_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .define("{name}") + .withRegion("{location}") + .withExistingSharedgallery("resourceGroupName", "{labName}", "{sharedGalleryName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDefinitionName("{definitionName}") + .withOsType(OsType.fromString("{osType}")) + .withImageType(ImageType.fromString("{imageType}")) + .withEnableState(EnableState.fromString("{enabledState}")) + .withDisplayName("{displayName}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SharedImages_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SharedImages Delete. */ +public final class SharedImagesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_Delete.json + */ + /** + * Sample code: SharedImages_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .deleteWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", "{name}", Context.NONE); + } +} +``` + +### SharedImages_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SharedImages Get. */ +public final class SharedImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_Get.json + */ + /** + * Sample code: SharedImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", "{name}", null, Context.NONE); + } +} +``` + +### SharedImages_List + +```java +import com.azure.core.util.Context; + +/** Samples for SharedImages List. */ +public final class SharedImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_List.json + */ + /** + * Sample code: SharedImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .list("resourceGroupName", "{labName}", "{sharedGalleryName}", null, null, null, null, Context.NONE); + } +} +``` + +### SharedImages_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.SharedImage; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedImages Update. */ +public final class SharedImagesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_Update.json + */ + /** + * Sample code: SharedImages_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + SharedImage resource = + manager + .sharedImages() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", "{name}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Users_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users CreateOrUpdate. */ +public final class UsersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_CreateOrUpdate.json + */ + /** + * Sample code: Users_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .users() + .define("{userName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withPrincipalName("{principalName}") + .withPrincipalId("{principalId}") + .withTenantId("{tenantId}") + .withObjectId("{objectId}") + .withAppId("{appId}") + .withKeyVaultUri("{keyVaultUri}") + .withKeyVaultId("{keyVaultId}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Users_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Users Delete. */ +public final class UsersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_Delete.json + */ + /** + * Sample code: Users_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().delete("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE); + } +} +``` + +### Users_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Users Get. */ +public final class UsersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_Get.json + */ + /** + * Sample code: Users_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE); + } +} +``` + +### Users_List + +```java +import com.azure.core.util.Context; + +/** Samples for Users List. */ +public final class UsersListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_List.json + */ + /** + * Sample code: Users_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().list("resourceGroupName", "{devtestlabName}", null, null, null, Context.NONE); + } +} +``` + +### Users_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.User; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users Update. */ +public final class UsersUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_Update.json + */ + /** + * Sample code: Users_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + User resource = + manager + .users() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachineSchedules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineSchedules CreateOrUpdate. */ +public final class VirtualMachineSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachineSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsShutdownTask") + .withTimeZoneId("Pacific Standard Time") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}") + .withWeekdays(Arrays.asList("Friday", "Saturday", "Sunday")) + .withTime("1700") + .withMinute(30) + .withStatusNotificationSettingsStatus(EnableStatus.ENABLED) + .withTimeInMinutes(30) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachineSchedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Delete. */ +public final class VirtualMachineSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Delete.json + */ + /** + * Sample code: VirtualMachineSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .deleteWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} +``` + +### VirtualMachineSchedules_Execute + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Execute. */ +public final class VirtualMachineSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Execute.json + */ + /** + * Sample code: VirtualMachineSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesExecute( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .execute("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} +``` + +### VirtualMachineSchedules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Get. */ +public final class VirtualMachineSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Get.json + */ + /** + * Sample code: VirtualMachineSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} +``` + +### VirtualMachineSchedules_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules List. */ +public final class VirtualMachineSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_List.json + */ + /** + * Sample code: VirtualMachineSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .list("resourceGroupName", "{labName}", "{vmName}", null, null, null, Context.NONE); + } +} +``` + +### VirtualMachineSchedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineSchedules Update. */ +public final class VirtualMachineSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Update.json + */ + /** + * Sample code: VirtualMachineSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachines_AddDataDisk + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for VirtualMachines AddDataDisk. */ +public final class VirtualMachinesAddDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_AddDataDisk.json + */ + /** + * Sample code: VirtualMachines_AddDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesAddDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .addDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DataDiskProperties() + .withDiskSizeGiB(127) + .withDiskName("{diskName}") + .withDiskType(StorageType.fromString("{diskType}")), + Context.NONE); + } +} +``` + +### VirtualMachines_ApplyArtifacts + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import java.util.Arrays; + +/** Samples for VirtualMachines ApplyArtifacts. */ +public final class VirtualMachinesApplyArtifactsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_ApplyArtifacts.json + */ + /** + * Sample code: VirtualMachines_ApplyArtifacts. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesApplyArtifacts(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .applyArtifacts( + "resourceGroupName", + "{labName}", + "{vmName}", + new ApplyArtifactsRequest() + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/public" + + " repo/artifacts/windows-restart"))), + Context.NONE); + } +} +``` + +### VirtualMachines_Claim + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Claim. */ +public final class VirtualMachinesClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Claim.json + */ + /** + * Sample code: VirtualMachines_Claim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().claim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_ClearArtifactResults + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ClearArtifactResults. */ +public final class VirtualMachinesClearArtifactResultsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_ClearArtifactResults.json + */ + /** + * Sample code: VirtualMachines_ClearArtifactResults. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesClearArtifactResults( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .clearArtifactResultsWithResponse("resourceGroupName", "{labName}", "{vmNname}", Context.NONE); + } +} +``` + +### VirtualMachines_CreateOrUpdate + +```java +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachines_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .define("{vmName}") + .withRegion((String) null) + .withExistingLab("resourceGroupName", "{labName}") + .create(); + } +} +``` + +### VirtualMachines_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Delete.json + */ + /** + * Sample code: VirtualMachines_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().delete("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_DetachDataDisk + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; + +/** Samples for VirtualMachines DetachDataDisk. */ +public final class VirtualMachinesDetachDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_DetachDataDisk.json + */ + /** + * Sample code: VirtualMachines_DetachDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDetachDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .detachDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DetachDataDiskProperties() + .withExistingLabDiskId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{virtualMachineName}"), + Context.NONE); + } +} +``` + +### VirtualMachines_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Get. */ +public final class VirtualMachinesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Get.json + */ + /** + * Sample code: VirtualMachines_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE); + } +} +``` + +### VirtualMachines_GetRdpFileContents + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines GetRdpFileContents. */ +public final class VirtualMachinesGetRdpFileContentsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_GetRdpFileContents.json + */ + /** + * Sample code: VirtualMachines_GetRdpFileContents. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGetRdpFileContents( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .getRdpFileContentsWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_List.json + */ + /** + * Sample code: VirtualMachines_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### VirtualMachines_ListApplicableSchedules + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ListApplicableSchedules. */ +public final class VirtualMachinesListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_ListApplicableSchedules.json + */ + /** + * Sample code: VirtualMachines_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .listApplicableSchedulesWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Redeploy + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Redeploy.json + */ + /** + * Sample code: VirtualMachines_Redeploy. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRedeploy(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().redeploy("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Resize + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties; + +/** Samples for VirtualMachines Resize. */ +public final class VirtualMachinesResizeSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Resize.json + */ + /** + * Sample code: VirtualMachines_Resize. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesResize(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .resize( + "resourceGroupName", + "{labName}", + "{vmName}", + new ResizeLabVirtualMachineProperties().withSize("Standard_A4_v2"), + Context.NONE); + } +} +``` + +### VirtualMachines_Restart + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Restart.json + */ + /** + * Sample code: VirtualMachines_Restart. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRestart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().restart("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Start + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Start.json + */ + /** + * Sample code: VirtualMachines_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().start("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Stop. */ +public final class VirtualMachinesStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Stop.json + */ + /** + * Sample code: VirtualMachines_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().stop("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_TransferDisks + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines TransferDisks. */ +public final class VirtualMachinesTransferDisksSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_TransferDisks.json + */ + /** + * Sample code: VirtualMachines_TransferDisks. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesTransferDisks(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().transferDisks("resourceGroupName", "{labName}", "{virtualmachineName}", Context.NONE); + } +} +``` + +### VirtualMachines_UnClaim + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines UnClaim. */ +public final class VirtualMachinesUnClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_UnClaim.json + */ + /** + * Sample code: VirtualMachines_UnClaim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUnClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().unClaim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} +``` + +### VirtualMachines_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachine; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Update.json + */ + /** + * Sample code: VirtualMachines_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + LabVirtualMachine resource = + manager + .virtualMachines() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### VirtualNetworks_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks CreateOrUpdate. */ +public final class VirtualNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_CreateOrUpdate.json + */ + /** + * Sample code: VirtualNetworks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .define("{virtualNetworkName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualNetworks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Delete. */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_Delete.json + */ + /** + * Sample code: VirtualNetworks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().delete("resourceGroupName", "{labName}", "{virtualNetworkName}", Context.NONE); + } +} +``` + +### VirtualNetworks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Get. */ +public final class VirtualNetworksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_Get.json + */ + /** + * Sample code: VirtualNetworks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE); + } +} +``` + +### VirtualNetworks_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks List. */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_List.json + */ + /** + * Sample code: VirtualNetworks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} +``` + +### VirtualNetworks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.VirtualNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks Update. */ +public final class VirtualNetworksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_Update.json + */ + /** + * Sample code: VirtualNetworks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + VirtualNetwork resource = + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml index 4d27c23e43d3..7d49ac0a9dce 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-devtestlabs - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-devtestlabs + 1.0.0-beta.2 + jar - Microsoft Azure SDK for DevTestLabs Management - This package contains Microsoft Azure SDK for DevTestLabs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The DevTest Labs Client. Package tag package-2018-09. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for DevTestLabs Management + This package contains Microsoft Azure SDK for DevTestLabs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The DevTest Labs Client. Package tag package-2021-09. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.25.0 - - - com.azure - azure-core-management - 1.5.2 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-management + 1.5.2 + + diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java index 96929b98af39..799a1fb8d1bc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/DevTestLabsManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -24,6 +25,7 @@ import com.azure.resourcemanager.devtestlabs.implementation.ArmTemplatesImpl; import com.azure.resourcemanager.devtestlabs.implementation.ArtifactSourcesImpl; import com.azure.resourcemanager.devtestlabs.implementation.ArtifactsImpl; +import com.azure.resourcemanager.devtestlabs.implementation.BastionHostsImpl; import com.azure.resourcemanager.devtestlabs.implementation.CostsImpl; import com.azure.resourcemanager.devtestlabs.implementation.CustomImagesImpl; import com.azure.resourcemanager.devtestlabs.implementation.DevTestLabsClientBuilder; @@ -32,6 +34,7 @@ import com.azure.resourcemanager.devtestlabs.implementation.FormulasImpl; import com.azure.resourcemanager.devtestlabs.implementation.GalleryImagesImpl; import com.azure.resourcemanager.devtestlabs.implementation.GlobalSchedulesImpl; +import com.azure.resourcemanager.devtestlabs.implementation.LabSecretsImpl; import com.azure.resourcemanager.devtestlabs.implementation.LabsImpl; import com.azure.resourcemanager.devtestlabs.implementation.NotificationChannelsImpl; import com.azure.resourcemanager.devtestlabs.implementation.OperationsImpl; @@ -43,6 +46,8 @@ import com.azure.resourcemanager.devtestlabs.implementation.ServiceFabricSchedulesImpl; import com.azure.resourcemanager.devtestlabs.implementation.ServiceFabricsImpl; import com.azure.resourcemanager.devtestlabs.implementation.ServiceRunnersImpl; +import com.azure.resourcemanager.devtestlabs.implementation.SharedGalleriesImpl; +import com.azure.resourcemanager.devtestlabs.implementation.SharedImagesImpl; import com.azure.resourcemanager.devtestlabs.implementation.UsersImpl; import com.azure.resourcemanager.devtestlabs.implementation.VirtualMachineSchedulesImpl; import com.azure.resourcemanager.devtestlabs.implementation.VirtualMachinesImpl; @@ -50,6 +55,7 @@ import com.azure.resourcemanager.devtestlabs.models.ArmTemplates; import com.azure.resourcemanager.devtestlabs.models.ArtifactSources; import com.azure.resourcemanager.devtestlabs.models.Artifacts; +import com.azure.resourcemanager.devtestlabs.models.BastionHosts; import com.azure.resourcemanager.devtestlabs.models.Costs; import com.azure.resourcemanager.devtestlabs.models.CustomImages; import com.azure.resourcemanager.devtestlabs.models.Disks; @@ -57,6 +63,7 @@ import com.azure.resourcemanager.devtestlabs.models.Formulas; import com.azure.resourcemanager.devtestlabs.models.GalleryImages; import com.azure.resourcemanager.devtestlabs.models.GlobalSchedules; +import com.azure.resourcemanager.devtestlabs.models.LabSecrets; import com.azure.resourcemanager.devtestlabs.models.Labs; import com.azure.resourcemanager.devtestlabs.models.NotificationChannels; import com.azure.resourcemanager.devtestlabs.models.Operations; @@ -68,6 +75,8 @@ import com.azure.resourcemanager.devtestlabs.models.ServiceFabricSchedules; import com.azure.resourcemanager.devtestlabs.models.ServiceFabrics; import com.azure.resourcemanager.devtestlabs.models.ServiceRunners; +import com.azure.resourcemanager.devtestlabs.models.SharedGalleries; +import com.azure.resourcemanager.devtestlabs.models.SharedImages; import com.azure.resourcemanager.devtestlabs.models.Users; import com.azure.resourcemanager.devtestlabs.models.VirtualMachineSchedules; import com.azure.resourcemanager.devtestlabs.models.VirtualMachines; @@ -77,6 +86,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to DevTestLabsManager. The DevTest Labs Client. */ public final class DevTestLabsManager { @@ -110,8 +120,14 @@ public final class DevTestLabsManager { private Schedules schedules; + private LabSecrets labSecrets; + private ServiceRunners serviceRunners; + private SharedGalleries sharedGalleries; + + private SharedImages sharedImages; + private Users users; private Disks disks; @@ -130,6 +146,8 @@ public final class DevTestLabsManager { private VirtualNetworks virtualNetworks; + private BastionHosts bastionHosts; + private final DevTestLabsClient clientObject; private DevTestLabsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -173,6 +191,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -212,6 +231,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -268,20 +298,33 @@ public DevTestLabsManager authenticate(TokenCredential credential, AzureProfile userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -413,6 +456,14 @@ public Schedules schedules() { return schedules; } + /** @return Resource collection API of LabSecrets. */ + public LabSecrets labSecrets() { + if (this.labSecrets == null) { + this.labSecrets = new LabSecretsImpl(clientObject.getLabSecrets(), this); + } + return labSecrets; + } + /** @return Resource collection API of ServiceRunners. */ public ServiceRunners serviceRunners() { if (this.serviceRunners == null) { @@ -421,6 +472,22 @@ public ServiceRunners serviceRunners() { return serviceRunners; } + /** @return Resource collection API of SharedGalleries. */ + public SharedGalleries sharedGalleries() { + if (this.sharedGalleries == null) { + this.sharedGalleries = new SharedGalleriesImpl(clientObject.getSharedGalleries(), this); + } + return sharedGalleries; + } + + /** @return Resource collection API of SharedImages. */ + public SharedImages sharedImages() { + if (this.sharedImages == null) { + this.sharedImages = new SharedImagesImpl(clientObject.getSharedImages(), this); + } + return sharedImages; + } + /** @return Resource collection API of Users. */ public Users users() { if (this.users == null) { @@ -495,6 +562,14 @@ public VirtualNetworks virtualNetworks() { return virtualNetworks; } + /** @return Resource collection API of BastionHosts. */ + public BastionHosts bastionHosts() { + if (this.bastionHosts == null) { + this.bastionHosts = new BastionHostsImpl(clientObject.getBastionHosts(), this); + } + return bastionHosts; + } + /** * @return Wrapped service client DevTestLabsClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java index 14fabcf6ad45..7500d36fab57 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArmTemplatesClient.java @@ -22,7 +22,7 @@ public interface ArmTemplatesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); @@ -33,22 +33,20 @@ public interface ArmTemplatesClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, @@ -76,19 +74,13 @@ PagedIterable list( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return azure resource manager template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context); + String resourceGroupName, String labName, String artifactSourceName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java index c0dc5ca47d10..a04143590237 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactSourcesClient.java @@ -22,7 +22,7 @@ public interface ArtifactSourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -32,25 +32,18 @@ public interface ArtifactSourcesClient { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get artifact source. @@ -72,16 +65,15 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + String resourceGroupName, String labName, String name, Context context); /** * Create or replace an existing artifact source. @@ -110,7 +102,7 @@ ArtifactSourceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -139,7 +131,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -150,7 +142,7 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param artifactSource Allows modifying tags of artifact sources. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -166,12 +158,12 @@ ArtifactSourceInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param artifactSource Allows modifying tags of artifact sources. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java index 84683b96e417..b6a1627a9b55 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ArtifactsClient.java @@ -24,7 +24,7 @@ public interface ArtifactsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); @@ -35,22 +35,20 @@ public interface ArtifactsClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, @@ -78,21 +76,15 @@ PagedIterable list( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return artifact along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context); + String resourceGroupName, String labName, String artifactSourceName, String name, Context context); /** * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates @@ -129,7 +121,7 @@ ArmTemplateInfoInner generateArmTemplate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 generated ARM template. + * @return information about a generated ARM template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response generateArmTemplateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/BastionHostsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/BastionHostsClient.java new file mode 100644 index 000000000000..61e66900faa8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/BastionHostsClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.devtestlabs.fluent.models.BastionHostInner; +import com.azure.resourcemanager.devtestlabs.models.BastionHostFragment; + +/** An instance of this class provides access to all the operations defined in BastionHostsClient. */ +public interface BastionHostsClient { + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String virtualNetworkName); + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby, + Context context); + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner get(String resourceGroupName, String labName, String virtualNetworkName, String name); + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context); + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String virtualNetworkName, String name, BastionHostInner bastionHost); + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost, + Context context); + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner createOrUpdate( + String resourceGroupName, String labName, String virtualNetworkName, String name, BastionHostInner bastionHost); + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner createOrUpdate( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost, + Context context); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String virtualNetworkName, String name); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String labName, String virtualNetworkName, String name); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String labName, String virtualNetworkName, String name, Context context); + + /** + * Allows modifying tags of bastionhosts. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Allows modifying tags of bastionhosts. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner update( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostFragment bastionHost); + + /** + * Allows modifying tags of bastionhosts. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Allows modifying tags of bastionhosts. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostFragment bastionHost, + Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java index 08f46abf1cd6..6884d9f468ac 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CostsClient.java @@ -6,12 +6,51 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner; /** An instance of this class provides access to all the operations defined in CostsClient. */ public interface CostsClient { + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String labName, + String expand, + String filter, + Integer top, + String orderby, + Context context); + /** * Get cost. * @@ -37,7 +76,7 @@ public interface CostsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -69,7 +108,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a cost item. + * @return a cost item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java index f62f57f8cb68..c4cc536689bc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/CustomImagesClient.java @@ -24,7 +24,7 @@ public interface CustomImagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -34,25 +34,18 @@ public interface CustomImagesClient { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get custom image. @@ -74,16 +67,14 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. + * @return custom image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Create or replace an existing custom image. This operation can take a while to complete. @@ -95,9 +86,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image. + * @return the {@link SyncPoller} for polling of a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage); @@ -112,9 +103,9 @@ SyncPoller, CustomImageInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 custom image. + * @return the {@link SyncPoller} for polling of a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context); @@ -160,9 +151,9 @@ CustomImageInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -175,9 +166,9 @@ CustomImageInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context); @@ -214,7 +205,7 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param customImage A custom image. + * @param customImage Allows modifying tags of custom images. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -229,12 +220,12 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param customImage A custom image. + * @param customImage Allows modifying tags of custom images. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 custom image. + * @return a custom image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsClient.java index 04b690fea67d..3f0c29b0fe90 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DevTestLabsClient.java @@ -149,6 +149,13 @@ public interface DevTestLabsClient { */ SchedulesClient getSchedules(); + /** + * Gets the LabSecretsClient object to access its operations. + * + * @return the LabSecretsClient object. + */ + LabSecretsClient getLabSecrets(); + /** * Gets the ServiceRunnersClient object to access its operations. * @@ -156,6 +163,20 @@ public interface DevTestLabsClient { */ ServiceRunnersClient getServiceRunners(); + /** + * Gets the SharedGalleriesClient object to access its operations. + * + * @return the SharedGalleriesClient object. + */ + SharedGalleriesClient getSharedGalleries(); + + /** + * Gets the SharedImagesClient object to access its operations. + * + * @return the SharedImagesClient object. + */ + SharedImagesClient getSharedImages(); + /** * Gets the UsersClient object to access its operations. * @@ -218,4 +239,11 @@ public interface DevTestLabsClient { * @return the VirtualNetworksClient object. */ VirtualNetworksClient getVirtualNetworks(); + + /** + * Gets the BastionHostsClient object to access its operations. + * + * @return the BastionHostsClient object. + */ + BastionHostsClient getBastionHosts(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java index 4e6fda42b3e6..044921f4802f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/DisksClient.java @@ -27,7 +27,7 @@ public interface DisksClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String username); @@ -38,22 +38,20 @@ public interface DisksClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -81,16 +79,15 @@ PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context); + String resourceGroupName, String labName, String username, String name, Context context); /** * Create or replace an existing disk. This operation can take a while to complete. @@ -103,9 +100,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk. + * @return the {@link SyncPoller} for polling of a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk); @@ -121,9 +118,9 @@ SyncPoller, DiskInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk, Context context); @@ -171,9 +168,9 @@ DiskInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name); @@ -188,9 +185,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context); @@ -230,7 +227,7 @@ SyncPoller, Void> beginDelete( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param disk A Disk. + * @param disk Allows modifying tags of disks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -246,12 +243,12 @@ SyncPoller, Void> beginDelete( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param disk A Disk. + * @param disk Allows modifying tags of disks. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return a Disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -268,9 +265,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -290,9 +287,9 @@ SyncPoller, Void> beginAttach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -355,9 +352,9 @@ void attach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetach( String resourceGroupName, String labName, @@ -378,9 +375,9 @@ SyncPoller, Void> beginDetach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetach( String resourceGroupName, String labName, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java index c7cc0d54c506..6ef165209a5b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/EnvironmentsClient.java @@ -25,7 +25,7 @@ public interface EnvironmentsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String username); @@ -36,22 +36,20 @@ public interface EnvironmentsClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -79,16 +77,15 @@ PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context); + String resourceGroupName, String labName, String username, String name, Context context); /** * Create or replace an existing environment. This operation can take a while to complete. @@ -101,9 +98,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment, which is essentially an ARM template deployment. + * @return the {@link SyncPoller} for polling of an environment, which is essentially an ARM template deployment. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment); @@ -119,9 +116,9 @@ SyncPoller, DtlEnvironmentInner> beginCreateOrUp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 environment, which is essentially an ARM template deployment. + * @return the {@link SyncPoller} for polling of an environment, which is essentially an ARM template deployment. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -180,9 +177,9 @@ DtlEnvironmentInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name); @@ -197,9 +194,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context); @@ -239,7 +236,7 @@ SyncPoller, Void> beginDelete( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param dtlEnvironment Allows modifying tags of environments. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -256,12 +253,12 @@ DtlEnvironmentInner update( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param dtlEnvironment Allows modifying tags of environments. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java index e5897892f1d3..0706fdc2d1a3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/FormulasClient.java @@ -24,7 +24,7 @@ public interface FormulasClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -34,25 +34,18 @@ public interface FormulasClient { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get formula. @@ -74,19 +67,17 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -95,14 +86,15 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters. + * @return the {@link SyncPoller} for polling of a formula for creating a VM, specifying an image base and other + * parameters. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula); /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -112,14 +104,15 @@ SyncPoller, FormulaInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 formula for creating a VM, specifying an image base and other parameters. + * @return the {@link SyncPoller} for polling of a formula for creating a VM, specifying an image base and other + * parameters. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula, Context context); /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -134,7 +127,7 @@ SyncPoller, FormulaInner> beginCreateOrUpdate( FormulaInner createOrUpdate(String resourceGroupName, String labName, String name, FormulaInner formula); /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -173,7 +166,7 @@ FormulaInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -184,7 +177,7 @@ FormulaInner createOrUpdate( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param formula Allows modifying tags of formulas. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -199,12 +192,12 @@ FormulaInner createOrUpdate( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param formula Allows modifying tags of formulas. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java index 4dde1cab7c18..bc1fcaf8a3c2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GalleryImagesClient.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; @@ -20,7 +21,7 @@ public interface GalleryImagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -30,23 +31,45 @@ public interface GalleryImagesClient { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryImageInner get(String resourceGroupName, String labName, String name); + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java index 2056c0c2030a..6d804397516b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/GlobalSchedulesClient.java @@ -22,7 +22,7 @@ public interface GlobalSchedulesClient { * * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -30,18 +30,17 @@ public interface GlobalSchedulesClient { /** * List schedules in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); + PagedIterable list(String filter, Integer top, String orderby, Context context); /** * List schedules in a resource group. @@ -50,7 +49,7 @@ public interface GlobalSchedulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -59,19 +58,18 @@ public interface GlobalSchedulesClient { * List schedules in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context); + String resourceGroupName, String filter, Integer top, String orderby, Context context); /** * Get schedule. @@ -91,16 +89,14 @@ PagedIterable listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String name, String expand, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); /** * Create or replace an existing schedule. @@ -126,7 +122,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -153,7 +149,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String name, Context context); @@ -163,7 +159,7 @@ Response createOrUpdateWithResponse( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -177,12 +173,12 @@ Response createOrUpdateWithResponse( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -196,9 +192,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute(String resourceGroupName, String name); /** @@ -210,9 +206,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute(String resourceGroupName, String name, Context context); /** @@ -249,9 +245,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties); @@ -265,9 +261,9 @@ SyncPoller, Void> beginRetarget( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabSecretsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabSecretsClient.java new file mode 100644 index 000000000000..e7f4064ce634 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabSecretsClient.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabSecretInner; +import com.azure.resourcemanager.devtestlabs.models.SecretFragment; + +/** An instance of this class provides access to all the operations defined in LabSecretsClient. */ +public interface LabSecretsClient { + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabSecretInner get(String resourceGroupName, String labName, String name); + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabSecretInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, LabSecretInner labSecret); + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabSecretInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, LabSecretInner labSecret, Context context); + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabSecretInner createOrUpdate(String resourceGroupName, String labName, String name, LabSecretInner labSecret); + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabSecretInner createOrUpdate( + String resourceGroupName, String labName, String name, LabSecretInner labSecret, Context context); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String name, Context context); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String labName, String name); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String labName, String name, Context context); + + /** + * Allows modifying tags of lab secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param secret Allows modifying tags of lab secrets. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabSecretInner update(String resourceGroupName, String labName, String name, SecretFragment secret); + + /** + * Allows modifying tags of lab secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param secret Allows modifying tags of lab secrets. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 shared secret in a lab along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String labName, String name, SecretFragment secret, Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java index 7c67e3a3e40d..9bf818d424a6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/LabsClient.java @@ -14,11 +14,11 @@ import com.azure.resourcemanager.devtestlabs.fluent.models.GenerateUploadUriResponseInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabVhdInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; import com.azure.resourcemanager.devtestlabs.models.LabFragment; -import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; /** An instance of this class provides access to all the operations defined in LabsClient. */ public interface LabsClient { @@ -27,7 +27,7 @@ public interface LabsClient { * * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -35,18 +35,17 @@ public interface LabsClient { /** * List labs in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); + PagedIterable list(String filter, Integer top, String orderby, Context context); /** * List labs in a resource group. @@ -55,7 +54,7 @@ public interface LabsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -64,19 +63,18 @@ public interface LabsClient { * List labs in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context); + String resourceGroupName, String filter, Integer top, String orderby, Context context); /** * Get lab. @@ -96,16 +94,14 @@ PagedIterable listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String name, String expand, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); /** * Create or replace an existing lab. This operation can take a while to complete. @@ -116,9 +112,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return the {@link SyncPoller} for polling of a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabInner> beginCreateOrUpdate(String resourceGroupName, String name, LabInner lab); /** @@ -131,9 +127,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return the {@link SyncPoller} for polling of a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabInner> beginCreateOrUpdate( String resourceGroupName, String name, LabInner lab, Context context); @@ -174,9 +170,9 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String name); /** @@ -188,9 +184,9 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); /** @@ -223,7 +219,7 @@ SyncPoller, LabInner> beginCreateOrUpdate( * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param lab A lab. + * @param lab Allows modifying tags of labs. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -237,12 +233,12 @@ SyncPoller, LabInner> beginCreateOrUpdate( * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param lab A lab. + * @param lab Allows modifying tags of labs. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 lab. + * @return a lab along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse(String resourceGroupName, String name, LabFragment lab, Context context); @@ -255,9 +251,9 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name); /** @@ -269,9 +265,9 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name, Context context); /** @@ -308,11 +304,13 @@ SyncPoller, LabInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginCreateEnvironment( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter); + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter); /** * Create virtual machines in a lab. This operation can take a while to complete. @@ -324,13 +322,13 @@ SyncPoller, Void> beginCreateEnvironment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginCreateEnvironment( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context); /** @@ -345,7 +343,9 @@ SyncPoller, Void> beginCreateEnvironment( */ @ServiceMethod(returns = ReturnType.SINGLE) void createEnvironment( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter); + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter); /** * Create virtual machines in a lab. This operation can take a while to complete. @@ -362,9 +362,35 @@ void createEnvironment( void createEnvironment( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context); + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void ensureCurrentUserProfile(String resourceGroupName, String name); + + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response ensureCurrentUserProfileWithResponse(String resourceGroupName, String name, Context context); + /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * @@ -374,9 +400,9 @@ void createEnvironment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters); @@ -390,9 +416,9 @@ SyncPoller, Void> beginExportResourceUsage( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, @@ -456,7 +482,7 @@ GenerateUploadUriResponseInner generateUploadUri( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 body for generating an upload URI. + * @return response body for generating an upload URI along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response generateUploadUriWithResponse( @@ -472,9 +498,9 @@ Response generateUploadUriWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest); @@ -489,9 +515,9 @@ SyncPoller, Void> beginImportVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, @@ -540,7 +566,7 @@ void importVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listVhds(String resourceGroupName, String name); @@ -554,7 +580,7 @@ void importVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listVhds(String resourceGroupName, String name, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java index 2cdf8ee32c5e..47a29917a879 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/NotificationChannelsClient.java @@ -23,7 +23,8 @@ public interface NotificationChannelsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -33,25 +34,19 @@ public interface NotificationChannelsClient { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get notification channel. @@ -73,19 +68,18 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + String resourceGroupName, String labName, String name, Context context); /** - * Create or replace an existing notification channel. + * Create or replace an existing Notification Channel. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -101,7 +95,7 @@ NotificationChannelInner createOrUpdate( String resourceGroupName, String labName, String name, NotificationChannelInner notificationChannel); /** - * Create or replace an existing notification channel. + * Create or replace an existing Notification Channel. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -111,7 +105,7 @@ NotificationChannelInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification. + * @return a notification along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -144,7 +138,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -155,7 +149,7 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param notificationChannel Allows modifying tags of notification channels. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -171,12 +165,12 @@ NotificationChannelInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param notificationChannel Allows modifying tags of notification channels. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 notification. + * @return a notification along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -211,7 +205,7 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response notifyWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java index de71e11a3351..3279f22e4dc6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/OperationsClient.java @@ -34,7 +34,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String locationName, String name, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java index 375754a907f0..e88c4caeefa5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PoliciesClient.java @@ -23,7 +23,7 @@ public interface PoliciesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String policySetName); @@ -34,22 +34,20 @@ public interface PoliciesClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, @@ -77,16 +75,15 @@ PagedIterable list( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, String labName, String policySetName, String name, String expand, Context context); + String resourceGroupName, String labName, String policySetName, String name, Context context); /** * Create or replace an existing policy. @@ -117,7 +114,7 @@ PolicyInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy. + * @return a Policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -153,7 +150,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -166,7 +163,7 @@ Response deleteWithResponse( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param policy A Policy. + * @param policy Allows modifying tags of policies. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -183,12 +180,12 @@ PolicyInner update( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param policy A Policy. + * @param policy Allows modifying tags of policies. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Policy. + * @return a Policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java index 41aec72bb87e..96e4c6387310 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/PolicySetsClient.java @@ -6,13 +6,46 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.EvaluatePoliciesResponseInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.PolicySetInner; import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; /** An instance of this class provides access to all the operations defined in PolicySetsClient. */ public interface PolicySetsClient { + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + /** * Evaluates lab policy. * @@ -40,7 +73,7 @@ EvaluatePoliciesResponseInner evaluatePolicies( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 body for evaluating a policy set. + * @return response body for evaluating a policy set along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response evaluatePoliciesWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java index 8b5762ace47c..4d6810b96d7c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ProviderOperationsClient.java @@ -17,7 +17,7 @@ public interface ProviderOperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface ProviderOperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java index ea32206bbdd6..f3f59fc6a4d6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SchedulesClient.java @@ -24,7 +24,7 @@ public interface SchedulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -34,25 +34,18 @@ public interface SchedulesClient { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get schedule. @@ -74,16 +67,14 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Create or replace an existing schedule. @@ -111,7 +102,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -140,7 +131,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -151,7 +142,7 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -166,12 +157,12 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -186,9 +177,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String name); /** @@ -201,9 +192,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String name, Context context); @@ -243,7 +234,7 @@ SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listApplicable(String resourceGroupName, String labName, String name); @@ -258,7 +249,7 @@ SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listApplicable(String resourceGroupName, String labName, String name, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java index 4eefb92a8939..2433d858ee0e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SecretsClient.java @@ -25,7 +25,7 @@ public interface SecretsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String username); @@ -36,22 +36,20 @@ public interface SecretsClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -79,16 +77,15 @@ PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context); + String resourceGroupName, String labName, String username, String name, Context context); /** * Create or replace an existing secret. This operation can take a while to complete. @@ -101,9 +98,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. + * @return the {@link SyncPoller} for polling of a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret); @@ -119,9 +116,9 @@ SyncPoller, SecretInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 secret. + * @return the {@link SyncPoller} for polling of a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret, Context context); @@ -185,7 +182,7 @@ SecretInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -198,7 +195,7 @@ Response deleteWithResponse( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param secret A secret. + * @param secret Allows modifying tags of secrets. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -214,12 +211,12 @@ Response deleteWithResponse( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param secret A secret. + * @param secret Allows modifying tags of secrets. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 secret. + * @return a secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java index 76f59363278b..8a0c3acbccd5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricSchedulesClient.java @@ -26,7 +26,7 @@ public interface ServiceFabricSchedulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -39,15 +39,14 @@ PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -55,7 +54,6 @@ PagedIterable list( String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby, @@ -85,12 +83,11 @@ PagedIterable list( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -99,7 +96,6 @@ Response getWithResponse( String username, String serviceFabricName, String name, - String expand, Context context); /** @@ -138,7 +134,7 @@ ScheduleInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -177,7 +173,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -196,7 +192,7 @@ Response deleteWithResponse( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -219,12 +215,12 @@ ScheduleInner update( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -247,9 +243,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String username, String serviceFabricName, String name); @@ -265,9 +261,9 @@ SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java index dfd47c899d69..36dc23491213 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceFabricsClient.java @@ -26,7 +26,7 @@ public interface ServiceFabricsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String username); @@ -38,14 +38,14 @@ public interface ServiceFabricsClient { * @param labName The name of the lab. * @param username The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -85,14 +85,14 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( String resourceGroupName, String labName, String username, String name, String expand, Context context); /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -102,14 +102,14 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric. + * @return the {@link SyncPoller} for polling of a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric); /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -120,9 +120,9 @@ SyncPoller, ServiceFabricInner> beginCreateOrUpda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Service Fabric. + * @return the {@link SyncPoller} for polling of a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -132,7 +132,7 @@ SyncPoller, ServiceFabricInner> beginCreateOrUpda Context context); /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -149,7 +149,7 @@ ServiceFabricInner createOrUpdate( String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric); /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -181,9 +181,9 @@ ServiceFabricInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name); @@ -198,9 +198,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context); @@ -240,7 +240,7 @@ SyncPoller, Void> beginDelete( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param serviceFabric Allows modifying tags of service fabrics. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -257,12 +257,12 @@ ServiceFabricInner update( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param serviceFabric Allows modifying tags of service fabrics. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Service Fabric. + * @return a Service Fabric along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -300,7 +300,7 @@ ApplicableScheduleInner listApplicableSchedules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listApplicableSchedulesWithResponse( @@ -316,9 +316,9 @@ Response listApplicableSchedulesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name); @@ -333,9 +333,9 @@ SyncPoller, Void> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name, Context context); @@ -378,9 +378,9 @@ SyncPoller, Void> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop( String resourceGroupName, String labName, String username, String name); @@ -395,9 +395,9 @@ SyncPoller, Void> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop( String resourceGroupName, String labName, String username, String name, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java index bd2b2736a4cb..51c8d7b02b52 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/ServiceRunnersClient.java @@ -6,12 +6,46 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner; /** An instance of this class provides access to all the operations defined in ServiceRunnersClient. */ public interface ServiceRunnersClient { + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + /** * Get service runner. * @@ -36,14 +70,47 @@ public interface ServiceRunnersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( String resourceGroupName, String labName, String name, Context context); /** - * Create or replace an existing service runner. + * Create or replace an existing Service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param serviceRunner A container for a managed identity to execute DevTest lab services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container for a managed identity to execute DevTest lab services. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceRunnerInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner); + + /** + * Create or replace an existing Service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param serviceRunner A container for a managed identity to execute DevTest lab services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container for a managed identity to execute DevTest lab services. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceRunnerInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context); + + /** + * Create or replace an existing Service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -59,7 +126,7 @@ ServiceRunnerInner createOrUpdate( String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner); /** - * Create or replace an existing service runner. + * Create or replace an existing Service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -72,11 +139,41 @@ ServiceRunnerInner createOrUpdate( * @return a container for a managed identity to execute DevTest lab services. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( + ServiceRunnerInner createOrUpdate( String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context); /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); + + /** + * Delete service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String name, Context context); + + /** + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -89,7 +186,7 @@ Response createOrUpdateWithResponse( void delete(String resourceGroupName, String labName, String name); /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -98,8 +195,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); + void delete(String resourceGroupName, String labName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SharedGalleriesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SharedGalleriesClient.java new file mode 100644 index 000000000000..c9344b224751 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SharedGalleriesClient.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.devtestlabs.models.SharedGalleryFragment; + +/** An instance of this class provides access to all the operations defined in SharedGalleriesClient. */ +public interface SharedGalleriesClient { + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName); + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedGalleryInner get(String resourceGroupName, String labName, String name); + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String labName, String name, Context context); + + /** + * Create or replace an existing Shared Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Properties of a shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedGalleryInner createOrUpdate( + String resourceGroupName, String labName, String name, SharedGalleryInner sharedGallery); + + /** + * Create or replace an existing Shared Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Properties of a shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String labName, String name, SharedGalleryInner sharedGallery, Context context); + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String labName, String name); + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); + + /** + * Allows modifying tags of shared galleries. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Allows modifying tags of shared galleries. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedGalleryInner update( + String resourceGroupName, String labName, String name, SharedGalleryFragment sharedGallery); + + /** + * Allows modifying tags of shared galleries. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Allows modifying tags of shared galleries. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String labName, String name, SharedGalleryFragment sharedGallery, Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SharedImagesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SharedImagesClient.java new file mode 100644 index 000000000000..539a11006ee1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/SharedImagesClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedImageInner; +import com.azure.resourcemanager.devtestlabs.models.SharedImageFragment; + +/** An instance of this class provides access to all the operations defined in SharedImagesClient. */ +public interface SharedImagesClient { + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String labName, String sharedGalleryName); + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby, + Context context); + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedImageInner get(String resourceGroupName, String labName, String sharedGalleryName, String name); + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + String expand, + Context context); + + /** + * Create or replace an existing Shared Image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Properties of a shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedImageInner createOrUpdate( + String resourceGroupName, String labName, String sharedGalleryName, String name, SharedImageInner sharedImage); + + /** + * Create or replace an existing Shared Image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Properties of a shared image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageInner sharedImage, + Context context); + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String labName, String sharedGalleryName, String name); + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String labName, String sharedGalleryName, String name, Context context); + + /** + * Allows modifying tags of shared images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Allows modifying tags of shared images. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SharedImageInner update( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageFragment sharedImage); + + /** + * Allows modifying tags of shared images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Allows modifying tags of shared images. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageFragment sharedImage, + Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java index 4b11461cecb0..e10154ff0fd6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/UsersClient.java @@ -24,7 +24,7 @@ public interface UsersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -34,25 +34,18 @@ public interface UsersClient { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get user profile. @@ -74,16 +67,14 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Create or replace an existing user profile. This operation can take a while to complete. @@ -95,9 +86,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the {@link SyncPoller} for polling of profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user); @@ -112,9 +103,9 @@ SyncPoller, UserInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the {@link SyncPoller} for polling of profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user, Context context); @@ -158,9 +149,9 @@ SyncPoller, UserInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -173,9 +164,9 @@ SyncPoller, UserInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context); @@ -212,7 +203,7 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param user Allows modifying tags of user profiles. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -227,12 +218,12 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param user Allows modifying tags of user profiles. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java index f65bbd0104c7..27b70a441176 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachineSchedulesClient.java @@ -25,7 +25,7 @@ public interface VirtualMachineSchedulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName, String virtualMachineName); @@ -36,22 +36,20 @@ public interface VirtualMachineSchedulesClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, @@ -79,21 +77,15 @@ PagedIterable list( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String resourceGroupName, - String labName, - String virtualMachineName, - String name, - String expand, - Context context); + String resourceGroupName, String labName, String virtualMachineName, String name, Context context); /** * Create or replace an existing schedule. @@ -124,7 +116,7 @@ ScheduleInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -160,7 +152,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -173,7 +165,7 @@ Response deleteWithResponse( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -190,12 +182,12 @@ ScheduleInner update( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -216,9 +208,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name); @@ -233,9 +225,9 @@ SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java index 317f3a8544ea..c4f69e012c6c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualMachinesClient.java @@ -30,7 +30,7 @@ public interface VirtualMachinesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -42,14 +42,14 @@ public interface VirtualMachinesClient { * @param labName The name of the lab. * @param expand Specify the $expand query. Example: * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -87,14 +87,14 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( String resourceGroupName, String labName, String name, String expand, Context context); /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -103,14 +103,14 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine. + * @return the {@link SyncPoller} for polling of a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine); /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -120,9 +120,9 @@ SyncPoller, LabVirtualMachineInner> beginCrea * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -131,7 +131,7 @@ SyncPoller, LabVirtualMachineInner> beginCrea Context context); /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -147,7 +147,7 @@ LabVirtualMachineInner createOrUpdate( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine); /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -176,9 +176,9 @@ LabVirtualMachineInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -191,9 +191,9 @@ LabVirtualMachineInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context); @@ -230,7 +230,7 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param labVirtualMachine Allows modifying tags of virtual machines. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -246,12 +246,12 @@ LabVirtualMachineInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param labVirtualMachine Allows modifying tags of virtual machines. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return a virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -271,9 +271,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties); @@ -288,9 +288,9 @@ SyncPoller, Void> beginAddDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, Context context); @@ -334,9 +334,9 @@ void addDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest); @@ -351,9 +351,9 @@ SyncPoller, Void> beginApplyArtifacts( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, @@ -405,9 +405,9 @@ void applyArtifacts( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaim(String resourceGroupName, String labName, String name); /** @@ -420,9 +420,9 @@ void applyArtifacts( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginClaim( String resourceGroupName, String labName, String name, Context context); @@ -453,6 +453,35 @@ SyncPoller, Void> beginClaim( @ServiceMethod(returns = ReturnType.SINGLE) void claim(String resourceGroupName, String labName, String name, Context context); + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void clearArtifactResults(String resourceGroupName, String labName, String name); + + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response clearArtifactResultsWithResponse( + String resourceGroupName, String labName, String name, Context context); + /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * @@ -463,9 +492,9 @@ SyncPoller, Void> beginClaim( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties); @@ -480,9 +509,9 @@ SyncPoller, Void> beginDetachDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, @@ -549,7 +578,8 @@ void detachDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 string that represents the contents of the RDP file for the virtual machine. + * @return a string that represents the contents of the RDP file for the virtual machine along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getRdpFileContentsWithResponse( @@ -579,7 +609,7 @@ Response getRdpFileContentsWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listApplicableSchedulesWithResponse( @@ -594,9 +624,9 @@ Response listApplicableSchedulesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRedeploy(String resourceGroupName, String labName, String name); /** @@ -609,9 +639,9 @@ Response listApplicableSchedulesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRedeploy( String resourceGroupName, String labName, String name, Context context); @@ -652,9 +682,9 @@ SyncPoller, Void> beginRedeploy( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -672,9 +702,9 @@ SyncPoller, Void> beginResize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -729,9 +759,9 @@ void resize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRestart(String resourceGroupName, String labName, String name); /** @@ -744,9 +774,9 @@ void resize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRestart( String resourceGroupName, String labName, String name, Context context); @@ -786,9 +816,9 @@ SyncPoller, Void> beginRestart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart(String resourceGroupName, String labName, String name); /** @@ -801,9 +831,9 @@ SyncPoller, Void> beginRestart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart( String resourceGroupName, String labName, String name, Context context); @@ -843,9 +873,9 @@ SyncPoller, Void> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop(String resourceGroupName, String labName, String name); /** @@ -858,9 +888,9 @@ SyncPoller, Void> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop( String resourceGroupName, String labName, String name, Context context); @@ -901,9 +931,9 @@ SyncPoller, Void> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTransferDisks(String resourceGroupName, String labName, String name); /** @@ -917,9 +947,9 @@ SyncPoller, Void> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTransferDisks( String resourceGroupName, String labName, String name, Context context); @@ -961,9 +991,9 @@ SyncPoller, Void> beginTransferDisks( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginUnClaim(String resourceGroupName, String labName, String name); /** @@ -976,9 +1006,9 @@ SyncPoller, Void> beginTransferDisks( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginUnClaim( String resourceGroupName, String labName, String name, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java index aa4dc054554c..1d5313f97e27 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/VirtualNetworksClient.java @@ -24,7 +24,7 @@ public interface VirtualNetworksClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String labName); @@ -35,14 +35,14 @@ public interface VirtualNetworksClient { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -79,7 +79,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -95,9 +95,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network. + * @return the {@link SyncPoller} for polling of a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork); @@ -112,9 +112,9 @@ SyncPoller, VirtualNetworkInner> beginCreateOrUp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 network. + * @return the {@link SyncPoller} for polling of a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context); @@ -160,9 +160,9 @@ VirtualNetworkInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name); /** @@ -175,9 +175,9 @@ VirtualNetworkInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context); @@ -214,7 +214,7 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param virtualNetwork Allows modifying tags of virtual networks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -230,12 +230,12 @@ VirtualNetworkInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param virtualNetwork Allows modifying tags of virtual networks. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 network. + * @return a virtual network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java index 1fb9d099da1c..9780ed6552e9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableScheduleInner.java @@ -5,86 +5,448 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.Tags; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level. */ -@JsonFlatten @Fluent -public class ApplicableScheduleInner extends Resource { +public final class ApplicableScheduleInner extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicableScheduleInner.class); /* - * The auto-shutdown schedule, if one has been set at the lab or lab - * resource level. + * The properties of the resource. */ - @JsonProperty(value = "properties.labVmsShutdown") - private ScheduleInner labVmsShutdown; + @JsonProperty(value = "properties", required = true) + private ApplicableSchedulePropertiesInner innerProperties = new ApplicableSchedulePropertiesInner(); /* - * The auto-startup schedule, if one has been set at the lab or lab - * resource level. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.labVmsStartup") - private ScheduleInner labVmsStartup; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource - * level. + * Get the innerProperties property: The properties of the resource. * - * @return the labVmsShutdown value. + * @return the innerProperties value. */ - public ScheduleInner labVmsShutdown() { - return this.labVmsShutdown; + private ApplicableSchedulePropertiesInner innerProperties() { + return this.innerProperties; } /** - * Set the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource - * level. + * Get the systemData property: The system metadata relating to this resource. * - * @param labVmsShutdown the labVmsShutdown value to set. + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ApplicableScheduleInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerProperties() == null ? null : this.innerProperties().systemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. * @return the ApplicableScheduleInner object itself. */ - public ApplicableScheduleInner withLabVmsShutdown(ScheduleInner labVmsShutdown) { - this.labVmsShutdown = labVmsShutdown; + public ApplicableScheduleInner withStatus(EnableStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withStatus(status); return this; } /** - * Get the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). * - * @return the labVmsStartup value. + * @return the taskType value. */ - public ScheduleInner labVmsStartup() { - return this.labVmsStartup; + public String taskType() { + return this.innerProperties() == null ? null : this.innerProperties().taskType(); } /** - * Set the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). * - * @param labVmsStartup the labVmsStartup value to set. + * @param taskType the taskType value to set. * @return the ApplicableScheduleInner object itself. */ - public ApplicableScheduleInner withLabVmsStartup(ScheduleInner labVmsStartup) { - this.labVmsStartup = labVmsStartup; + public ApplicableScheduleInner withTaskType(String taskType) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withTaskType(taskType); return this; } - /** {@inheritDoc} */ - @Override + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withTimeZoneId(String timeZoneId) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withTargetResourceId(String targetResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withTargetResourceId(targetResourceId); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerProperties() == null ? null : this.innerProperties().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withWeekdays(List weekdays) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerProperties() == null ? null : this.innerProperties().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withTime(String time) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerProperties() == null ? null : this.innerProperties().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withMinute(Integer minute) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withMinute(minute); + return this; + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().statusNotificationSettingsStatus(); + } + + /** + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withStatusNotificationSettingsStatus(EnableStatus statusNotificationSettingsStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withTimeInMinutes(Integer timeInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withWebhookUrl(String webhookUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withEmailRecipient(String emailRecipient) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withNotificationLocale(String notificationLocale) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String location() { + return this.innerProperties() == null ? null : this.innerProperties().location(); + } + + /** + * Set the location property: the geo-location where the resource live. + * + * @param location the location value to set. + * @return the ApplicableScheduleInner object itself. + */ public ApplicableScheduleInner withLocation(String location) { - super.withLocation(location); + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withLocation(location); return this; } - /** {@inheritDoc} */ - @Override - public ApplicableScheduleInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the tags property: the tags of the resource. + * + * @return the tags value. + */ + public Map tagsPropertiesTags() { + return this.innerProperties() == null ? null : this.innerProperties().tags(); + } + + /** + * Set the tags property: the tags of the resource. + * + * @param tags the tags value to set. + * @return the ApplicableScheduleInner object itself. + */ + public ApplicableScheduleInner withTagsPropertiesTags(Map tags) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicableSchedulePropertiesInner(); + } + this.innerProperties().withTags(tags); return this; } @@ -93,12 +455,16 @@ public ApplicableScheduleInner withTags(Map tags) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ + @Override public void validate() { - if (labVmsShutdown() != null) { - labVmsShutdown().validate(); - } - if (labVmsStartup() != null) { - labVmsStartup().validate(); + super.validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ApplicableScheduleInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java new file mode 100644 index 000000000000..352bbdd7dbbd --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ApplicableSchedulePropertiesInner.java @@ -0,0 +1,859 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of a schedules applicable to a virtual machine. */ +@Fluent +public final class ApplicableSchedulePropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicableSchedulePropertiesInner.class); + + /* + * The auto-shutdown schedule, if one has been set at the lab or lab + * resource level. + */ + @JsonProperty(value = "labVmsShutdown") + private ScheduleInner innerLabVmsShutdown; + + /* + * The auto-startup schedule, if one has been set at the lab or lab + * resource level. + */ + @JsonProperty(value = "labVmsStartup") + private ScheduleInner innerLabVmsStartup; + + /** + * Get the innerLabVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource + * level. + * + * @return the innerLabVmsShutdown value. + */ + private ScheduleInner innerLabVmsShutdown() { + return this.innerLabVmsShutdown; + } + + /** + * Get the innerLabVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource + * level. + * + * @return the innerLabVmsStartup value. + */ + private ScheduleInner innerLabVmsStartup() { + return this.innerLabVmsStartup; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().systemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().status(); + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withStatus(EnableStatus status) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withStatus(status); + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().taskType(); + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTaskType(String taskType) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withTaskType(taskType); + return this; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().timeZoneId(); + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTimeZoneId(String timeZoneId) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().targetResourceId(); + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTargetResourceId(String targetResourceId) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withTargetResourceId(targetResourceId); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withWeekdays(List weekdays) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTime(String time) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withMinute(Integer minute) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withMinute(minute); + return this; + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerLabVmsShutdown() == null + ? null + : this.innerLabVmsShutdown().statusNotificationSettingsStatus(); + } + + /** + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withStatusNotificationSettingsStatus( + EnableStatus statusNotificationSettingsStatus) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTimeInMinutes(Integer timeInMinutes) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withWebhookUrl(String webhookUrl) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withEmailRecipient(String emailRecipient) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withNotificationLocale(String notificationLocale) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String location() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().location(); + } + + /** + * Set the location property: the geo-location where the resource live. + * + * @param location the location value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withLocation(String location) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withLocation(location); + return this; + } + + /** + * Get the tags property: the tags of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.innerLabVmsShutdown() == null ? null : this.innerLabVmsShutdown().tags(); + } + + /** + * Set the tags property: the tags of the resource. + * + * @param tags the tags value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTags(Map tags) { + if (this.innerLabVmsShutdown() == null) { + this.innerLabVmsShutdown = new ScheduleInner(); + } + this.innerLabVmsShutdown().withTags(tags); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().systemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().status(); + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withStatus(EnableStatus status) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withStatus(status); + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().taskType(); + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTaskType(String taskType) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withTaskType(taskType); + return this; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().timeZoneId(); + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTimeZoneId(String timeZoneId) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().targetResourceId(); + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTargetResourceId(String targetResourceId) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withTargetResourceId(targetResourceId); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withWeekdays(List weekdays) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTime(String time) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withMinute(Integer minute) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withMinute(minute); + return this; + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().statusNotificationSettingsStatus(); + } + + /** + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withStatusNotificationSettingsStatus( + EnableStatus statusNotificationSettingsStatus) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTimeInMinutes(Integer timeInMinutes) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withWebhookUrl(String webhookUrl) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withEmailRecipient(String emailRecipient) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withNotificationLocale(String notificationLocale) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String location() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().location(); + } + + /** + * Set the location property: the geo-location where the resource live. + * + * @param location the location value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withLocation(String location) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withLocation(location); + return this; + } + + /** + * Get the tags property: the tags of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.innerLabVmsStartup() == null ? null : this.innerLabVmsStartup().tags(); + } + + /** + * Set the tags property: the tags of the resource. + * + * @param tags the tags value to set. + * @return the ApplicableSchedulePropertiesInner object itself. + */ + public ApplicableSchedulePropertiesInner withTags(Map tags) { + if (this.innerLabVmsStartup() == null) { + this.innerLabVmsStartup = new ScheduleInner(); + } + this.innerLabVmsStartup().withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerLabVmsShutdown() != null) { + innerLabVmsShutdown().validate(); + } + if (innerLabVmsStartup() != null) { + innerLabVmsStartup().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java index fa6c94a5a485..8613243cd083 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateInner.java @@ -4,71 +4,50 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.ParametersValueFileInfo; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; -import java.util.Map; /** An Azure Resource Manager template. */ -@JsonFlatten -@Immutable -public class ArmTemplateInner extends Resource { +@Fluent +public final class ArmTemplateInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmTemplateInner.class); /* - * The display name of the ARM template. + * The properties of the resource. */ - @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; + @JsonProperty(value = "properties", required = true) + private ArmTemplateProperties innerProperties = new ArmTemplateProperties(); /* - * The description of the ARM template. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The publisher of the ARM template. - */ - @JsonProperty(value = "properties.publisher", access = JsonProperty.Access.WRITE_ONLY) - private String publisher; - - /* - * The URI to the icon of the ARM template. - */ - @JsonProperty(value = "properties.icon", access = JsonProperty.Access.WRITE_ONLY) - private String icon; - - /* - * The contents of the ARM template. - */ - @JsonProperty(value = "properties.contents", access = JsonProperty.Access.WRITE_ONLY) - private Object contents; - - /* - * The creation date of the armTemplate. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * File name and parameter values information from all - * azuredeploy.*.parameters.json for the ARM template. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.parametersValueFilesInfo", access = JsonProperty.Access.WRITE_ONLY) - private List parametersValueFilesInfo; + private ArmTemplateProperties innerProperties() { + return this.innerProperties; + } - /* - * Whether or not ARM template is enabled for use by lab user. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.enabled", access = JsonProperty.Access.WRITE_ONLY) - private Boolean enabled; + public SystemData systemData() { + return this.systemData; + } /** * Get the displayName property: The display name of the ARM template. @@ -76,7 +55,7 @@ public class ArmTemplateInner extends Resource { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -85,7 +64,7 @@ public String displayName() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -94,7 +73,7 @@ public String description() { * @return the publisher value. */ public String publisher() { - return this.publisher; + return this.innerProperties() == null ? null : this.innerProperties().publisher(); } /** @@ -103,7 +82,7 @@ public String publisher() { * @return the icon value. */ public String icon() { - return this.icon; + return this.innerProperties() == null ? null : this.innerProperties().icon(); } /** @@ -112,7 +91,7 @@ public String icon() { * @return the contents value. */ public Object contents() { - return this.contents; + return this.innerProperties() == null ? null : this.innerProperties().contents(); } /** @@ -121,7 +100,7 @@ public Object contents() { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -131,7 +110,7 @@ public OffsetDateTime createdDate() { * @return the parametersValueFilesInfo value. */ public List parametersValueFilesInfo() { - return this.parametersValueFilesInfo; + return this.innerProperties() == null ? null : this.innerProperties().parametersValueFilesInfo(); } /** @@ -140,21 +119,7 @@ public List parametersValueFilesInfo() { * @return the enabled value. */ public Boolean enabled() { - return this.enabled; - } - - /** {@inheritDoc} */ - @Override - public ArmTemplateInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ArmTemplateInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** @@ -163,8 +128,13 @@ public ArmTemplateInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (parametersValueFilesInfo() != null) { - parametersValueFilesInfo().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ArmTemplateInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java new file mode 100644 index 000000000000..f1dc551ff667 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArmTemplateProperties.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ParametersValueFileInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of an Azure Resource Manager template. */ +@Immutable +public final class ArmTemplateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmTemplateProperties.class); + + /* + * The display name of the ARM template. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The description of the ARM template. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The publisher of the ARM template. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * The URI to the icon of the ARM template. + */ + @JsonProperty(value = "icon", access = JsonProperty.Access.WRITE_ONLY) + private String icon; + + /* + * The contents of the ARM template. + */ + @JsonProperty(value = "contents", access = JsonProperty.Access.WRITE_ONLY) + private Object contents; + + /* + * The creation date of the armTemplate. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * File name and parameter values information from all + * azuredeploy.*.parameters.json for the ARM template. + */ + @JsonProperty(value = "parametersValueFilesInfo", access = JsonProperty.Access.WRITE_ONLY) + private List parametersValueFilesInfo; + + /* + * Whether or not ARM template is enabled for use by lab user. + */ + @JsonProperty(value = "enabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enabled; + + /** + * Get the displayName property: The display name of the ARM template. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the ARM template. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the publisher property: The publisher of the ARM template. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the icon property: The URI to the icon of the ARM template. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Get the contents property: The contents of the ARM template. + * + * @return the contents value. + */ + public Object contents() { + return this.contents; + } + + /** + * Get the createdDate property: The creation date of the armTemplate. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the parametersValueFilesInfo property: File name and parameter values information from all + * azuredeploy.*.parameters.json for the ARM template. + * + * @return the parametersValueFilesInfo value. + */ + public List parametersValueFilesInfo() { + return this.parametersValueFilesInfo; + } + + /** + * Get the enabled property: Whether or not ARM template is enabled for use by lab user. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parametersValueFilesInfo() != null) { + parametersValueFilesInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactDeploymentStatusProperties.java similarity index 98% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactDeploymentStatusProperties.java index e4d551c9552c..74fab36c9e91 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactDeploymentStatusProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactDeploymentStatusProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java index 337b3537e162..ccde688d0033 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactInner.java @@ -4,68 +4,48 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -import java.util.Map; /** An artifact. */ -@JsonFlatten -@Immutable -public class ArtifactInner extends Resource { +@Fluent +public final class ArtifactInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactInner.class); /* - * The artifact's title. + * The properties of the resource. */ - @JsonProperty(value = "properties.title", access = JsonProperty.Access.WRITE_ONLY) - private String title; + @JsonProperty(value = "properties", required = true) + private ArtifactProperties innerProperties = new ArtifactProperties(); /* - * The artifact's description. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The artifact's publisher. - */ - @JsonProperty(value = "properties.publisher", access = JsonProperty.Access.WRITE_ONLY) - private String publisher; - - /* - * The file path to the artifact. - */ - @JsonProperty(value = "properties.filePath", access = JsonProperty.Access.WRITE_ONLY) - private String filePath; - - /* - * The URI to the artifact icon. - */ - @JsonProperty(value = "properties.icon", access = JsonProperty.Access.WRITE_ONLY) - private String icon; - - /* - * The artifact's target OS. - */ - @JsonProperty(value = "properties.targetOsType", access = JsonProperty.Access.WRITE_ONLY) - private String targetOsType; - - /* - * The artifact's parameters. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.parameters", access = JsonProperty.Access.WRITE_ONLY) - private Object parameters; + private ArtifactProperties innerProperties() { + return this.innerProperties; + } - /* - * The artifact's creation date. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + public SystemData systemData() { + return this.systemData; + } /** * Get the title property: The artifact's title. @@ -73,7 +53,7 @@ public class ArtifactInner extends Resource { * @return the title value. */ public String title() { - return this.title; + return this.innerProperties() == null ? null : this.innerProperties().title(); } /** @@ -82,7 +62,7 @@ public String title() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -91,7 +71,7 @@ public String description() { * @return the publisher value. */ public String publisher() { - return this.publisher; + return this.innerProperties() == null ? null : this.innerProperties().publisher(); } /** @@ -100,7 +80,7 @@ public String publisher() { * @return the filePath value. */ public String filePath() { - return this.filePath; + return this.innerProperties() == null ? null : this.innerProperties().filePath(); } /** @@ -109,7 +89,7 @@ public String filePath() { * @return the icon value. */ public String icon() { - return this.icon; + return this.innerProperties() == null ? null : this.innerProperties().icon(); } /** @@ -118,7 +98,7 @@ public String icon() { * @return the targetOsType value. */ public String targetOsType() { - return this.targetOsType; + return this.innerProperties() == null ? null : this.innerProperties().targetOsType(); } /** @@ -127,7 +107,7 @@ public String targetOsType() { * @return the parameters value. */ public Object parameters() { - return this.parameters; + return this.innerProperties() == null ? null : this.innerProperties().parameters(); } /** @@ -136,21 +116,7 @@ public Object parameters() { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; - } - - /** {@inheritDoc} */ - @Override - public ArtifactInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ArtifactInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -159,5 +125,12 @@ public ArtifactInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model ArtifactInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java new file mode 100644 index 000000000000..31a53e3c6893 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactProperties.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of an artifact. */ +@Immutable +public final class ArtifactProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactProperties.class); + + /* + * The artifact's title. + */ + @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /* + * The artifact's description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The artifact's publisher. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * The file path to the artifact. + */ + @JsonProperty(value = "filePath", access = JsonProperty.Access.WRITE_ONLY) + private String filePath; + + /* + * The URI to the artifact icon. + */ + @JsonProperty(value = "icon", access = JsonProperty.Access.WRITE_ONLY) + private String icon; + + /* + * The artifact's target OS. + */ + @JsonProperty(value = "targetOsType", access = JsonProperty.Access.WRITE_ONLY) + private String targetOsType; + + /* + * The artifact's parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private Object parameters; + + /* + * The artifact's creation date. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /** + * Get the title property: The artifact's title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the description property: The artifact's description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the publisher property: The artifact's publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the filePath property: The file path to the artifact. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Get the icon property: The URI to the artifact icon. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Get the targetOsType property: The artifact's target OS. + * + * @return the targetOsType value. + */ + public String targetOsType() { + return this.targetOsType; + } + + /** + * Get the parameters property: The artifact's parameters. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Get the createdDate property: The artifact's creation date. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java index eea399ba1661..6389caa27802 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.azure.resourcemanager.devtestlabs.models.SourceControlType; @@ -16,76 +16,53 @@ import java.util.Map; /** Properties of an artifact source. */ -@JsonFlatten @Fluent -public class ArtifactSourceInner extends Resource { +public final class ArtifactSourceInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceInner.class); /* - * The artifact source's display name. + * The properties of the resource. */ - @JsonProperty(value = "properties.displayName") - private String displayName; + @JsonProperty(value = "properties", required = true) + private ArtifactSourceProperties innerProperties = new ArtifactSourceProperties(); /* - * The artifact source's URI. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.uri") - private String uri; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The artifact source's type. - */ - @JsonProperty(value = "properties.sourceType") - private SourceControlType sourceType; - - /* - * The folder containing artifacts. - */ - @JsonProperty(value = "properties.folderPath") - private String folderPath; - - /* - * The folder containing Azure Resource Manager templates. - */ - @JsonProperty(value = "properties.armTemplateFolderPath") - private String armTemplateFolderPath; - - /* - * The artifact source's branch reference. - */ - @JsonProperty(value = "properties.branchRef") - private String branchRef; - - /* - * The security token to authenticate to the artifact source. - */ - @JsonProperty(value = "properties.securityToken") - private String securityToken; - - /* - * Indicates if the artifact source is enabled (values: Enabled, Disabled). + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.status") - private EnableStatus status; + private ArtifactSourceProperties innerProperties() { + return this.innerProperties; + } - /* - * The artifact source's creation date. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public ArtifactSourceInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public ArtifactSourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the displayName property: The artifact source's display name. @@ -93,7 +70,7 @@ public class ArtifactSourceInner extends Resource { * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -103,7 +80,10 @@ public String displayName() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -113,7 +93,7 @@ public ArtifactSourceInner withDisplayName(String displayName) { * @return the uri value. */ public String uri() { - return this.uri; + return this.innerProperties() == null ? null : this.innerProperties().uri(); } /** @@ -123,7 +103,10 @@ public String uri() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withUri(String uri) { - this.uri = uri; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withUri(uri); return this; } @@ -133,7 +116,7 @@ public ArtifactSourceInner withUri(String uri) { * @return the sourceType value. */ public SourceControlType sourceType() { - return this.sourceType; + return this.innerProperties() == null ? null : this.innerProperties().sourceType(); } /** @@ -143,7 +126,10 @@ public SourceControlType sourceType() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withSourceType(SourceControlType sourceType) { - this.sourceType = sourceType; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withSourceType(sourceType); return this; } @@ -153,7 +139,7 @@ public ArtifactSourceInner withSourceType(SourceControlType sourceType) { * @return the folderPath value. */ public String folderPath() { - return this.folderPath; + return this.innerProperties() == null ? null : this.innerProperties().folderPath(); } /** @@ -163,7 +149,10 @@ public String folderPath() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withFolderPath(String folderPath) { - this.folderPath = folderPath; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withFolderPath(folderPath); return this; } @@ -173,7 +162,7 @@ public ArtifactSourceInner withFolderPath(String folderPath) { * @return the armTemplateFolderPath value. */ public String armTemplateFolderPath() { - return this.armTemplateFolderPath; + return this.innerProperties() == null ? null : this.innerProperties().armTemplateFolderPath(); } /** @@ -183,7 +172,10 @@ public String armTemplateFolderPath() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withArmTemplateFolderPath(String armTemplateFolderPath) { - this.armTemplateFolderPath = armTemplateFolderPath; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withArmTemplateFolderPath(armTemplateFolderPath); return this; } @@ -193,7 +185,7 @@ public ArtifactSourceInner withArmTemplateFolderPath(String armTemplateFolderPat * @return the branchRef value. */ public String branchRef() { - return this.branchRef; + return this.innerProperties() == null ? null : this.innerProperties().branchRef(); } /** @@ -203,7 +195,10 @@ public String branchRef() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withBranchRef(String branchRef) { - this.branchRef = branchRef; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withBranchRef(branchRef); return this; } @@ -213,7 +208,7 @@ public ArtifactSourceInner withBranchRef(String branchRef) { * @return the securityToken value. */ public String securityToken() { - return this.securityToken; + return this.innerProperties() == null ? null : this.innerProperties().securityToken(); } /** @@ -223,7 +218,10 @@ public String securityToken() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withSecurityToken(String securityToken) { - this.securityToken = securityToken; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withSecurityToken(securityToken); return this; } @@ -233,7 +231,7 @@ public ArtifactSourceInner withSecurityToken(String securityToken) { * @return the status value. */ public EnableStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -243,7 +241,10 @@ public EnableStatus status() { * @return the ArtifactSourceInner object itself. */ public ArtifactSourceInner withStatus(EnableStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new ArtifactSourceProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -253,7 +254,7 @@ public ArtifactSourceInner withStatus(EnableStatus status) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -262,7 +263,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -271,21 +272,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public ArtifactSourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ArtifactSourceInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -294,5 +281,13 @@ public ArtifactSourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ArtifactSourceInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java new file mode 100644 index 000000000000..fdd6a62a31e8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ArtifactSourceProperties.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.SourceControlType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of an artifact source. */ +@Fluent +public final class ArtifactSourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceProperties.class); + + /* + * The artifact source's display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The artifact source's URI. + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * The artifact source's type. + */ + @JsonProperty(value = "sourceType") + private SourceControlType sourceType; + + /* + * The folder containing artifacts. + */ + @JsonProperty(value = "folderPath") + private String folderPath; + + /* + * The folder containing Azure Resource Manager templates. + */ + @JsonProperty(value = "armTemplateFolderPath") + private String armTemplateFolderPath; + + /* + * The artifact source's branch reference. + */ + @JsonProperty(value = "branchRef") + private String branchRef; + + /* + * The security token to authenticate to the artifact source. + */ + @JsonProperty(value = "securityToken") + private String securityToken; + + /* + * Indicates if the artifact source is enabled (values: Enabled, Disabled). + */ + @JsonProperty(value = "status") + private EnableStatus status; + + /* + * The artifact source's creation date. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the displayName property: The artifact source's display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The artifact source's display name. + * + * @param displayName the displayName value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the uri property: The artifact source's URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The artifact source's URI. + * + * @param uri the uri value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the sourceType property: The artifact source's type. + * + * @return the sourceType value. + */ + public SourceControlType sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: The artifact source's type. + * + * @param sourceType the sourceType value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withSourceType(SourceControlType sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the folderPath property: The folder containing artifacts. + * + * @return the folderPath value. + */ + public String folderPath() { + return this.folderPath; + } + + /** + * Set the folderPath property: The folder containing artifacts. + * + * @param folderPath the folderPath value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withFolderPath(String folderPath) { + this.folderPath = folderPath; + return this; + } + + /** + * Get the armTemplateFolderPath property: The folder containing Azure Resource Manager templates. + * + * @return the armTemplateFolderPath value. + */ + public String armTemplateFolderPath() { + return this.armTemplateFolderPath; + } + + /** + * Set the armTemplateFolderPath property: The folder containing Azure Resource Manager templates. + * + * @param armTemplateFolderPath the armTemplateFolderPath value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withArmTemplateFolderPath(String armTemplateFolderPath) { + this.armTemplateFolderPath = armTemplateFolderPath; + return this; + } + + /** + * Get the branchRef property: The artifact source's branch reference. + * + * @return the branchRef value. + */ + public String branchRef() { + return this.branchRef; + } + + /** + * Set the branchRef property: The artifact source's branch reference. + * + * @param branchRef the branchRef value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withBranchRef(String branchRef) { + this.branchRef = branchRef; + return this; + } + + /** + * Get the securityToken property: The security token to authenticate to the artifact source. + * + * @return the securityToken value. + */ + public String securityToken() { + return this.securityToken; + } + + /** + * Set the securityToken property: The security token to authenticate to the artifact source. + * + * @param securityToken the securityToken value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withSecurityToken(String securityToken) { + this.securityToken = securityToken; + return this; + } + + /** + * Get the status property: Indicates if the artifact source is enabled (values: Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates if the artifact source is enabled (values: Enabled, Disabled). + * + * @param status the status value to set. + * @return the ArtifactSourceProperties object itself. + */ + public ArtifactSourceProperties withStatus(EnableStatus status) { + this.status = status; + return this; + } + + /** + * Get the createdDate property: The artifact source's creation date. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/AttachNewDataDiskOptions.java similarity index 95% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/AttachNewDataDiskOptions.java index 5670c4db1df8..1f7488b68653 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/AttachNewDataDiskOptions.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/AttachNewDataDiskOptions.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.StorageType; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BastionHostInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BastionHostInner.java new file mode 100644 index 000000000000..131e54745f5d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BastionHostInner.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Profile of a Bastion Host. */ +@Fluent +public final class BastionHostInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostInner.class); + + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties", required = true) + private BastionHostProperties innerProperties = new BastionHostProperties(); + + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. + */ + private BastionHostProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public BastionHostInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BastionHostInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the externalBastionHostId property: The ID of the external BastionHost resource that corresponds to this DTL + * BastionHost. + * + * @return the externalBastionHostId value. + */ + public String externalBastionHostId() { + return this.innerProperties() == null ? null : this.innerProperties().externalBastionHostId(); + } + + /** + * Get the ipAddressId property: The ID of the PublicIpAddress resource that is created by and paired with this + * BastionHost. + * + * @return the ipAddressId value. + */ + public String ipAddressId() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddressId(); + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model BastionHostInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BastionHostProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BastionHostProperties.java new file mode 100644 index 000000000000..6883336d1bd8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BastionHostProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a BastionHost profile. */ +@Immutable +public final class BastionHostProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostProperties.class); + + /* + * The ID of the external BastionHost resource that corresponds to this DTL + * BastionHost + */ + @JsonProperty(value = "externalBastionHostId", access = JsonProperty.Access.WRITE_ONLY) + private String externalBastionHostId; + + /* + * The ID of the PublicIpAddress resource that is created by and paired + * with this BastionHost + */ + @JsonProperty(value = "ipAddressId", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddressId; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the externalBastionHostId property: The ID of the external BastionHost resource that corresponds to this DTL + * BastionHost. + * + * @return the externalBastionHostId value. + */ + public String externalBastionHostId() { + return this.externalBastionHostId; + } + + /** + * Get the ipAddressId property: The ID of the PublicIpAddress resource that is created by and paired with this + * BastionHost. + * + * @return the ipAddressId value. + */ + public String ipAddressId() { + return this.ipAddressId; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BulkCreationParameters.java similarity index 96% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BulkCreationParameters.java index a6e65e513300..a95f5ebea657 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BulkCreationParameters.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/BulkCreationParameters.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ComputeVmProperties.java similarity index 96% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ComputeVmProperties.java index fe66c661f455..25b004268a01 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ComputeVmProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ComputeVmProperties.java @@ -2,10 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java index 4c183a014e1d..b1e3f5ca22dd 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesCustom; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromPlan; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm; +import com.azure.resourcemanager.devtestlabs.models.CustomImageOsType; import com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import com.azure.resourcemanager.devtestlabs.models.WindowsOsState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -19,121 +19,51 @@ import java.util.Map; /** A custom image. */ -@JsonFlatten @Fluent -public class CustomImageInner extends Resource { +public final class CustomImageInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageInner.class); /* - * The virtual machine from which the image is to be created. + * The properties of the resource. */ - @JsonProperty(value = "properties.vm") - private CustomImagePropertiesFromVm vm; + @JsonProperty(value = "properties", required = true) + private CustomImageProperties innerProperties = new CustomImageProperties(); /* - * The VHD from which the image is to be created. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.vhd") - private CustomImagePropertiesCustom vhd; - - /* - * The description of the custom image. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The author of the custom image. - */ - @JsonProperty(value = "properties.author") - private String author; - - /* - * The creation date of the custom image. - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /* - * The Managed Image Id backing the custom image. - */ - @JsonProperty(value = "properties.managedImageId") - private String managedImageId; - - /* - * The Managed Snapshot Id backing the custom image. - */ - @JsonProperty(value = "properties.managedSnapshotId") - private String managedSnapshotId; - - /* - * Storage information about the data disks present in the custom image - */ - @JsonProperty(value = "properties.dataDiskStorageInfo") - private List dataDiskStorageInfo; - - /* - * Storage information about the plan related to this custom image - */ - @JsonProperty(value = "properties.customImagePlan") - private CustomImagePropertiesFromPlan customImagePlan; - - /* - * Whether or not the custom images underlying offer/plan has been enabled - * for programmatic deployment - */ - @JsonProperty(value = "properties.isPlanAuthorized") - private Boolean isPlanAuthorized; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the vm property: The virtual machine from which the image is to be created. + * Get the innerProperties property: The properties of the resource. * - * @return the vm value. + * @return the innerProperties value. */ - public CustomImagePropertiesFromVm vm() { - return this.vm; + private CustomImageProperties innerProperties() { + return this.innerProperties; } /** - * Set the vm property: The virtual machine from which the image is to be created. + * Get the systemData property: The system metadata relating to this resource. * - * @param vm the vm value to set. - * @return the CustomImageInner object itself. + * @return the systemData value. */ - public CustomImageInner withVm(CustomImagePropertiesFromVm vm) { - this.vm = vm; - return this; + public SystemData systemData() { + return this.systemData; } - /** - * Get the vhd property: The VHD from which the image is to be created. - * - * @return the vhd value. - */ - public CustomImagePropertiesCustom vhd() { - return this.vhd; + /** {@inheritDoc} */ + @Override + public CustomImageInner withLocation(String location) { + super.withLocation(location); + return this; } - /** - * Set the vhd property: The VHD from which the image is to be created. - * - * @param vhd the vhd value to set. - * @return the CustomImageInner object itself. - */ - public CustomImageInner withVhd(CustomImagePropertiesCustom vhd) { - this.vhd = vhd; + /** {@inheritDoc} */ + @Override + public CustomImageInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -143,7 +73,7 @@ public CustomImageInner withVhd(CustomImagePropertiesCustom vhd) { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -153,7 +83,10 @@ public String description() { * @return the CustomImageInner object itself. */ public CustomImageInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -163,7 +96,7 @@ public CustomImageInner withDescription(String description) { * @return the author value. */ public String author() { - return this.author; + return this.innerProperties() == null ? null : this.innerProperties().author(); } /** @@ -173,7 +106,10 @@ public String author() { * @return the CustomImageInner object itself. */ public CustomImageInner withAuthor(String author) { - this.author = author; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withAuthor(author); return this; } @@ -183,7 +119,7 @@ public CustomImageInner withAuthor(String author) { * @return the creationDate value. */ public OffsetDateTime creationDate() { - return this.creationDate; + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); } /** @@ -192,7 +128,7 @@ public OffsetDateTime creationDate() { * @return the managedImageId value. */ public String managedImageId() { - return this.managedImageId; + return this.innerProperties() == null ? null : this.innerProperties().managedImageId(); } /** @@ -202,7 +138,10 @@ public String managedImageId() { * @return the CustomImageInner object itself. */ public CustomImageInner withManagedImageId(String managedImageId) { - this.managedImageId = managedImageId; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withManagedImageId(managedImageId); return this; } @@ -212,7 +151,7 @@ public CustomImageInner withManagedImageId(String managedImageId) { * @return the managedSnapshotId value. */ public String managedSnapshotId() { - return this.managedSnapshotId; + return this.innerProperties() == null ? null : this.innerProperties().managedSnapshotId(); } /** @@ -222,7 +161,10 @@ public String managedSnapshotId() { * @return the CustomImageInner object itself. */ public CustomImageInner withManagedSnapshotId(String managedSnapshotId) { - this.managedSnapshotId = managedSnapshotId; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withManagedSnapshotId(managedSnapshotId); return this; } @@ -232,7 +174,7 @@ public CustomImageInner withManagedSnapshotId(String managedSnapshotId) { * @return the dataDiskStorageInfo value. */ public List dataDiskStorageInfo() { - return this.dataDiskStorageInfo; + return this.innerProperties() == null ? null : this.innerProperties().dataDiskStorageInfo(); } /** @@ -242,27 +184,10 @@ public List dataDiskStorageInfo() { * @return the CustomImageInner object itself. */ public CustomImageInner withDataDiskStorageInfo(List dataDiskStorageInfo) { - this.dataDiskStorageInfo = dataDiskStorageInfo; - return this; - } - - /** - * Get the customImagePlan property: Storage information about the plan related to this custom image. - * - * @return the customImagePlan value. - */ - public CustomImagePropertiesFromPlan customImagePlan() { - return this.customImagePlan; - } - - /** - * Set the customImagePlan property: Storage information about the plan related to this custom image. - * - * @param customImagePlan the customImagePlan value to set. - * @return the CustomImageInner object itself. - */ - public CustomImageInner withCustomImagePlan(CustomImagePropertiesFromPlan customImagePlan) { - this.customImagePlan = customImagePlan; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withDataDiskStorageInfo(dataDiskStorageInfo); return this; } @@ -273,7 +198,7 @@ public CustomImageInner withCustomImagePlan(CustomImagePropertiesFromPlan custom * @return the isPlanAuthorized value. */ public Boolean isPlanAuthorized() { - return this.isPlanAuthorized; + return this.innerProperties() == null ? null : this.innerProperties().isPlanAuthorized(); } /** @@ -284,7 +209,10 @@ public Boolean isPlanAuthorized() { * @return the CustomImageInner object itself. */ public CustomImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) { - this.isPlanAuthorized = isPlanAuthorized; + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withIsPlanAuthorized(isPlanAuthorized); return this; } @@ -294,7 +222,7 @@ public CustomImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -303,40 +231,235 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** {@inheritDoc} */ - @Override - public CustomImageInner withLocation(String location) { - super.withLocation(location); + /** + * Get the sourceVmId property: The source vm identifier. + * + * @return the sourceVmId value. + */ + public String sourceVmId() { + return this.innerProperties() == null ? null : this.innerProperties().sourceVmId(); + } + + /** + * Set the sourceVmId property: The source vm identifier. + * + * @param sourceVmId the sourceVmId value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withSourceVmId(String sourceVmId) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withSourceVmId(sourceVmId); return this; } - /** {@inheritDoc} */ - @Override - public CustomImageInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied). + * + * @return the windowsOsState value. + */ + public WindowsOsState windowsOsState() { + return this.innerProperties() == null ? null : this.innerProperties().windowsOsState(); + } + + /** + * Set the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied). + * + * @param windowsOsState the windowsOsState value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withWindowsOsState(WindowsOsState windowsOsState) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withWindowsOsState(windowsOsState); return this; } /** - * Validates the instance. + * Get the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the linuxOsState value. */ - public void validate() { - if (vm() != null) { - vm().validate(); + public LinuxOsState linuxOsState() { + return this.innerProperties() == null ? null : this.innerProperties().linuxOsState(); + } + + /** + * Set the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). + * + * @param linuxOsState the linuxOsState value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withLinuxOsState(LinuxOsState linuxOsState) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withLinuxOsState(linuxOsState); + return this; + } + + /** + * Get the imageName property: The image name. + * + * @return the imageName value. + */ + public String imageName() { + return this.innerProperties() == null ? null : this.innerProperties().imageName(); + } + + /** + * Set the imageName property: The image name. + * + * @param imageName the imageName value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withImageName(String imageName) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withImageName(imageName); + return this; + } + + /** + * Get the sysPrep property: Indicates whether sysprep has been run on the VHD. + * + * @return the sysPrep value. + */ + public Boolean sysPrep() { + return this.innerProperties() == null ? null : this.innerProperties().sysPrep(); + } + + /** + * Set the sysPrep property: Indicates whether sysprep has been run on the VHD. + * + * @param sysPrep the sysPrep value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withSysPrep(Boolean sysPrep) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withSysPrep(sysPrep); + return this; + } + + /** + * Get the osType property: The OS type of the custom image (i.e. Windows, Linux). + * + * @return the osType value. + */ + public CustomImageOsType osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The OS type of the custom image (i.e. Windows, Linux). + * + * @param osType the osType value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withOsType(CustomImageOsType osType) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); } - if (vhd() != null) { - vhd().validate(); + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the id property: The id of the plan, equivalent to name of the plan. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Set the id property: The id of the plan, equivalent to name of the plan. + * + * @param id the id value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withIdPropertiesId(String id) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); } - if (dataDiskStorageInfo() != null) { - dataDiskStorageInfo().forEach(e -> e.validate()); + this.innerProperties().withId(id); + return this; + } + + /** + * Get the publisher property: The publisher for the plan from the marketplace image the custom image is derived + * from. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The publisher for the plan from the marketplace image the custom image is derived + * from. + * + * @param publisher the publisher value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); } - if (customImagePlan() != null) { - customImagePlan().validate(); + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the offer property: The offer for the plan from the marketplace image the custom image is derived from. + * + * @return the offer value. + */ + public String offer() { + return this.innerProperties() == null ? null : this.innerProperties().offer(); + } + + /** + * Set the offer property: The offer for the plan from the marketplace image the custom image is derived from. + * + * @param offer the offer value to set. + * @return the CustomImageInner object itself. + */ + public CustomImageInner withOffer(String offer) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomImageProperties(); + } + this.innerProperties().withOffer(offer); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model CustomImageInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java new file mode 100644 index 000000000000..673cdf5fbbb1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageProperties.java @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.CustomImageOsType; +import com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import com.azure.resourcemanager.devtestlabs.models.WindowsOsState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a custom image. */ +@Fluent +public final class CustomImageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageProperties.class); + + /* + * The virtual machine from which the image is to be created. + */ + @JsonProperty(value = "vm") + private CustomImagePropertiesFromVm innerVm; + + /* + * The VHD from which the image is to be created. + */ + @JsonProperty(value = "vhd") + private CustomImagePropertiesCustom innerVhd; + + /* + * The description of the custom image. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The author of the custom image. + */ + @JsonProperty(value = "author") + private String author; + + /* + * The creation date of the custom image. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The Managed Image Id backing the custom image. + */ + @JsonProperty(value = "managedImageId") + private String managedImageId; + + /* + * The Managed Snapshot Id backing the custom image. + */ + @JsonProperty(value = "managedSnapshotId") + private String managedSnapshotId; + + /* + * Storage information about the data disks present in the custom image + */ + @JsonProperty(value = "dataDiskStorageInfo") + private List dataDiskStorageInfo; + + /* + * Storage information about the plan related to this custom image + */ + @JsonProperty(value = "customImagePlan") + private CustomImagePropertiesFromPlan innerCustomImagePlan; + + /* + * Whether or not the custom images underlying offer/plan has been enabled + * for programmatic deployment + */ + @JsonProperty(value = "isPlanAuthorized") + private Boolean isPlanAuthorized; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the innerVm property: The virtual machine from which the image is to be created. + * + * @return the innerVm value. + */ + private CustomImagePropertiesFromVm innerVm() { + return this.innerVm; + } + + /** + * Get the innerVhd property: The VHD from which the image is to be created. + * + * @return the innerVhd value. + */ + private CustomImagePropertiesCustom innerVhd() { + return this.innerVhd; + } + + /** + * Get the description property: The description of the custom image. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the custom image. + * + * @param description the description value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the author property: The author of the custom image. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Set the author property: The author of the custom image. + * + * @param author the author value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withAuthor(String author) { + this.author = author; + return this; + } + + /** + * Get the creationDate property: The creation date of the custom image. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the managedImageId property: The Managed Image Id backing the custom image. + * + * @return the managedImageId value. + */ + public String managedImageId() { + return this.managedImageId; + } + + /** + * Set the managedImageId property: The Managed Image Id backing the custom image. + * + * @param managedImageId the managedImageId value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withManagedImageId(String managedImageId) { + this.managedImageId = managedImageId; + return this; + } + + /** + * Get the managedSnapshotId property: The Managed Snapshot Id backing the custom image. + * + * @return the managedSnapshotId value. + */ + public String managedSnapshotId() { + return this.managedSnapshotId; + } + + /** + * Set the managedSnapshotId property: The Managed Snapshot Id backing the custom image. + * + * @param managedSnapshotId the managedSnapshotId value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withManagedSnapshotId(String managedSnapshotId) { + this.managedSnapshotId = managedSnapshotId; + return this; + } + + /** + * Get the dataDiskStorageInfo property: Storage information about the data disks present in the custom image. + * + * @return the dataDiskStorageInfo value. + */ + public List dataDiskStorageInfo() { + return this.dataDiskStorageInfo; + } + + /** + * Set the dataDiskStorageInfo property: Storage information about the data disks present in the custom image. + * + * @param dataDiskStorageInfo the dataDiskStorageInfo value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withDataDiskStorageInfo(List dataDiskStorageInfo) { + this.dataDiskStorageInfo = dataDiskStorageInfo; + return this; + } + + /** + * Get the innerCustomImagePlan property: Storage information about the plan related to this custom image. + * + * @return the innerCustomImagePlan value. + */ + private CustomImagePropertiesFromPlan innerCustomImagePlan() { + return this.innerCustomImagePlan; + } + + /** + * Get the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for + * programmatic deployment. + * + * @return the isPlanAuthorized value. + */ + public Boolean isPlanAuthorized() { + return this.isPlanAuthorized; + } + + /** + * Set the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for + * programmatic deployment. + * + * @param isPlanAuthorized the isPlanAuthorized value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withIsPlanAuthorized(Boolean isPlanAuthorized) { + this.isPlanAuthorized = isPlanAuthorized; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the sourceVmId property: The source vm identifier. + * + * @return the sourceVmId value. + */ + public String sourceVmId() { + return this.innerVm() == null ? null : this.innerVm().sourceVmId(); + } + + /** + * Set the sourceVmId property: The source vm identifier. + * + * @param sourceVmId the sourceVmId value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withSourceVmId(String sourceVmId) { + if (this.innerVm() == null) { + this.innerVm = new CustomImagePropertiesFromVm(); + } + this.innerVm().withSourceVmId(sourceVmId); + return this; + } + + /** + * Get the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied). + * + * @return the windowsOsState value. + */ + public WindowsOsState windowsOsState() { + return this.innerVm() == null ? null : this.innerVm().windowsOsState(); + } + + /** + * Set the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied). + * + * @param windowsOsState the windowsOsState value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withWindowsOsState(WindowsOsState windowsOsState) { + if (this.innerVm() == null) { + this.innerVm = new CustomImagePropertiesFromVm(); + } + this.innerVm().withWindowsOsState(windowsOsState); + return this; + } + + /** + * Get the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). + * + * @return the linuxOsState value. + */ + public LinuxOsState linuxOsState() { + return this.innerVm() == null ? null : this.innerVm().linuxOsState(); + } + + /** + * Set the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). + * + * @param linuxOsState the linuxOsState value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withLinuxOsState(LinuxOsState linuxOsState) { + if (this.innerVm() == null) { + this.innerVm = new CustomImagePropertiesFromVm(); + } + this.innerVm().withLinuxOsState(linuxOsState); + return this; + } + + /** + * Get the imageName property: The image name. + * + * @return the imageName value. + */ + public String imageName() { + return this.innerVhd() == null ? null : this.innerVhd().imageName(); + } + + /** + * Set the imageName property: The image name. + * + * @param imageName the imageName value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withImageName(String imageName) { + if (this.innerVhd() == null) { + this.innerVhd = new CustomImagePropertiesCustom(); + } + this.innerVhd().withImageName(imageName); + return this; + } + + /** + * Get the sysPrep property: Indicates whether sysprep has been run on the VHD. + * + * @return the sysPrep value. + */ + public Boolean sysPrep() { + return this.innerVhd() == null ? null : this.innerVhd().sysPrep(); + } + + /** + * Set the sysPrep property: Indicates whether sysprep has been run on the VHD. + * + * @param sysPrep the sysPrep value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withSysPrep(Boolean sysPrep) { + if (this.innerVhd() == null) { + this.innerVhd = new CustomImagePropertiesCustom(); + } + this.innerVhd().withSysPrep(sysPrep); + return this; + } + + /** + * Get the osType property: The OS type of the custom image (i.e. Windows, Linux). + * + * @return the osType value. + */ + public CustomImageOsType osType() { + return this.innerVhd() == null ? null : this.innerVhd().osType(); + } + + /** + * Set the osType property: The OS type of the custom image (i.e. Windows, Linux). + * + * @param osType the osType value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withOsType(CustomImageOsType osType) { + if (this.innerVhd() == null) { + this.innerVhd = new CustomImagePropertiesCustom(); + } + this.innerVhd().withOsType(osType); + return this; + } + + /** + * Get the id property: The id of the plan, equivalent to name of the plan. + * + * @return the id value. + */ + public String id() { + return this.innerCustomImagePlan() == null ? null : this.innerCustomImagePlan().id(); + } + + /** + * Set the id property: The id of the plan, equivalent to name of the plan. + * + * @param id the id value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withId(String id) { + if (this.innerCustomImagePlan() == null) { + this.innerCustomImagePlan = new CustomImagePropertiesFromPlan(); + } + this.innerCustomImagePlan().withId(id); + return this; + } + + /** + * Get the publisher property: The publisher for the plan from the marketplace image the custom image is derived + * from. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerCustomImagePlan() == null ? null : this.innerCustomImagePlan().publisher(); + } + + /** + * Set the publisher property: The publisher for the plan from the marketplace image the custom image is derived + * from. + * + * @param publisher the publisher value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withPublisher(String publisher) { + if (this.innerCustomImagePlan() == null) { + this.innerCustomImagePlan = new CustomImagePropertiesFromPlan(); + } + this.innerCustomImagePlan().withPublisher(publisher); + return this; + } + + /** + * Get the offer property: The offer for the plan from the marketplace image the custom image is derived from. + * + * @return the offer value. + */ + public String offer() { + return this.innerCustomImagePlan() == null ? null : this.innerCustomImagePlan().offer(); + } + + /** + * Set the offer property: The offer for the plan from the marketplace image the custom image is derived from. + * + * @param offer the offer value to set. + * @return the CustomImageProperties object itself. + */ + public CustomImageProperties withOffer(String offer) { + if (this.innerCustomImagePlan() == null) { + this.innerCustomImagePlan = new CustomImagePropertiesFromPlan(); + } + this.innerCustomImagePlan().withOffer(offer); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerVm() != null) { + innerVm().validate(); + } + if (innerVhd() != null) { + innerVhd().validate(); + } + if (dataDiskStorageInfo() != null) { + dataDiskStorageInfo().forEach(e -> e.validate()); + } + if (innerCustomImagePlan() != null) { + innerCustomImagePlan().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesCustom.java similarity index 95% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesCustom.java index 50c6747c88f4..2cd6f1a16c83 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesCustom.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesCustom.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.CustomImageOsType; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesFromPlan.java similarity index 98% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesFromPlan.java index 10542dff3d5a..4e742d3cf32a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromPlan.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesFromPlan.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesFromVm.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesFromVm.java new file mode 100644 index 000000000000..5f750aea0d2e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImagePropertiesFromVm.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import com.azure.resourcemanager.devtestlabs.models.WindowsOsState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for creating a custom image from a virtual machine. */ +@Fluent +public final class CustomImagePropertiesFromVm { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImagePropertiesFromVm.class); + + /* + * The source vm identifier. + */ + @JsonProperty(value = "sourceVmId") + private String sourceVmId; + + /* + * The Windows OS information of the VM. + */ + @JsonProperty(value = "windowsOsInfo") + private WindowsOsInfo innerWindowsOsInfo; + + /* + * The Linux OS information of the VM. + */ + @JsonProperty(value = "linuxOsInfo") + private LinuxOsInfo innerLinuxOsInfo; + + /** + * Get the sourceVmId property: The source vm identifier. + * + * @return the sourceVmId value. + */ + public String sourceVmId() { + return this.sourceVmId; + } + + /** + * Set the sourceVmId property: The source vm identifier. + * + * @param sourceVmId the sourceVmId value to set. + * @return the CustomImagePropertiesFromVm object itself. + */ + public CustomImagePropertiesFromVm withSourceVmId(String sourceVmId) { + this.sourceVmId = sourceVmId; + return this; + } + + /** + * Get the innerWindowsOsInfo property: The Windows OS information of the VM. + * + * @return the innerWindowsOsInfo value. + */ + private WindowsOsInfo innerWindowsOsInfo() { + return this.innerWindowsOsInfo; + } + + /** + * Get the innerLinuxOsInfo property: The Linux OS information of the VM. + * + * @return the innerLinuxOsInfo value. + */ + private LinuxOsInfo innerLinuxOsInfo() { + return this.innerLinuxOsInfo; + } + + /** + * Get the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied). + * + * @return the windowsOsState value. + */ + public WindowsOsState windowsOsState() { + return this.innerWindowsOsInfo() == null ? null : this.innerWindowsOsInfo().windowsOsState(); + } + + /** + * Set the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied). + * + * @param windowsOsState the windowsOsState value to set. + * @return the CustomImagePropertiesFromVm object itself. + */ + public CustomImagePropertiesFromVm withWindowsOsState(WindowsOsState windowsOsState) { + if (this.innerWindowsOsInfo() == null) { + this.innerWindowsOsInfo = new WindowsOsInfo(); + } + this.innerWindowsOsInfo().withWindowsOsState(windowsOsState); + return this; + } + + /** + * Get the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). + * + * @return the linuxOsState value. + */ + public LinuxOsState linuxOsState() { + return this.innerLinuxOsInfo() == null ? null : this.innerLinuxOsInfo().linuxOsState(); + } + + /** + * Set the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). + * + * @param linuxOsState the linuxOsState value to set. + * @return the CustomImagePropertiesFromVm object itself. + */ + public CustomImagePropertiesFromVm withLinuxOsState(LinuxOsState linuxOsState) { + if (this.innerLinuxOsInfo() == null) { + this.innerLinuxOsInfo = new LinuxOsInfo(); + } + this.innerLinuxOsInfo().withLinuxOsState(linuxOsState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerWindowsOsInfo() != null) { + innerWindowsOsInfo().validate(); + } + if (innerLinuxOsInfo() != null) { + innerLinuxOsInfo().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DayDetails.java similarity index 95% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DayDetails.java index 7341b2a692ee..d770d955e729 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DayDetails.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DayDetails.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java index e0846e50558f..6a9b4f6d2b3b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.StorageType; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -15,77 +15,53 @@ import java.util.Map; /** A Disk. */ -@JsonFlatten @Fluent -public class DiskInner extends Resource { +public final class DiskInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskInner.class); /* - * The storage type for the disk (i.e. Standard, Premium). + * The properties of the resource. */ - @JsonProperty(value = "properties.diskType") - private StorageType diskType; + @JsonProperty(value = "properties", required = true) + private DiskProperties innerProperties = new DiskProperties(); /* - * The size of the disk in Gibibytes. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.diskSizeGiB") - private Integer diskSizeGiB; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The resource ID of the VM to which this disk is leased. - */ - @JsonProperty(value = "properties.leasedByLabVmId") - private String leasedByLabVmId; - - /* - * When backed by a blob, the name of the VHD blob without extension. - */ - @JsonProperty(value = "properties.diskBlobName") - private String diskBlobName; - - /* - * When backed by a blob, the URI of underlying blob. - */ - @JsonProperty(value = "properties.diskUri") - private String diskUri; - - /* - * When backed by a blob, the storage account where the blob is. - */ - @JsonProperty(value = "properties.storageAccountId") - private String storageAccountId; - - /* - * The creation date of the disk. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.hostCaching") - private String hostCaching; + private DiskProperties innerProperties() { + return this.innerProperties; + } - /* - * When backed by managed disk, this is the ID of the compute disk - * resource. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.managedDiskId") - private String managedDiskId; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public DiskInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public DiskInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the diskType property: The storage type for the disk (i.e. Standard, Premium). @@ -93,7 +69,7 @@ public class DiskInner extends Resource { * @return the diskType value. */ public StorageType diskType() { - return this.diskType; + return this.innerProperties() == null ? null : this.innerProperties().diskType(); } /** @@ -103,7 +79,10 @@ public StorageType diskType() { * @return the DiskInner object itself. */ public DiskInner withDiskType(StorageType diskType) { - this.diskType = diskType; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskType(diskType); return this; } @@ -113,7 +92,7 @@ public DiskInner withDiskType(StorageType diskType) { * @return the diskSizeGiB value. */ public Integer diskSizeGiB() { - return this.diskSizeGiB; + return this.innerProperties() == null ? null : this.innerProperties().diskSizeGiB(); } /** @@ -123,7 +102,10 @@ public Integer diskSizeGiB() { * @return the DiskInner object itself. */ public DiskInner withDiskSizeGiB(Integer diskSizeGiB) { - this.diskSizeGiB = diskSizeGiB; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskSizeGiB(diskSizeGiB); return this; } @@ -133,7 +115,7 @@ public DiskInner withDiskSizeGiB(Integer diskSizeGiB) { * @return the leasedByLabVmId value. */ public String leasedByLabVmId() { - return this.leasedByLabVmId; + return this.innerProperties() == null ? null : this.innerProperties().leasedByLabVmId(); } /** @@ -143,7 +125,10 @@ public String leasedByLabVmId() { * @return the DiskInner object itself. */ public DiskInner withLeasedByLabVmId(String leasedByLabVmId) { - this.leasedByLabVmId = leasedByLabVmId; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withLeasedByLabVmId(leasedByLabVmId); return this; } @@ -153,7 +138,7 @@ public DiskInner withLeasedByLabVmId(String leasedByLabVmId) { * @return the diskBlobName value. */ public String diskBlobName() { - return this.diskBlobName; + return this.innerProperties() == null ? null : this.innerProperties().diskBlobName(); } /** @@ -163,7 +148,10 @@ public String diskBlobName() { * @return the DiskInner object itself. */ public DiskInner withDiskBlobName(String diskBlobName) { - this.diskBlobName = diskBlobName; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskBlobName(diskBlobName); return this; } @@ -173,7 +161,7 @@ public DiskInner withDiskBlobName(String diskBlobName) { * @return the diskUri value. */ public String diskUri() { - return this.diskUri; + return this.innerProperties() == null ? null : this.innerProperties().diskUri(); } /** @@ -183,7 +171,10 @@ public String diskUri() { * @return the DiskInner object itself. */ public DiskInner withDiskUri(String diskUri) { - this.diskUri = diskUri; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withDiskUri(diskUri); return this; } @@ -193,7 +184,7 @@ public DiskInner withDiskUri(String diskUri) { * @return the storageAccountId value. */ public String storageAccountId() { - return this.storageAccountId; + return this.innerProperties() == null ? null : this.innerProperties().storageAccountId(); } /** @@ -203,7 +194,10 @@ public String storageAccountId() { * @return the DiskInner object itself. */ public DiskInner withStorageAccountId(String storageAccountId) { - this.storageAccountId = storageAccountId; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withStorageAccountId(storageAccountId); return this; } @@ -213,7 +207,7 @@ public DiskInner withStorageAccountId(String storageAccountId) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -222,7 +216,7 @@ public OffsetDateTime createdDate() { * @return the hostCaching value. */ public String hostCaching() { - return this.hostCaching; + return this.innerProperties() == null ? null : this.innerProperties().hostCaching(); } /** @@ -232,7 +226,10 @@ public String hostCaching() { * @return the DiskInner object itself. */ public DiskInner withHostCaching(String hostCaching) { - this.hostCaching = hostCaching; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withHostCaching(hostCaching); return this; } @@ -242,7 +239,7 @@ public DiskInner withHostCaching(String hostCaching) { * @return the managedDiskId value. */ public String managedDiskId() { - return this.managedDiskId; + return this.innerProperties() == null ? null : this.innerProperties().managedDiskId(); } /** @@ -252,7 +249,10 @@ public String managedDiskId() { * @return the DiskInner object itself. */ public DiskInner withManagedDiskId(String managedDiskId) { - this.managedDiskId = managedDiskId; + if (this.innerProperties() == null) { + this.innerProperties = new DiskProperties(); + } + this.innerProperties().withManagedDiskId(managedDiskId); return this; } @@ -262,7 +262,7 @@ public DiskInner withManagedDiskId(String managedDiskId) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -271,21 +271,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public DiskInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DiskInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -294,5 +280,12 @@ public DiskInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model DiskInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java new file mode 100644 index 000000000000..5b1d140ce6d7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DiskProperties.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a disk. */ +@Fluent +public final class DiskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskProperties.class); + + /* + * The storage type for the disk (i.e. Standard, Premium). + */ + @JsonProperty(value = "diskType") + private StorageType diskType; + + /* + * The size of the disk in Gibibytes. + */ + @JsonProperty(value = "diskSizeGiB") + private Integer diskSizeGiB; + + /* + * The resource ID of the VM to which this disk is leased. + */ + @JsonProperty(value = "leasedByLabVmId") + private String leasedByLabVmId; + + /* + * When backed by a blob, the name of the VHD blob without extension. + */ + @JsonProperty(value = "diskBlobName") + private String diskBlobName; + + /* + * When backed by a blob, the URI of underlying blob. + */ + @JsonProperty(value = "diskUri") + private String diskUri; + + /* + * When backed by a blob, the storage account where the blob is. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /* + * The creation date of the disk. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + */ + @JsonProperty(value = "hostCaching") + private String hostCaching; + + /* + * When backed by managed disk, this is the ID of the compute disk + * resource. + */ + @JsonProperty(value = "managedDiskId") + private String managedDiskId; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the diskType property: The storage type for the disk (i.e. Standard, Premium). + * + * @return the diskType value. + */ + public StorageType diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The storage type for the disk (i.e. Standard, Premium). + * + * @param diskType the diskType value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDiskType(StorageType diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskSizeGiB property: The size of the disk in Gibibytes. + * + * @return the diskSizeGiB value. + */ + public Integer diskSizeGiB() { + return this.diskSizeGiB; + } + + /** + * Set the diskSizeGiB property: The size of the disk in Gibibytes. + * + * @param diskSizeGiB the diskSizeGiB value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDiskSizeGiB(Integer diskSizeGiB) { + this.diskSizeGiB = diskSizeGiB; + return this; + } + + /** + * Get the leasedByLabVmId property: The resource ID of the VM to which this disk is leased. + * + * @return the leasedByLabVmId value. + */ + public String leasedByLabVmId() { + return this.leasedByLabVmId; + } + + /** + * Set the leasedByLabVmId property: The resource ID of the VM to which this disk is leased. + * + * @param leasedByLabVmId the leasedByLabVmId value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withLeasedByLabVmId(String leasedByLabVmId) { + this.leasedByLabVmId = leasedByLabVmId; + return this; + } + + /** + * Get the diskBlobName property: When backed by a blob, the name of the VHD blob without extension. + * + * @return the diskBlobName value. + */ + public String diskBlobName() { + return this.diskBlobName; + } + + /** + * Set the diskBlobName property: When backed by a blob, the name of the VHD blob without extension. + * + * @param diskBlobName the diskBlobName value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDiskBlobName(String diskBlobName) { + this.diskBlobName = diskBlobName; + return this; + } + + /** + * Get the diskUri property: When backed by a blob, the URI of underlying blob. + * + * @return the diskUri value. + */ + public String diskUri() { + return this.diskUri; + } + + /** + * Set the diskUri property: When backed by a blob, the URI of underlying blob. + * + * @param diskUri the diskUri value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withDiskUri(String diskUri) { + this.diskUri = diskUri; + return this; + } + + /** + * Get the storageAccountId property: When backed by a blob, the storage account where the blob is. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: When backed by a blob, the storage account where the blob is. + * + * @param storageAccountId the storageAccountId value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the createdDate property: The creation date of the disk. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the hostCaching property: The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + * + * @return the hostCaching value. + */ + public String hostCaching() { + return this.hostCaching; + } + + /** + * Set the hostCaching property: The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + * + * @param hostCaching the hostCaching value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withHostCaching(String hostCaching) { + this.hostCaching = hostCaching; + return this; + } + + /** + * Get the managedDiskId property: When backed by managed disk, this is the ID of the compute disk resource. + * + * @return the managedDiskId value. + */ + public String managedDiskId() { + return this.managedDiskId; + } + + /** + * Set the managedDiskId property: When backed by managed disk, this is the ID of the compute disk resource. + * + * @param managedDiskId the managedDiskId value to set. + * @return the DiskProperties object itself. + */ + public DiskProperties withManagedDiskId(String managedDiskId) { + this.managedDiskId = managedDiskId; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java index 024dc79df197..c149f688e4d5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/DtlEnvironmentInner.java @@ -5,75 +5,61 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties; +import com.azure.resourcemanager.devtestlabs.models.ArmTemplateParameterProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** An environment, which is essentially an ARM template deployment. */ -@JsonFlatten @Fluent -public class DtlEnvironmentInner extends Resource { +public final class DtlEnvironmentInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DtlEnvironmentInner.class); /* - * The deployment properties of the environment. + * The properties of the resource. */ - @JsonProperty(value = "properties.deploymentProperties") - private EnvironmentDeploymentProperties deploymentProperties; + @JsonProperty(value = "properties", required = true) + private EnvironmentProperties innerProperties = new EnvironmentProperties(); /* - * The display name of the Azure Resource Manager template that produced - * the environment. - */ - @JsonProperty(value = "properties.armTemplateDisplayName") - private String armTemplateDisplayName; - - /* - * The identifier of the resource group containing the environment's - * resources. - */ - @JsonProperty(value = "properties.resourceGroupId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroupId; - - /* - * The creator of the environment. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.createdByUser", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUser; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the deploymentProperties property: The deployment properties of the environment. + * Get the innerProperties property: The properties of the resource. * - * @return the deploymentProperties value. + * @return the innerProperties value. */ - public EnvironmentDeploymentProperties deploymentProperties() { - return this.deploymentProperties; + private EnvironmentProperties innerProperties() { + return this.innerProperties; } /** - * Set the deploymentProperties property: The deployment properties of the environment. + * Get the systemData property: The system metadata relating to this resource. * - * @param deploymentProperties the deploymentProperties value to set. - * @return the DtlEnvironmentInner object itself. + * @return the systemData value. */ - public DtlEnvironmentInner withDeploymentProperties(EnvironmentDeploymentProperties deploymentProperties) { - this.deploymentProperties = deploymentProperties; + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public DtlEnvironmentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DtlEnvironmentInner withTags(Map tags) { + super.withTags(tags); return this; } @@ -84,7 +70,7 @@ public DtlEnvironmentInner withDeploymentProperties(EnvironmentDeploymentPropert * @return the armTemplateDisplayName value. */ public String armTemplateDisplayName() { - return this.armTemplateDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().armTemplateDisplayName(); } /** @@ -95,7 +81,10 @@ public String armTemplateDisplayName() { * @return the DtlEnvironmentInner object itself. */ public DtlEnvironmentInner withArmTemplateDisplayName(String armTemplateDisplayName) { - this.armTemplateDisplayName = armTemplateDisplayName; + if (this.innerProperties() == null) { + this.innerProperties = new EnvironmentProperties(); + } + this.innerProperties().withArmTemplateDisplayName(armTemplateDisplayName); return this; } @@ -105,7 +94,7 @@ public DtlEnvironmentInner withArmTemplateDisplayName(String armTemplateDisplayN * @return the resourceGroupId value. */ public String resourceGroupId() { - return this.resourceGroupId; + return this.innerProperties() == null ? null : this.innerProperties().resourceGroupId(); } /** @@ -114,7 +103,7 @@ public String resourceGroupId() { * @return the createdByUser value. */ public String createdByUser() { - return this.createdByUser; + return this.innerProperties() == null ? null : this.innerProperties().createdByUser(); } /** @@ -123,7 +112,7 @@ public String createdByUser() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -132,20 +121,52 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** {@inheritDoc} */ - @Override - public DtlEnvironmentInner withLocation(String location) { - super.withLocation(location); + /** + * Get the armTemplateId property: The Azure Resource Manager template's identifier. + * + * @return the armTemplateId value. + */ + public String armTemplateId() { + return this.innerProperties() == null ? null : this.innerProperties().armTemplateId(); + } + + /** + * Set the armTemplateId property: The Azure Resource Manager template's identifier. + * + * @param armTemplateId the armTemplateId value to set. + * @return the DtlEnvironmentInner object itself. + */ + public DtlEnvironmentInner withArmTemplateId(String armTemplateId) { + if (this.innerProperties() == null) { + this.innerProperties = new EnvironmentProperties(); + } + this.innerProperties().withArmTemplateId(armTemplateId); return this; } - /** {@inheritDoc} */ - @Override - public DtlEnvironmentInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the parameters property: The parameters of the Azure Resource Manager template. + * + * @return the parameters value. + */ + public List parameters() { + return this.innerProperties() == null ? null : this.innerProperties().parameters(); + } + + /** + * Set the parameters property: The parameters of the Azure Resource Manager template. + * + * @param parameters the parameters value to set. + * @return the DtlEnvironmentInner object itself. + */ + public DtlEnvironmentInner withParameters(List parameters) { + if (this.innerProperties() == null) { + this.innerProperties = new EnvironmentProperties(); + } + this.innerProperties().withParameters(parameters); return this; } @@ -155,8 +176,13 @@ public DtlEnvironmentInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (deploymentProperties() != null) { - deploymentProperties().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model DtlEnvironmentInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/Encryption.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/Encryption.java new file mode 100644 index 000000000000..e8e0dc5a56d5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/Encryption.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EncryptionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption settings. */ +@Fluent +public final class Encryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class); + + /* + * Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + */ + @JsonProperty(value = "diskEncryptionSetId") + private String diskEncryptionSetId; + + /* + * Gets or sets the type of key used to encrypt the data of the disk. + * Possible values include: 'EncryptionAtRestWithPlatformKey', + * 'EncryptionAtRestWithCustomerKey' + */ + @JsonProperty(value = "type") + private EncryptionType type; + + /** + * Get the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the Encryption object itself. + */ + public Encryption withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the type property: Gets or sets the type of key used to encrypt the data of the disk. Possible values + * include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @return the type value. + */ + public EncryptionType type() { + return this.type; + } + + /** + * Set the type property: Gets or sets the type of key used to encrypt the data of the disk. Possible values + * include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @param type the type value to set. + * @return the Encryption object itself. + */ + public Encryption withType(EncryptionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentDeploymentProperties.java similarity index 94% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentDeploymentProperties.java index 135c2dcbec13..6110b2bdff69 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnvironmentDeploymentProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentDeploymentProperties.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArmTemplateParameterProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java new file mode 100644 index 000000000000..0c8c772badc0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/EnvironmentProperties.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArmTemplateParameterProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of an environment. */ +@Fluent +public final class EnvironmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentProperties.class); + + /* + * The deployment properties of the environment. + */ + @JsonProperty(value = "deploymentProperties") + private EnvironmentDeploymentProperties innerDeploymentProperties; + + /* + * The display name of the Azure Resource Manager template that produced + * the environment. + */ + @JsonProperty(value = "armTemplateDisplayName") + private String armTemplateDisplayName; + + /* + * The identifier of the resource group containing the environment's + * resources. + */ + @JsonProperty(value = "resourceGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroupId; + + /* + * The creator of the environment. + */ + @JsonProperty(value = "createdByUser", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUser; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the innerDeploymentProperties property: The deployment properties of the environment. + * + * @return the innerDeploymentProperties value. + */ + private EnvironmentDeploymentProperties innerDeploymentProperties() { + return this.innerDeploymentProperties; + } + + /** + * Get the armTemplateDisplayName property: The display name of the Azure Resource Manager template that produced + * the environment. + * + * @return the armTemplateDisplayName value. + */ + public String armTemplateDisplayName() { + return this.armTemplateDisplayName; + } + + /** + * Set the armTemplateDisplayName property: The display name of the Azure Resource Manager template that produced + * the environment. + * + * @param armTemplateDisplayName the armTemplateDisplayName value to set. + * @return the EnvironmentProperties object itself. + */ + public EnvironmentProperties withArmTemplateDisplayName(String armTemplateDisplayName) { + this.armTemplateDisplayName = armTemplateDisplayName; + return this; + } + + /** + * Get the resourceGroupId property: The identifier of the resource group containing the environment's resources. + * + * @return the resourceGroupId value. + */ + public String resourceGroupId() { + return this.resourceGroupId; + } + + /** + * Get the createdByUser property: The creator of the environment. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.createdByUser; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the armTemplateId property: The Azure Resource Manager template's identifier. + * + * @return the armTemplateId value. + */ + public String armTemplateId() { + return this.innerDeploymentProperties() == null ? null : this.innerDeploymentProperties().armTemplateId(); + } + + /** + * Set the armTemplateId property: The Azure Resource Manager template's identifier. + * + * @param armTemplateId the armTemplateId value to set. + * @return the EnvironmentProperties object itself. + */ + public EnvironmentProperties withArmTemplateId(String armTemplateId) { + if (this.innerDeploymentProperties() == null) { + this.innerDeploymentProperties = new EnvironmentDeploymentProperties(); + } + this.innerDeploymentProperties().withArmTemplateId(armTemplateId); + return this; + } + + /** + * Get the parameters property: The parameters of the Azure Resource Manager template. + * + * @return the parameters value. + */ + public List parameters() { + return this.innerDeploymentProperties() == null ? null : this.innerDeploymentProperties().parameters(); + } + + /** + * Set the parameters property: The parameters of the Azure Resource Manager template. + * + * @param parameters the parameters value to set. + * @return the EnvironmentProperties object itself. + */ + public EnvironmentProperties withParameters(List parameters) { + if (this.innerDeploymentProperties() == null) { + this.innerDeploymentProperties = new EnvironmentDeploymentProperties(); + } + this.innerDeploymentProperties().withParameters(parameters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerDeploymentProperties() != null) { + innerDeploymentProperties().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java index 6d92f275805c..7e3ff66660f4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaInner.java @@ -5,69 +5,72 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.FormulaPropertiesFromVm; -import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** A formula for creating a VM, specifying an image base and other parameters. */ -@JsonFlatten @Fluent -public class FormulaInner extends Resource { +public final class FormulaInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(FormulaInner.class); /* - * The description of the formula. + * The properties of the resource. */ - @JsonProperty(value = "properties.description") - private String description; + @JsonProperty(value = "properties", required = true) + private FormulaPropertiesInner innerProperties = new FormulaPropertiesInner(); /* - * The author of the formula. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.author", access = JsonProperty.Access.WRITE_ONLY) - private String author; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The OS type of the formula. - */ - @JsonProperty(value = "properties.osType") - private String osType; - - /* - * The creation date of the formula. - */ - @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationDate; - - /* - * The content of the formula. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.formulaContent") - private LabVirtualMachineCreationParameter formulaContent; + private FormulaPropertiesInner innerProperties() { + return this.innerProperties; + } - /* - * Information about a VM from which a formula is to be created. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.vm") - private FormulaPropertiesFromVm vm; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public FormulaInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public FormulaInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the description property: The description of the formula. @@ -75,7 +78,7 @@ public class FormulaInner extends Resource { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -85,7 +88,10 @@ public String description() { * @return the FormulaInner object itself. */ public FormulaInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withDescription(description); return this; } @@ -95,7 +101,7 @@ public FormulaInner withDescription(String description) { * @return the author value. */ public String author() { - return this.author; + return this.innerProperties() == null ? null : this.innerProperties().author(); } /** @@ -104,7 +110,7 @@ public String author() { * @return the osType value. */ public String osType() { - return this.osType; + return this.innerProperties() == null ? null : this.innerProperties().osType(); } /** @@ -114,7 +120,10 @@ public String osType() { * @return the FormulaInner object itself. */ public FormulaInner withOsType(String osType) { - this.osType = osType; + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withOsType(osType); return this; } @@ -124,92 +133,1425 @@ public FormulaInner withOsType(String osType) { * @return the creationDate value. */ public OffsetDateTime creationDate() { - return this.creationDate; + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); } /** - * Get the formulaContent property: The content of the formula. + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Get the name property: The name of the virtual machine or environment. * - * @return the formulaContent value. + * @return the name value. */ - public LabVirtualMachineCreationParameter formulaContent() { - return this.formulaContent; + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); } /** - * Set the formulaContent property: The content of the formula. + * Set the name property: The name of the virtual machine or environment. * - * @param formulaContent the formulaContent value to set. + * @param name the name value to set. * @return the FormulaInner object itself. */ - public FormulaInner withFormulaContent(LabVirtualMachineCreationParameter formulaContent) { - this.formulaContent = formulaContent; + public FormulaInner withNamePropertiesName(String name) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withName(name); return this; } /** - * Get the vm property: Information about a VM from which a formula is to be created. + * Get the location property: The location of the new virtual machine or environment. * - * @return the vm value. + * @return the location value. */ - public FormulaPropertiesFromVm vm() { - return this.vm; + public String locationPropertiesLocation() { + return this.innerProperties() == null ? null : this.innerProperties().location(); } /** - * Set the vm property: Information about a VM from which a formula is to be created. + * Set the location property: The location of the new virtual machine or environment. * - * @param vm the vm value to set. + * @param location the location value to set. * @return the FormulaInner object itself. */ - public FormulaInner withVm(FormulaPropertiesFromVm vm) { - this.vm = vm; + public FormulaInner withLocationPropertiesLocation(String location) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withLocation(location); return this; } /** - * Get the provisioningState property: The provisioning status of the resource. + * Get the tags property: The tags of the resource. * - * @return the provisioningState value. + * @return the tags value. */ - public String provisioningState() { - return this.provisioningState; + public Map tagsPropertiesTags() { + return this.innerProperties() == null ? null : this.innerProperties().tags(); } /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Set the tags property: The tags of the resource. * - * @return the uniqueIdentifier value. + * @param tags the tags value to set. + * @return the FormulaInner object itself. */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; + public FormulaInner withTagsPropertiesTags(Map tags) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withTags(tags); + return this; } - /** {@inheritDoc} */ - @Override - public FormulaInner withLocation(String location) { - super.withLocation(location); + /** + * Get the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + public String notes() { + return this.innerProperties() == null ? null : this.innerProperties().notes(); + } + + /** + * Set the notes property: The notes of the virtual machine. + * + * @param notes the notes value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withNotes(String notes) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withNotes(notes); return this; } - /** {@inheritDoc} */ - @Override - public FormulaInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + public String ownerObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().ownerObjectId(); + } + + /** + * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @param ownerObjectId the ownerObjectId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withOwnerObjectId(String ownerObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withOwnerObjectId(ownerObjectId); return this; } /** - * Validates the instance. + * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the ownerUserPrincipalName value. */ - public void validate() { - if (formulaContent() != null) { - formulaContent().validate(); + public String ownerUserPrincipalName() { + return this.innerProperties() == null ? null : this.innerProperties().ownerUserPrincipalName(); + } + + /** + * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withOwnerUserPrincipalName(ownerUserPrincipalName); + return this; + } + + /** + * Get the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + public String createdByUserId() { + return this.innerProperties() == null ? null : this.innerProperties().createdByUserId(); + } + + /** + * Get the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.innerProperties() == null ? null : this.innerProperties().createdByUser(); + } + + /** + * Get the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Set the createdDate property: The creation date of the virtual machine. + * + * @param createdDate the createdDate value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withCreatedDate(OffsetDateTime createdDate) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withCreatedDate(createdDate); + return this; + } + + /** + * Get the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + public String computeId() { + return this.innerProperties() == null ? null : this.innerProperties().computeId(); + } + + /** + * Get the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + public String customImageId() { + return this.innerProperties() == null ? null : this.innerProperties().customImageId(); + } + + /** + * Set the customImageId property: The custom image identifier of the virtual machine. + * + * @param customImageId the customImageId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withCustomImageId(String customImageId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withCustomImageId(customImageId); + return this; + } + + /** + * Get the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + public String galleryImageVersionId() { + return this.innerProperties() == null ? null : this.innerProperties().galleryImageVersionId(); + } + + /** + * Set the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @param galleryImageVersionId the galleryImageVersionId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withGalleryImageVersionId(String galleryImageVersionId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withGalleryImageVersionId(galleryImageVersionId); + return this; + } + + /** + * Get the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + public String sharedImageId() { + return this.innerProperties() == null ? null : this.innerProperties().sharedImageId(); + } + + /** + * Set the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @param sharedImageId the sharedImageId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withSharedImageId(String sharedImageId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withSharedImageId(sharedImageId); + return this; + } + + /** + * Get the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + public String sharedImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().sharedImageVersion(); + } + + /** + * Set the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @param sharedImageVersion the sharedImageVersion value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withSharedImageVersion(String sharedImageVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withSharedImageVersion(sharedImageVersion); + return this; + } + + /** + * Get the osTypeFormulaContentOsType property: The OS type of the virtual machine. + * + * @return the osTypeFormulaContentOsType value. + */ + public String osTypeFormulaContentOsType() { + return this.innerProperties() == null ? null : this.innerProperties().osTypeFormulaContentOsType(); + } + + /** + * Get the size property: The size of the virtual machine. + * + * @return the size value. + */ + public String size() { + return this.innerProperties() == null ? null : this.innerProperties().size(); + } + + /** + * Set the size property: The size of the virtual machine. + * + * @param size the size value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withSize(String size) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withSize(size); + return this; + } + + /** + * Get the username property: The user name of the virtual machine. + * + * @return the username value. + */ + public String username() { + return this.innerProperties() == null ? null : this.innerProperties().username(); + } + + /** + * Set the username property: The user name of the virtual machine. + * + * @param username the username value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withUsername(String username) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withUsername(username); + return this; + } + + /** + * Get the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + public String password() { + return this.innerProperties() == null ? null : this.innerProperties().password(); + } + + /** + * Set the password property: The password of the virtual machine administrator. + * + * @param password the password value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withPassword(String password) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withPassword(password); + return this; + } + + /** + * Get the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + public String sshKey() { + return this.innerProperties() == null ? null : this.innerProperties().sshKey(); + } + + /** + * Set the sshKey property: The SSH key of the virtual machine administrator. + * + * @param sshKey the sshKey value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withSshKey(String sshKey) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withSshKey(sshKey); + return this; + } + + /** + * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + public Boolean isAuthenticationWithSshKey() { + return this.innerProperties() == null ? null : this.innerProperties().isAuthenticationWithSshKey(); + } + + /** + * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); } - if (vm() != null) { - vm().validate(); + this.innerProperties().withIsAuthenticationWithSshKey(isAuthenticationWithSshKey); + return this; + } + + /** + * Get the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + public String labSubnetName() { + return this.innerProperties() == null ? null : this.innerProperties().labSubnetName(); + } + + /** + * Set the labSubnetName property: The lab subnet name of the virtual machine. + * + * @param labSubnetName the labSubnetName value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withLabSubnetName(String labSubnetName) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withLabSubnetName(labSubnetName); + return this; + } + + /** + * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + public String labVirtualNetworkId() { + return this.innerProperties() == null ? null : this.innerProperties().labVirtualNetworkId(); + } + + /** + * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @param labVirtualNetworkId the labVirtualNetworkId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withLabVirtualNetworkId(String labVirtualNetworkId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withLabVirtualNetworkId(labVirtualNetworkId); + return this; + } + + /** + * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @return the disallowPublicIpAddress value. + */ + public Boolean disallowPublicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().disallowPublicIpAddress(); + } + + /** + * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withDisallowPublicIpAddress(disallowPublicIpAddress); + return this; + } + + /** + * Get the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); + } + + /** + * Set the artifacts property: The artifacts to be installed on the virtual machine. + * + * @param artifacts the artifacts value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withArtifacts(List artifacts) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withArtifacts(artifacts); + return this; + } + + /** + * Get the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + public String planId() { + return this.innerProperties() == null ? null : this.innerProperties().planId(); + } + + /** + * Set the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId the planId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withPlanId(String planId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withPlanId(planId); + return this; + } + + /** + * Get the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + public Integer osDiskSizeGb() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskSizeGb(); + } + + /** + * Set the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @param osDiskSizeGb the osDiskSizeGb value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withOsDiskSizeGb(Integer osDiskSizeGb) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withOsDiskSizeGb(osDiskSizeGb); + return this; + } + + /** + * Get the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); + } + + /** + * Set the expirationDate property: The expiration date for VM. + * + * @param expirationDate the expirationDate value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withExpirationDate(OffsetDateTime expirationDate) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withExpirationDate(expirationDate); + return this; + } + + /** + * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + public Boolean allowClaim() { + return this.innerProperties() == null ? null : this.innerProperties().allowClaim(); + } + + /** + * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @param allowClaim the allowClaim value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withAllowClaim(Boolean allowClaim) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withAllowClaim(allowClaim); + return this; + } + + /** + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.innerProperties() == null ? null : this.innerProperties().storageType(); + } + + /** + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @param storageType the storageType value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withStorageType(StorageType storageType) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withStorageType(storageType); + return this; + } + + /** + * Get the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineCreationSource(); + } + + /** + * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); + } + + /** + * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @param environmentId the environmentId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withEnvironmentId(String environmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withEnvironmentId(environmentId); + return this; + } + + /** + * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + public List dataDiskParameters() { + return this.innerProperties() == null ? null : this.innerProperties().dataDiskParameters(); + } + + /** + * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @param dataDiskParameters the dataDiskParameters value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withDataDiskParameters(List dataDiskParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withDataDiskParameters(dataDiskParameters); + return this; + } + + /** + * Get the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + public List scheduleParameters() { + return this.innerProperties() == null ? null : this.innerProperties().scheduleParameters(); + } + + /** + * Set the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters the scheduleParameters value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withScheduleParameters(List scheduleParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withScheduleParameters(scheduleParameters); + return this; + } + + /** + * Get the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + public String lastKnownPowerState() { + return this.innerProperties() == null ? null : this.innerProperties().lastKnownPowerState(); + } + + /** + * Get the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of fetching + * the document. + * + * @return the canApplyArtifacts value. + */ + public Boolean canApplyArtifacts() { + return this.innerProperties() == null ? null : this.innerProperties().canApplyArtifacts(); + } + + /** + * Get the provisioningStateFormulaContentProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateFormulaContentProvisioningState value. + */ + public String provisioningStateFormulaContentProvisioningState() { + return this.innerProperties() == null + ? null + : this.innerProperties().provisioningStateFormulaContentProvisioningState(); + } + + /** + * Get the uniqueIdentifierFormulaContentUniqueIdentifier property: The unique immutable identifier of a resource + * (Guid). + * + * @return the uniqueIdentifierFormulaContentUniqueIdentifier value. + */ + public String uniqueIdentifierFormulaContentUniqueIdentifier() { + return this.innerProperties() == null + ? null + : this.innerProperties().uniqueIdentifierFormulaContentUniqueIdentifier(); + } + + /** + * Get the instanceCount property: The number of virtual machine instances to create. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.innerProperties() == null ? null : this.innerProperties().instanceCount(); + } + + /** + * Set the instanceCount property: The number of virtual machine instances to create. + * + * @param instanceCount the instanceCount value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withInstanceCount(Integer instanceCount) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withInstanceCount(instanceCount); + return this; + } + + /** + * Get the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + public String deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + public Integer artifactsApplied() { + return this.innerProperties() == null ? null : this.innerProperties().artifactsApplied(); + } + + /** + * Get the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + public Integer totalArtifacts() { + return this.innerProperties() == null ? null : this.innerProperties().totalArtifacts(); + } + + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerProperties() == null ? null : this.innerProperties().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withOffer(String offer) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withOffer(offer); + return this; + } + + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withSku(String sku) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + public String osTypeGalleryImageReferenceOsType() { + return this.innerProperties() == null ? null : this.innerProperties().osTypeGalleryImageReferenceOsType(); + } + + /** + * Set the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @param osTypeGalleryImageReferenceOsType the osTypeGalleryImageReferenceOsType value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withOsTypeGalleryImageReferenceOsType(String osTypeGalleryImageReferenceOsType) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withOsTypeGalleryImageReferenceOsType(osTypeGalleryImageReferenceOsType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerProperties() == null ? null : this.innerProperties().statuses(); + } + + /** + * Get the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + public String osTypeComputeVmOsType() { + return this.innerProperties() == null ? null : this.innerProperties().osTypeComputeVmOsType(); + } + + /** + * Get the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerProperties() == null ? null : this.innerProperties().vmSize(); + } + + /** + * Get the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.innerProperties() == null ? null : this.innerProperties().networkInterfaceId(); + } + + /** + * Get the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + public String osDiskId() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskId(); + } + + /** + * Get the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + public List dataDiskIds() { + return this.innerProperties() == null ? null : this.innerProperties().dataDiskIds(); + } + + /** + * Get the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.innerProperties() == null ? null : this.innerProperties().dataDisks(); + } + + /** + * Get the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkId(); + } + + /** + * Set the virtualNetworkId property: The resource ID of the virtual network. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withVirtualNetworkId(String virtualNetworkId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withVirtualNetworkId(virtualNetworkId); + return this; + } + + /** + * Get the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); + } + + /** + * Set the subnetId property: The resource ID of the sub net. + * + * @param subnetId the subnetId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withSubnetId(String subnetId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withSubnetId(subnetId); + return this; + } + + /** + * Get the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressId(); + } + + /** + * Set the publicIpAddressId property: The resource ID of the public IP address. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withPublicIpAddressId(String publicIpAddressId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withPublicIpAddressId(publicIpAddressId); + return this; + } + + /** + * Get the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); + } + + /** + * Set the publicIpAddress property: The public IP address. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withPublicIpAddress(String publicIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: The private IP address. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withPrivateIpAddress(String privateIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.innerProperties() == null ? null : this.innerProperties().dnsName(); + } + + /** + * Set the dnsName property: The DNS name. + * + * @param dnsName the dnsName value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withDnsName(String dnsName) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withDnsName(dnsName); + return this; + } + + /** + * Get the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + public String rdpAuthority() { + return this.innerProperties() == null ? null : this.innerProperties().rdpAuthority(); + } + + /** + * Set the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @param rdpAuthority the rdpAuthority value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withRdpAuthority(String rdpAuthority) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withRdpAuthority(rdpAuthority); + return this; + } + + /** + * Get the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + public String sshAuthority() { + return this.innerProperties() == null ? null : this.innerProperties().sshAuthority(); + } + + /** + * Set the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @param sshAuthority the sshAuthority value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withSshAuthority(String sshAuthority) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withSshAuthority(sshAuthority); + return this; + } + + /** + * Get the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().inboundNatRules(); + } + + /** + * Set the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withInboundNatRules(List inboundNatRules) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withInboundNatRules(inboundNatRules); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerProperties() == null ? null : this.innerProperties().systemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerProperties() == null ? null : this.innerProperties().taskType(); + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); + } + + /** + * Get the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerProperties() == null + ? null + : this.innerProperties().createdDateApplicableScheduleCreatedDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); + } + + /** + * Get the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerProperties() == null + ? null + : this.innerProperties().provisioningStateApplicableScheduleProvisioningState(); + } + + /** + * Get the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerProperties() == null + ? null + : this.innerProperties().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerProperties() == null ? null : this.innerProperties().weekdays(); + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerProperties() == null ? null : this.innerProperties().time(); + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerProperties() == null ? null : this.innerProperties().minute(); + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().statusNotificationSettingsStatus(); + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().timeInMinutes(); + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the labVmId property: The identifier of the VM from which a formula is to be created. + * + * @return the labVmId value. + */ + public String labVmId() { + return this.innerProperties() == null ? null : this.innerProperties().labVmId(); + } + + /** + * Set the labVmId property: The identifier of the VM from which a formula is to be created. + * + * @param labVmId the labVmId value to set. + * @return the FormulaInner object itself. + */ + public FormulaInner withLabVmId(String labVmId) { + if (this.innerProperties() == null) { + this.innerProperties = new FormulaPropertiesInner(); + } + this.innerProperties().withLabVmId(labVmId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model FormulaInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaPropertiesFromVm.java similarity index 96% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaPropertiesFromVm.java index fbfbd886fffa..e253d2104de0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaPropertiesFromVm.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaPropertiesFromVm.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaPropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaPropertiesInner.java new file mode 100644 index 000000000000..b4199d832fe9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/FormulaPropertiesInner.java @@ -0,0 +1,1606 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of a formula. */ +@Fluent +public final class FormulaPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FormulaPropertiesInner.class); + + /* + * The description of the formula. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The author of the formula. + */ + @JsonProperty(value = "author", access = JsonProperty.Access.WRITE_ONLY) + private String author; + + /* + * The OS type of the formula. + */ + @JsonProperty(value = "osType") + private String osType; + + /* + * The creation date of the formula. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The content of the formula. + */ + @JsonProperty(value = "formulaContent") + private LabVirtualMachineCreationParameterInner innerFormulaContent; + + /* + * Information about a VM from which a formula is to be created. + */ + @JsonProperty(value = "vm") + private FormulaPropertiesFromVm innerVm; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the description property: The description of the formula. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the formula. + * + * @param description the description value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the author property: The author of the formula. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Get the osType property: The OS type of the formula. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type of the formula. + * + * @param osType the osType value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the creationDate property: The creation date of the formula. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the innerFormulaContent property: The content of the formula. + * + * @return the innerFormulaContent value. + */ + private LabVirtualMachineCreationParameterInner innerFormulaContent() { + return this.innerFormulaContent; + } + + /** + * Get the innerVm property: Information about a VM from which a formula is to be created. + * + * @return the innerVm value. + */ + private FormulaPropertiesFromVm innerVm() { + return this.innerVm; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the name property: The name of the virtual machine or environment. + * + * @return the name value. + */ + public String name() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().name(); + } + + /** + * Set the name property: The name of the virtual machine or environment. + * + * @param name the name value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withName(String name) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withName(name); + return this; + } + + /** + * Get the location property: The location of the new virtual machine or environment. + * + * @return the location value. + */ + public String location() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().location(); + } + + /** + * Set the location property: The location of the new virtual machine or environment. + * + * @param location the location value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withLocation(String location) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withLocation(location); + return this; + } + + /** + * Get the tags property: The tags of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().tags(); + } + + /** + * Set the tags property: The tags of the resource. + * + * @param tags the tags value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withTags(Map tags) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withTags(tags); + return this; + } + + /** + * Get the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + public String notes() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().notes(); + } + + /** + * Set the notes property: The notes of the virtual machine. + * + * @param notes the notes value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withNotes(String notes) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withNotes(notes); + return this; + } + + /** + * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + public String ownerObjectId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().ownerObjectId(); + } + + /** + * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @param ownerObjectId the ownerObjectId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withOwnerObjectId(String ownerObjectId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withOwnerObjectId(ownerObjectId); + return this; + } + + /** + * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + public String ownerUserPrincipalName() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().ownerUserPrincipalName(); + } + + /** + * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withOwnerUserPrincipalName(ownerUserPrincipalName); + return this; + } + + /** + * Get the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + public String createdByUserId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().createdByUserId(); + } + + /** + * Get the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().createdByUser(); + } + + /** + * Get the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().createdDate(); + } + + /** + * Set the createdDate property: The creation date of the virtual machine. + * + * @param createdDate the createdDate value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withCreatedDate(OffsetDateTime createdDate) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withCreatedDate(createdDate); + return this; + } + + /** + * Get the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + public String computeId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().computeId(); + } + + /** + * Get the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + public String customImageId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().customImageId(); + } + + /** + * Set the customImageId property: The custom image identifier of the virtual machine. + * + * @param customImageId the customImageId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withCustomImageId(String customImageId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withCustomImageId(customImageId); + return this; + } + + /** + * Get the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + public String galleryImageVersionId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().galleryImageVersionId(); + } + + /** + * Set the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @param galleryImageVersionId the galleryImageVersionId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withGalleryImageVersionId(String galleryImageVersionId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withGalleryImageVersionId(galleryImageVersionId); + return this; + } + + /** + * Get the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + public String sharedImageId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().sharedImageId(); + } + + /** + * Set the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @param sharedImageId the sharedImageId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withSharedImageId(String sharedImageId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withSharedImageId(sharedImageId); + return this; + } + + /** + * Get the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + public String sharedImageVersion() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().sharedImageVersion(); + } + + /** + * Set the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @param sharedImageVersion the sharedImageVersion value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withSharedImageVersion(String sharedImageVersion) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withSharedImageVersion(sharedImageVersion); + return this; + } + + /** + * Get the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + public String osTypeFormulaContentOsType() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().osType(); + } + + /** + * Get the size property: The size of the virtual machine. + * + * @return the size value. + */ + public String size() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().size(); + } + + /** + * Set the size property: The size of the virtual machine. + * + * @param size the size value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withSize(String size) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withSize(size); + return this; + } + + /** + * Get the username property: The user name of the virtual machine. + * + * @return the username value. + */ + public String username() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().username(); + } + + /** + * Set the username property: The user name of the virtual machine. + * + * @param username the username value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withUsername(String username) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withUsername(username); + return this; + } + + /** + * Get the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + public String password() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().password(); + } + + /** + * Set the password property: The password of the virtual machine administrator. + * + * @param password the password value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withPassword(String password) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withPassword(password); + return this; + } + + /** + * Get the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + public String sshKey() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().sshKey(); + } + + /** + * Set the sshKey property: The SSH key of the virtual machine administrator. + * + * @param sshKey the sshKey value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withSshKey(String sshKey) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withSshKey(sshKey); + return this; + } + + /** + * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + public Boolean isAuthenticationWithSshKey() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().isAuthenticationWithSshKey(); + } + + /** + * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withIsAuthenticationWithSshKey(isAuthenticationWithSshKey); + return this; + } + + /** + * Get the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().fqdn(); + } + + /** + * Get the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + public String labSubnetName() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().labSubnetName(); + } + + /** + * Set the labSubnetName property: The lab subnet name of the virtual machine. + * + * @param labSubnetName the labSubnetName value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withLabSubnetName(String labSubnetName) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withLabSubnetName(labSubnetName); + return this; + } + + /** + * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + public String labVirtualNetworkId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().labVirtualNetworkId(); + } + + /** + * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @param labVirtualNetworkId the labVirtualNetworkId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withLabVirtualNetworkId(String labVirtualNetworkId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withLabVirtualNetworkId(labVirtualNetworkId); + return this; + } + + /** + * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @return the disallowPublicIpAddress value. + */ + public Boolean disallowPublicIpAddress() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().disallowPublicIpAddress(); + } + + /** + * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withDisallowPublicIpAddress(disallowPublicIpAddress); + return this; + } + + /** + * Get the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().artifacts(); + } + + /** + * Set the artifacts property: The artifacts to be installed on the virtual machine. + * + * @param artifacts the artifacts value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withArtifacts(List artifacts) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withArtifacts(artifacts); + return this; + } + + /** + * Get the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + public String planId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().planId(); + } + + /** + * Set the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId the planId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withPlanId(String planId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withPlanId(planId); + return this; + } + + /** + * Get the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + public Integer osDiskSizeGb() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().osDiskSizeGb(); + } + + /** + * Set the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @param osDiskSizeGb the osDiskSizeGb value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withOsDiskSizeGb(Integer osDiskSizeGb) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withOsDiskSizeGb(osDiskSizeGb); + return this; + } + + /** + * Get the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().expirationDate(); + } + + /** + * Set the expirationDate property: The expiration date for VM. + * + * @param expirationDate the expirationDate value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withExpirationDate(OffsetDateTime expirationDate) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withExpirationDate(expirationDate); + return this; + } + + /** + * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + public Boolean allowClaim() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().allowClaim(); + } + + /** + * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @param allowClaim the allowClaim value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withAllowClaim(Boolean allowClaim) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withAllowClaim(allowClaim); + return this; + } + + /** + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().storageType(); + } + + /** + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @param storageType the storageType value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withStorageType(StorageType storageType) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withStorageType(storageType); + return this; + } + + /** + * Get the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().virtualMachineCreationSource(); + } + + /** + * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().environmentId(); + } + + /** + * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @param environmentId the environmentId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withEnvironmentId(String environmentId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withEnvironmentId(environmentId); + return this; + } + + /** + * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + public List dataDiskParameters() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().dataDiskParameters(); + } + + /** + * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @param dataDiskParameters the dataDiskParameters value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withDataDiskParameters(List dataDiskParameters) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withDataDiskParameters(dataDiskParameters); + return this; + } + + /** + * Get the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + public List scheduleParameters() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().scheduleParameters(); + } + + /** + * Set the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters the scheduleParameters value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withScheduleParameters(List scheduleParameters) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withScheduleParameters(scheduleParameters); + return this; + } + + /** + * Get the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + public String lastKnownPowerState() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().lastKnownPowerState(); + } + + /** + * Get the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of fetching + * the document. + * + * @return the canApplyArtifacts value. + */ + public Boolean canApplyArtifacts() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().canApplyArtifacts(); + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningStateFormulaContentProvisioningState() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifierFormulaContentUniqueIdentifier() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().uniqueIdentifier(); + } + + /** + * Get the instanceCount property: The number of virtual machine instances to create. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().instanceCount(); + } + + /** + * Set the instanceCount property: The number of virtual machine instances to create. + * + * @param instanceCount the instanceCount value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withInstanceCount(Integer instanceCount) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withInstanceCount(instanceCount); + return this; + } + + /** + * Get the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + public String deploymentStatus() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().deploymentStatus(); + } + + /** + * Get the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + public Integer artifactsApplied() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().artifactsApplied(); + } + + /** + * Get the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + public Integer totalArtifacts() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().totalArtifacts(); + } + + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withOffer(String offer) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withOffer(offer); + return this; + } + + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withPublisher(String publisher) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withSku(String sku) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withSku(sku); + return this; + } + + /** + * Get the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + public String osTypeGalleryImageReferenceOsType() { + return this.innerFormulaContent() == null + ? null + : this.innerFormulaContent().osTypeGalleryImageReferenceOsType(); + } + + /** + * Set the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @param osTypeGalleryImageReferenceOsType the osTypeGalleryImageReferenceOsType value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withOsTypeGalleryImageReferenceOsType(String osTypeGalleryImageReferenceOsType) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withOsTypeGalleryImageReferenceOsType(osTypeGalleryImageReferenceOsType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withVersion(String version) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withVersion(version); + return this; + } + + /** + * Get the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().statuses(); + } + + /** + * Get the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + public String osTypeComputeVmOsType() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().osTypeComputeVmOsType(); + } + + /** + * Get the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().vmSize(); + } + + /** + * Get the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().networkInterfaceId(); + } + + /** + * Get the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + public String osDiskId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().osDiskId(); + } + + /** + * Get the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + public List dataDiskIds() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().dataDiskIds(); + } + + /** + * Get the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().dataDisks(); + } + + /** + * Get the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().virtualNetworkId(); + } + + /** + * Set the virtualNetworkId property: The resource ID of the virtual network. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withVirtualNetworkId(String virtualNetworkId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withVirtualNetworkId(virtualNetworkId); + return this; + } + + /** + * Get the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().subnetId(); + } + + /** + * Set the subnetId property: The resource ID of the sub net. + * + * @param subnetId the subnetId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withSubnetId(String subnetId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withSubnetId(subnetId); + return this; + } + + /** + * Get the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().publicIpAddressId(); + } + + /** + * Set the publicIpAddressId property: The resource ID of the public IP address. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withPublicIpAddressId(String publicIpAddressId) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withPublicIpAddressId(publicIpAddressId); + return this; + } + + /** + * Get the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().publicIpAddress(); + } + + /** + * Set the publicIpAddress property: The public IP address. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withPublicIpAddress(String publicIpAddress) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: The private IP address. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withPrivateIpAddress(String privateIpAddress) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().dnsName(); + } + + /** + * Set the dnsName property: The DNS name. + * + * @param dnsName the dnsName value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withDnsName(String dnsName) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withDnsName(dnsName); + return this; + } + + /** + * Get the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + public String rdpAuthority() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().rdpAuthority(); + } + + /** + * Set the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @param rdpAuthority the rdpAuthority value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withRdpAuthority(String rdpAuthority) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withRdpAuthority(rdpAuthority); + return this; + } + + /** + * Get the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + public String sshAuthority() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().sshAuthority(); + } + + /** + * Set the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @param sshAuthority the sshAuthority value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withSshAuthority(String sshAuthority) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withSshAuthority(sshAuthority); + return this; + } + + /** + * Get the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().inboundNatRules(); + } + + /** + * Set the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withInboundNatRules(List inboundNatRules) { + if (this.innerFormulaContent() == null) { + this.innerFormulaContent = new LabVirtualMachineCreationParameterInner(); + } + this.innerFormulaContent().withInboundNatRules(inboundNatRules); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().systemData(); + } + + /** + * Get the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().systemDataPropertiesSystemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().status(); + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().taskType(); + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().timeZoneId(); + } + + /** + * Get the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerFormulaContent() == null + ? null + : this.innerFormulaContent().createdDateApplicableScheduleCreatedDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().targetResourceId(); + } + + /** + * Get the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerFormulaContent() == null + ? null + : this.innerFormulaContent().provisioningStateApplicableScheduleProvisioningState(); + } + + /** + * Get the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerFormulaContent() == null + ? null + : this.innerFormulaContent().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().weekdays(); + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().time(); + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().minute(); + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerFormulaContent() == null + ? null + : this.innerFormulaContent().statusNotificationSettingsStatus(); + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().timeInMinutes(); + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().webhookUrl(); + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().emailRecipient(); + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().notificationLocale(); + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().id(); + } + + /** + * Get the namePropertiesName property: the name of the resource. + * + * @return the namePropertiesName value. + */ + public String namePropertiesName() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().namePropertiesName(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().type(); + } + + /** + * Get the locationPropertiesLocation property: the geo-location where the resource live. + * + * @return the locationPropertiesLocation value. + */ + public String locationPropertiesLocation() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().locationPropertiesLocation(); + } + + /** + * Get the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.innerFormulaContent() == null ? null : this.innerFormulaContent().tagsPropertiesTags(); + } + + /** + * Get the labVmId property: The identifier of the VM from which a formula is to be created. + * + * @return the labVmId value. + */ + public String labVmId() { + return this.innerVm() == null ? null : this.innerVm().labVmId(); + } + + /** + * Set the labVmId property: The identifier of the VM from which a formula is to be created. + * + * @param labVmId the labVmId value to set. + * @return the FormulaPropertiesInner object itself. + */ + public FormulaPropertiesInner withLabVmId(String labVmId) { + if (this.innerVm() == null) { + this.innerVm = new FormulaPropertiesFromVm(); + } + this.innerVm().withLabVmId(labVmId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerFormulaContent() != null) { + innerFormulaContent().validate(); + } + if (innerVm() != null) { + innerVm().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java index 3c8655bfdb48..13b8b05fb2c1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageInner.java @@ -5,68 +5,47 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -import java.util.Map; /** A gallery image. */ -@JsonFlatten @Fluent -public class GalleryImageInner extends Resource { +public final class GalleryImageInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageInner.class); /* - * The author of the gallery image. + * The properties of the resource. */ - @JsonProperty(value = "properties.author") - private String author; + @JsonProperty(value = "properties", required = true) + private GalleryImageProperties innerProperties = new GalleryImageProperties(); /* - * The creation date of the gallery image. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The description of the gallery image. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The image reference of the gallery image. - */ - @JsonProperty(value = "properties.imageReference") - private GalleryImageReference imageReference; - - /* - * The icon of the gallery image. - */ - @JsonProperty(value = "properties.icon") - private String icon; - - /* - * Indicates whether this gallery image is enabled. - */ - @JsonProperty(value = "properties.enabled") - private Boolean enabled; - - /* - * The third party plan that applies to this image + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.planId") - private String planId; + private GalleryImageProperties innerProperties() { + return this.innerProperties; + } - /* - * Indicates if the plan has been authorized for programmatic deployment. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.isPlanAuthorized") - private Boolean isPlanAuthorized; + public SystemData systemData() { + return this.systemData; + } /** * Get the author property: The author of the gallery image. @@ -74,7 +53,7 @@ public class GalleryImageInner extends Resource { * @return the author value. */ public String author() { - return this.author; + return this.innerProperties() == null ? null : this.innerProperties().author(); } /** @@ -84,7 +63,10 @@ public String author() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withAuthor(String author) { - this.author = author; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withAuthor(author); return this; } @@ -94,7 +76,7 @@ public GalleryImageInner withAuthor(String author) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -103,7 +85,7 @@ public OffsetDateTime createdDate() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -113,27 +95,10 @@ public String description() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the imageReference property: The image reference of the gallery image. - * - * @return the imageReference value. - */ - public GalleryImageReference imageReference() { - return this.imageReference; - } - - /** - * Set the imageReference property: The image reference of the gallery image. - * - * @param imageReference the imageReference value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withImageReference(GalleryImageReference imageReference) { - this.imageReference = imageReference; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -143,7 +108,7 @@ public GalleryImageInner withImageReference(GalleryImageReference imageReference * @return the icon value. */ public String icon() { - return this.icon; + return this.innerProperties() == null ? null : this.innerProperties().icon(); } /** @@ -153,7 +118,10 @@ public String icon() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withIcon(String icon) { - this.icon = icon; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withIcon(icon); return this; } @@ -163,7 +131,7 @@ public GalleryImageInner withIcon(String icon) { * @return the enabled value. */ public Boolean enabled() { - return this.enabled; + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** @@ -173,7 +141,10 @@ public Boolean enabled() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withEnabled(Boolean enabled) { - this.enabled = enabled; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withEnabled(enabled); return this; } @@ -183,7 +154,7 @@ public GalleryImageInner withEnabled(Boolean enabled) { * @return the planId value. */ public String planId() { - return this.planId; + return this.innerProperties() == null ? null : this.innerProperties().planId(); } /** @@ -193,7 +164,10 @@ public String planId() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withPlanId(String planId) { - this.planId = planId; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withPlanId(planId); return this; } @@ -203,7 +177,7 @@ public GalleryImageInner withPlanId(String planId) { * @return the isPlanAuthorized value. */ public Boolean isPlanAuthorized() { - return this.isPlanAuthorized; + return this.innerProperties() == null ? null : this.innerProperties().isPlanAuthorized(); } /** @@ -213,21 +187,125 @@ public Boolean isPlanAuthorized() { * @return the GalleryImageInner object itself. */ public GalleryImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) { - this.isPlanAuthorized = isPlanAuthorized; + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withIsPlanAuthorized(isPlanAuthorized); return this; } - /** {@inheritDoc} */ - @Override - public GalleryImageInner withLocation(String location) { - super.withLocation(location); + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerProperties() == null ? null : this.innerProperties().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withOffer(String offer) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withOffer(offer); return this; } - /** {@inheritDoc} */ - @Override - public GalleryImageInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withSku(String sku) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the osType property: The OS type of the gallery image. + * + * @return the osType value. + */ + public String osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The OS type of the gallery image. + * + * @param osType the osType value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withOsType(String osType) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the GalleryImageInner object itself. + */ + public GalleryImageInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryImageProperties(); + } + this.innerProperties().withVersion(version); return this; } @@ -237,8 +315,13 @@ public GalleryImageInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (imageReference() != null) { - imageReference().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model GalleryImageInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java new file mode 100644 index 000000000000..9eeb6c044bc1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageProperties.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a gallery image. */ +@Fluent +public final class GalleryImageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageProperties.class); + + /* + * The author of the gallery image. + */ + @JsonProperty(value = "author") + private String author; + + /* + * The creation date of the gallery image. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The description of the gallery image. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The image reference of the gallery image. + */ + @JsonProperty(value = "imageReference") + private GalleryImageReference innerImageReference; + + /* + * The icon of the gallery image. + */ + @JsonProperty(value = "icon") + private String icon; + + /* + * Indicates whether this gallery image is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The third party plan that applies to this image + */ + @JsonProperty(value = "planId") + private String planId; + + /* + * Indicates if the plan has been authorized for programmatic deployment. + */ + @JsonProperty(value = "isPlanAuthorized") + private Boolean isPlanAuthorized; + + /** + * Get the author property: The author of the gallery image. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Set the author property: The author of the gallery image. + * + * @param author the author value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withAuthor(String author) { + this.author = author; + return this; + } + + /** + * Get the createdDate property: The creation date of the gallery image. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the description property: The description of the gallery image. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the gallery image. + * + * @param description the description value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the innerImageReference property: The image reference of the gallery image. + * + * @return the innerImageReference value. + */ + private GalleryImageReference innerImageReference() { + return this.innerImageReference; + } + + /** + * Get the icon property: The icon of the gallery image. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Set the icon property: The icon of the gallery image. + * + * @param icon the icon value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withIcon(String icon) { + this.icon = icon; + return this; + } + + /** + * Get the enabled property: Indicates whether this gallery image is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether this gallery image is enabled. + * + * @param enabled the enabled value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the planId property: The third party plan that applies to this image. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: The third party plan that applies to this image. + * + * @param planId the planId value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic deployment. + * + * @return the isPlanAuthorized value. + */ + public Boolean isPlanAuthorized() { + return this.isPlanAuthorized; + } + + /** + * Set the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic deployment. + * + * @param isPlanAuthorized the isPlanAuthorized value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withIsPlanAuthorized(Boolean isPlanAuthorized) { + this.isPlanAuthorized = isPlanAuthorized; + return this; + } + + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerImageReference() == null ? null : this.innerImageReference().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withOffer(String offer) { + if (this.innerImageReference() == null) { + this.innerImageReference = new GalleryImageReference(); + } + this.innerImageReference().withOffer(offer); + return this; + } + + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerImageReference() == null ? null : this.innerImageReference().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withPublisher(String publisher) { + if (this.innerImageReference() == null) { + this.innerImageReference = new GalleryImageReference(); + } + this.innerImageReference().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerImageReference() == null ? null : this.innerImageReference().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withSku(String sku) { + if (this.innerImageReference() == null) { + this.innerImageReference = new GalleryImageReference(); + } + this.innerImageReference().withSku(sku); + return this; + } + + /** + * Get the osType property: The OS type of the gallery image. + * + * @return the osType value. + */ + public String osType() { + return this.innerImageReference() == null ? null : this.innerImageReference().osType(); + } + + /** + * Set the osType property: The OS type of the gallery image. + * + * @param osType the osType value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withOsType(String osType) { + if (this.innerImageReference() == null) { + this.innerImageReference = new GalleryImageReference(); + } + this.innerImageReference().withOsType(osType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerImageReference() == null ? null : this.innerImageReference().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the GalleryImageProperties object itself. + */ + public GalleryImageProperties withVersion(String version) { + if (this.innerImageReference() == null) { + this.innerImageReference = new GalleryImageReference(); + } + this.innerImageReference().withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerImageReference() != null) { + innerImageReference().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageReference.java similarity index 98% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageReference.java index 943ffff5513d..d9728669acfa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageReference.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/GalleryImageReference.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/HourDetails.java similarity index 95% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/HourDetails.java index 3a9be05ac25d..80d63f14f574 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HourDetails.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/HourDetails.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/IdentityProperties.java similarity index 68% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/IdentityProperties.java index cb32d4fa467e..8917422a30c2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/IdentityProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/IdentityProperties.java @@ -2,12 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Properties of a managed identity. */ @Fluent @@ -15,7 +18,7 @@ public final class IdentityProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProperties.class); /* - * Managed identity. + * Type of identity (SystemAssigned, UserAssigned, None) */ @JsonProperty(value = "type") private ManagedIdentityType type; @@ -38,8 +41,15 @@ public final class IdentityProperties { @JsonProperty(value = "clientSecretUrl") private String clientSecretUrl; + /* + * If Type is 'UserAssigned': List of user assigned identities. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + /** - * Get the type property: Managed identity. + * Get the type property: Type of identity (SystemAssigned, UserAssigned, None). * * @return the type value. */ @@ -48,7 +58,7 @@ public ManagedIdentityType type() { } /** - * Set the type property: Managed identity. + * Set the type property: Type of identity (SystemAssigned, UserAssigned, None). * * @param type the type value to set. * @return the IdentityProperties object itself. @@ -118,6 +128,26 @@ public IdentityProperties withClientSecretUrl(String clientSecretUrl) { return this; } + /** + * Get the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + /** * Validates the instance. * diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabAnnouncementProperties.java similarity index 97% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabAnnouncementProperties.java index 38dc91b4a67f..ca9ffebf43ae 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabAnnouncementProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabAnnouncementProperties.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java index 21455ba7d8d2..b6fdc6d2a27c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostInner.java @@ -5,112 +5,52 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; import com.azure.resourcemanager.devtestlabs.models.LabCostDetailsProperties; -import com.azure.resourcemanager.devtestlabs.models.LabCostSummaryProperties; import com.azure.resourcemanager.devtestlabs.models.LabResourceCostProperties; -import com.azure.resourcemanager.devtestlabs.models.TargetCostProperties; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; -import java.util.Map; /** A cost item. */ -@JsonFlatten @Fluent -public class LabCostInner extends Resource { +public final class LabCostInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabCostInner.class); /* - * The target cost properties + * The properties of the resource. */ - @JsonProperty(value = "properties.targetCost") - private TargetCostProperties targetCost; + @JsonProperty(value = "properties", required = true) + private LabCostProperties innerProperties = new LabCostProperties(); /* - * The lab cost summary component of the cost data. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.labCostSummary", access = JsonProperty.Access.WRITE_ONLY) - private LabCostSummaryProperties labCostSummary; - - /* - * The lab cost details component of the cost data. - */ - @JsonProperty(value = "properties.labCostDetails", access = JsonProperty.Access.WRITE_ONLY) - private List labCostDetails; - - /* - * The resource cost component of the cost data. - */ - @JsonProperty(value = "properties.resourceCosts", access = JsonProperty.Access.WRITE_ONLY) - private List resourceCosts; - - /* - * The currency code of the cost. - */ - @JsonProperty(value = "properties.currencyCode") - private String currencyCode; - - /* - * The start time of the cost data. - */ - @JsonProperty(value = "properties.startDateTime") - private OffsetDateTime startDateTime; - - /* - * The end time of the cost data. - */ - @JsonProperty(value = "properties.endDateTime") - private OffsetDateTime endDateTime; - - /* - * The creation date of the cost. - */ - @JsonProperty(value = "properties.createdDate") - private OffsetDateTime createdDate; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; - - /** - * Get the targetCost property: The target cost properties. - * - * @return the targetCost value. - */ - public TargetCostProperties targetCost() { - return this.targetCost; - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Set the targetCost property: The target cost properties. + * Get the innerProperties property: The properties of the resource. * - * @param targetCost the targetCost value to set. - * @return the LabCostInner object itself. + * @return the innerProperties value. */ - public LabCostInner withTargetCost(TargetCostProperties targetCost) { - this.targetCost = targetCost; - return this; + private LabCostProperties innerProperties() { + return this.innerProperties; } /** - * Get the labCostSummary property: The lab cost summary component of the cost data. + * Get the systemData property: The system metadata relating to this resource. * - * @return the labCostSummary value. + * @return the systemData value. */ - public LabCostSummaryProperties labCostSummary() { - return this.labCostSummary; + public SystemData systemData() { + return this.systemData; } /** @@ -119,7 +59,7 @@ public LabCostSummaryProperties labCostSummary() { * @return the labCostDetails value. */ public List labCostDetails() { - return this.labCostDetails; + return this.innerProperties() == null ? null : this.innerProperties().labCostDetails(); } /** @@ -128,7 +68,7 @@ public List labCostDetails() { * @return the resourceCosts value. */ public List resourceCosts() { - return this.resourceCosts; + return this.innerProperties() == null ? null : this.innerProperties().resourceCosts(); } /** @@ -137,7 +77,7 @@ public List resourceCosts() { * @return the currencyCode value. */ public String currencyCode() { - return this.currencyCode; + return this.innerProperties() == null ? null : this.innerProperties().currencyCode(); } /** @@ -147,7 +87,10 @@ public String currencyCode() { * @return the LabCostInner object itself. */ public LabCostInner withCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withCurrencyCode(currencyCode); return this; } @@ -157,7 +100,7 @@ public LabCostInner withCurrencyCode(String currencyCode) { * @return the startDateTime value. */ public OffsetDateTime startDateTime() { - return this.startDateTime; + return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); } /** @@ -167,7 +110,10 @@ public OffsetDateTime startDateTime() { * @return the LabCostInner object itself. */ public LabCostInner withStartDateTime(OffsetDateTime startDateTime) { - this.startDateTime = startDateTime; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withStartDateTime(startDateTime); return this; } @@ -177,7 +123,7 @@ public LabCostInner withStartDateTime(OffsetDateTime startDateTime) { * @return the endDateTime value. */ public OffsetDateTime endDateTime() { - return this.endDateTime; + return this.innerProperties() == null ? null : this.innerProperties().endDateTime(); } /** @@ -187,7 +133,10 @@ public OffsetDateTime endDateTime() { * @return the LabCostInner object itself. */ public LabCostInner withEndDateTime(OffsetDateTime endDateTime) { - this.endDateTime = endDateTime; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withEndDateTime(endDateTime); return this; } @@ -197,7 +146,7 @@ public LabCostInner withEndDateTime(OffsetDateTime endDateTime) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -207,7 +156,10 @@ public OffsetDateTime createdDate() { * @return the LabCostInner object itself. */ public LabCostInner withCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withCreatedDate(createdDate); return this; } @@ -217,7 +169,7 @@ public LabCostInner withCreatedDate(OffsetDateTime createdDate) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -226,40 +178,168 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** {@inheritDoc} */ - @Override - public LabCostInner withLocation(String location) { - super.withLocation(location); + /** + * Get the status property: Target cost status. + * + * @return the status value. + */ + public TargetCostStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Target cost status. + * + * @param status the status value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withStatus(TargetCostStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withStatus(status); return this; } - /** {@inheritDoc} */ - @Override - public LabCostInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the target property: Lab target cost. + * + * @return the target value. + */ + public Integer target() { + return this.innerProperties() == null ? null : this.innerProperties().target(); + } + + /** + * Set the target property: Lab target cost. + * + * @param target the target value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withTarget(Integer target) { + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withTarget(target); return this; } /** - * Validates the instance. + * Get the costThresholds property: Cost thresholds. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the costThresholds value. */ - public void validate() { - if (targetCost() != null) { - targetCost().validate(); + public List costThresholds() { + return this.innerProperties() == null ? null : this.innerProperties().costThresholds(); + } + + /** + * Set the costThresholds property: Cost thresholds. + * + * @param costThresholds the costThresholds value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withCostThresholds(List costThresholds) { + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); } - if (labCostSummary() != null) { - labCostSummary().validate(); + this.innerProperties().withCostThresholds(costThresholds); + return this; + } + + /** + * Get the cycleStartDateTime property: Reporting cycle start date. + * + * @return the cycleStartDateTime value. + */ + public OffsetDateTime cycleStartDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().cycleStartDateTime(); + } + + /** + * Set the cycleStartDateTime property: Reporting cycle start date. + * + * @param cycleStartDateTime the cycleStartDateTime value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withCycleStartDateTime(OffsetDateTime cycleStartDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); } - if (labCostDetails() != null) { - labCostDetails().forEach(e -> e.validate()); + this.innerProperties().withCycleStartDateTime(cycleStartDateTime); + return this; + } + + /** + * Get the cycleEndDateTime property: Reporting cycle end date. + * + * @return the cycleEndDateTime value. + */ + public OffsetDateTime cycleEndDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().cycleEndDateTime(); + } + + /** + * Set the cycleEndDateTime property: Reporting cycle end date. + * + * @param cycleEndDateTime the cycleEndDateTime value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withCycleEndDateTime(OffsetDateTime cycleEndDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); + } + this.innerProperties().withCycleEndDateTime(cycleEndDateTime); + return this; + } + + /** + * Get the cycleType property: Reporting cycle type. + * + * @return the cycleType value. + */ + public ReportingCycleType cycleType() { + return this.innerProperties() == null ? null : this.innerProperties().cycleType(); + } + + /** + * Set the cycleType property: Reporting cycle type. + * + * @param cycleType the cycleType value to set. + * @return the LabCostInner object itself. + */ + public LabCostInner withCycleType(ReportingCycleType cycleType) { + if (this.innerProperties() == null) { + this.innerProperties = new LabCostProperties(); } - if (resourceCosts() != null) { - resourceCosts().forEach(e -> e.validate()); + this.innerProperties().withCycleType(cycleType); + return this; + } + + /** + * Get the estimatedLabCost property: The cost component of the cost item. + * + * @return the estimatedLabCost value. + */ + public Double estimatedLabCost() { + return this.innerProperties() == null ? null : this.innerProperties().estimatedLabCost(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model LabCostInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java new file mode 100644 index 000000000000..44942ea65649 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostProperties.java @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.LabCostDetailsProperties; +import com.azure.resourcemanager.devtestlabs.models.LabResourceCostProperties; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a cost item. */ +@Fluent +public final class LabCostProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabCostProperties.class); + + /* + * The target cost properties + */ + @JsonProperty(value = "targetCost") + private TargetCostProperties innerTargetCost; + + /* + * The lab cost summary component of the cost data. + */ + @JsonProperty(value = "labCostSummary", access = JsonProperty.Access.WRITE_ONLY) + private LabCostSummaryProperties innerLabCostSummary; + + /* + * The lab cost details component of the cost data. + */ + @JsonProperty(value = "labCostDetails", access = JsonProperty.Access.WRITE_ONLY) + private List labCostDetails; + + /* + * The resource cost component of the cost data. + */ + @JsonProperty(value = "resourceCosts", access = JsonProperty.Access.WRITE_ONLY) + private List resourceCosts; + + /* + * The currency code of the cost. + */ + @JsonProperty(value = "currencyCode") + private String currencyCode; + + /* + * The start time of the cost data. + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * The end time of the cost data. + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * The creation date of the cost. + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the innerTargetCost property: The target cost properties. + * + * @return the innerTargetCost value. + */ + private TargetCostProperties innerTargetCost() { + return this.innerTargetCost; + } + + /** + * Get the innerLabCostSummary property: The lab cost summary component of the cost data. + * + * @return the innerLabCostSummary value. + */ + private LabCostSummaryProperties innerLabCostSummary() { + return this.innerLabCostSummary; + } + + /** + * Get the labCostDetails property: The lab cost details component of the cost data. + * + * @return the labCostDetails value. + */ + public List labCostDetails() { + return this.labCostDetails; + } + + /** + * Get the resourceCosts property: The resource cost component of the cost data. + * + * @return the resourceCosts value. + */ + public List resourceCosts() { + return this.resourceCosts; + } + + /** + * Get the currencyCode property: The currency code of the cost. + * + * @return the currencyCode value. + */ + public String currencyCode() { + return this.currencyCode; + } + + /** + * Set the currencyCode property: The currency code of the cost. + * + * @param currencyCode the currencyCode value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + return this; + } + + /** + * Get the startDateTime property: The start time of the cost data. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The start time of the cost data. + * + * @param startDateTime the startDateTime value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The end time of the cost data. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The end time of the cost data. + * + * @param endDateTime the endDateTime value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the createdDate property: The creation date of the cost. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The creation date of the cost. + * + * @param createdDate the createdDate value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the status property: Target cost status. + * + * @return the status value. + */ + public TargetCostStatus status() { + return this.innerTargetCost() == null ? null : this.innerTargetCost().status(); + } + + /** + * Set the status property: Target cost status. + * + * @param status the status value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withStatus(TargetCostStatus status) { + if (this.innerTargetCost() == null) { + this.innerTargetCost = new TargetCostProperties(); + } + this.innerTargetCost().withStatus(status); + return this; + } + + /** + * Get the target property: Lab target cost. + * + * @return the target value. + */ + public Integer target() { + return this.innerTargetCost() == null ? null : this.innerTargetCost().target(); + } + + /** + * Set the target property: Lab target cost. + * + * @param target the target value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withTarget(Integer target) { + if (this.innerTargetCost() == null) { + this.innerTargetCost = new TargetCostProperties(); + } + this.innerTargetCost().withTarget(target); + return this; + } + + /** + * Get the costThresholds property: Cost thresholds. + * + * @return the costThresholds value. + */ + public List costThresholds() { + return this.innerTargetCost() == null ? null : this.innerTargetCost().costThresholds(); + } + + /** + * Set the costThresholds property: Cost thresholds. + * + * @param costThresholds the costThresholds value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCostThresholds(List costThresholds) { + if (this.innerTargetCost() == null) { + this.innerTargetCost = new TargetCostProperties(); + } + this.innerTargetCost().withCostThresholds(costThresholds); + return this; + } + + /** + * Get the cycleStartDateTime property: Reporting cycle start date. + * + * @return the cycleStartDateTime value. + */ + public OffsetDateTime cycleStartDateTime() { + return this.innerTargetCost() == null ? null : this.innerTargetCost().cycleStartDateTime(); + } + + /** + * Set the cycleStartDateTime property: Reporting cycle start date. + * + * @param cycleStartDateTime the cycleStartDateTime value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCycleStartDateTime(OffsetDateTime cycleStartDateTime) { + if (this.innerTargetCost() == null) { + this.innerTargetCost = new TargetCostProperties(); + } + this.innerTargetCost().withCycleStartDateTime(cycleStartDateTime); + return this; + } + + /** + * Get the cycleEndDateTime property: Reporting cycle end date. + * + * @return the cycleEndDateTime value. + */ + public OffsetDateTime cycleEndDateTime() { + return this.innerTargetCost() == null ? null : this.innerTargetCost().cycleEndDateTime(); + } + + /** + * Set the cycleEndDateTime property: Reporting cycle end date. + * + * @param cycleEndDateTime the cycleEndDateTime value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCycleEndDateTime(OffsetDateTime cycleEndDateTime) { + if (this.innerTargetCost() == null) { + this.innerTargetCost = new TargetCostProperties(); + } + this.innerTargetCost().withCycleEndDateTime(cycleEndDateTime); + return this; + } + + /** + * Get the cycleType property: Reporting cycle type. + * + * @return the cycleType value. + */ + public ReportingCycleType cycleType() { + return this.innerTargetCost() == null ? null : this.innerTargetCost().cycleType(); + } + + /** + * Set the cycleType property: Reporting cycle type. + * + * @param cycleType the cycleType value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withCycleType(ReportingCycleType cycleType) { + if (this.innerTargetCost() == null) { + this.innerTargetCost = new TargetCostProperties(); + } + this.innerTargetCost().withCycleType(cycleType); + return this; + } + + /** + * Get the estimatedLabCost property: The cost component of the cost item. + * + * @return the estimatedLabCost value. + */ + public Double estimatedLabCost() { + return this.innerLabCostSummary() == null ? null : this.innerLabCostSummary().estimatedLabCost(); + } + + /** + * Set the estimatedLabCost property: The cost component of the cost item. + * + * @param estimatedLabCost the estimatedLabCost value to set. + * @return the LabCostProperties object itself. + */ + public LabCostProperties withEstimatedLabCost(Double estimatedLabCost) { + if (this.innerLabCostSummary() == null) { + this.innerLabCostSummary = new LabCostSummaryProperties(); + } + this.innerLabCostSummary().withEstimatedLabCost(estimatedLabCost); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerTargetCost() != null) { + innerTargetCost().validate(); + } + if (innerLabCostSummary() != null) { + innerLabCostSummary().validate(); + } + if (labCostDetails() != null) { + labCostDetails().forEach(e -> e.validate()); + } + if (resourceCosts() != null) { + resourceCosts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostSummaryProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostSummaryProperties.java similarity index 96% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostSummaryProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostSummaryProperties.java index d9db34eebd68..70d5f81499b2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostSummaryProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabCostSummaryProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java index f69209b3665a..87ada70a2e40 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabInner.java @@ -5,12 +5,13 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.EncryptionType; import com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission; -import com.azure.resourcemanager.devtestlabs.models.LabAnnouncementProperties; -import com.azure.resourcemanager.devtestlabs.models.LabSupportProperties; +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; import com.azure.resourcemanager.devtestlabs.models.PremiumDataDisk; import com.azure.resourcemanager.devtestlabs.models.StorageType; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -20,143 +21,68 @@ import java.util.Map; /** A lab. */ -@JsonFlatten @Fluent -public class LabInner extends Resource { +public final class LabInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabInner.class); /* - * The lab's default storage account. + * The properties of the resource. */ - @JsonProperty(value = "properties.defaultStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String defaultStorageAccount; + @JsonProperty(value = "properties", required = true) + private LabProperties innerProperties = new LabProperties(); /* - * The lab's default premium storage account. + * The identity of the resource. */ - @JsonProperty(value = "properties.defaultPremiumStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String defaultPremiumStorageAccount; + @JsonProperty(value = "identity") + private IdentityProperties innerIdentity; /* - * The lab's artifact storage account. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.artifactsStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String artifactsStorageAccount; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The lab's premium data disk storage account. - */ - @JsonProperty(value = "properties.premiumDataDiskStorageAccount", access = JsonProperty.Access.WRITE_ONLY) - private String premiumDataDiskStorageAccount; - - /* - * The lab's Key vault. - */ - @JsonProperty(value = "properties.vaultName", access = JsonProperty.Access.WRITE_ONLY) - private String vaultName; - - /* - * Type of storage used by the lab. It can be either Premium or Standard. - * Default is Premium. - */ - @JsonProperty(value = "properties.labStorageType") - private StorageType labStorageType; - - /* - * The ordered list of artifact resource IDs that should be applied on all - * Linux VM creations by default, prior to the artifacts specified by the - * user. - */ - @JsonProperty(value = "properties.mandatoryArtifactsResourceIdsLinux") - private List mandatoryArtifactsResourceIdsLinux; - - /* - * The ordered list of artifact resource IDs that should be applied on all - * Windows VM creations by default, prior to the artifacts specified by the - * user. - */ - @JsonProperty(value = "properties.mandatoryArtifactsResourceIdsWindows") - private List mandatoryArtifactsResourceIdsWindows; - - /* - * The creation date of the lab. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * The setting to enable usage of premium data disks. - * When its value is 'Enabled', creation of standard or premium data disks - * is allowed. - * When its value is 'Disabled', only creation of standard data disks is - * allowed. - */ - @JsonProperty(value = "properties.premiumDataDisks") - private PremiumDataDisk premiumDataDisks; - - /* - * The access rights to be granted to the user when provisioning an - * environment - */ - @JsonProperty(value = "properties.environmentPermission") - private EnvironmentPermission environmentPermission; - - /* - * The properties of any lab announcement associated with this lab - */ - @JsonProperty(value = "properties.announcement") - private LabAnnouncementProperties announcement; - - /* - * The properties of any lab support message associated with this lab - */ - @JsonProperty(value = "properties.support") - private LabSupportProperties support; - - /* - * The resource group in which all new lab virtual machines will be - * created. To let DevTest Labs manage resource group creation, set this - * value to null. - */ - @JsonProperty(value = "properties.vmCreationResourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String vmCreationResourceGroup; - - /* - * The public IP address for the lab's load balancer. - */ - @JsonProperty(value = "properties.publicIpId", access = JsonProperty.Access.WRITE_ONLY) - private String publicIpId; - - /* - * The load balancer used to for lab VMs that use shared IP address. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.loadBalancerId", access = JsonProperty.Access.WRITE_ONLY) - private String loadBalancerId; + private LabProperties innerProperties() { + return this.innerProperties; + } - /* - * The Network Security Group attached to the lab VMs Network interfaces to - * restrict open ports. + /** + * Get the innerIdentity property: The identity of the resource. + * + * @return the innerIdentity value. */ - @JsonProperty(value = "properties.networkSecurityGroupId", access = JsonProperty.Access.WRITE_ONLY) - private String networkSecurityGroupId; + private IdentityProperties innerIdentity() { + return this.innerIdentity; + } - /* - * Extended properties of the lab used for experimental features + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.extendedProperties") - private Map extendedProperties; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public LabInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public LabInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the defaultStorageAccount property: The lab's default storage account. @@ -164,7 +90,7 @@ public class LabInner extends Resource { * @return the defaultStorageAccount value. */ public String defaultStorageAccount() { - return this.defaultStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().defaultStorageAccount(); } /** @@ -173,7 +99,7 @@ public String defaultStorageAccount() { * @return the defaultPremiumStorageAccount value. */ public String defaultPremiumStorageAccount() { - return this.defaultPremiumStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().defaultPremiumStorageAccount(); } /** @@ -182,7 +108,21 @@ public String defaultPremiumStorageAccount() { * @return the artifactsStorageAccount value. */ public String artifactsStorageAccount() { - return this.artifactsStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().artifactsStorageAccount(); + } + + /** + * Set the artifactsStorageAccount property: The lab's artifact storage account. + * + * @param artifactsStorageAccount the artifactsStorageAccount value to set. + * @return the LabInner object itself. + */ + public LabInner withArtifactsStorageAccount(String artifactsStorageAccount) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withArtifactsStorageAccount(artifactsStorageAccount); + return this; } /** @@ -191,7 +131,7 @@ public String artifactsStorageAccount() { * @return the premiumDataDiskStorageAccount value. */ public String premiumDataDiskStorageAccount() { - return this.premiumDataDiskStorageAccount; + return this.innerProperties() == null ? null : this.innerProperties().premiumDataDiskStorageAccount(); } /** @@ -200,7 +140,7 @@ public String premiumDataDiskStorageAccount() { * @return the vaultName value. */ public String vaultName() { - return this.vaultName; + return this.innerProperties() == null ? null : this.innerProperties().vaultName(); } /** @@ -210,7 +150,7 @@ public String vaultName() { * @return the labStorageType value. */ public StorageType labStorageType() { - return this.labStorageType; + return this.innerProperties() == null ? null : this.innerProperties().labStorageType(); } /** @@ -221,7 +161,10 @@ public StorageType labStorageType() { * @return the LabInner object itself. */ public LabInner withLabStorageType(StorageType labStorageType) { - this.labStorageType = labStorageType; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withLabStorageType(labStorageType); return this; } @@ -232,7 +175,7 @@ public LabInner withLabStorageType(StorageType labStorageType) { * @return the mandatoryArtifactsResourceIdsLinux value. */ public List mandatoryArtifactsResourceIdsLinux() { - return this.mandatoryArtifactsResourceIdsLinux; + return this.innerProperties() == null ? null : this.innerProperties().mandatoryArtifactsResourceIdsLinux(); } /** @@ -243,7 +186,10 @@ public List mandatoryArtifactsResourceIdsLinux() { * @return the LabInner object itself. */ public LabInner withMandatoryArtifactsResourceIdsLinux(List mandatoryArtifactsResourceIdsLinux) { - this.mandatoryArtifactsResourceIdsLinux = mandatoryArtifactsResourceIdsLinux; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withMandatoryArtifactsResourceIdsLinux(mandatoryArtifactsResourceIdsLinux); return this; } @@ -254,7 +200,7 @@ public LabInner withMandatoryArtifactsResourceIdsLinux(List mandatoryArt * @return the mandatoryArtifactsResourceIdsWindows value. */ public List mandatoryArtifactsResourceIdsWindows() { - return this.mandatoryArtifactsResourceIdsWindows; + return this.innerProperties() == null ? null : this.innerProperties().mandatoryArtifactsResourceIdsWindows(); } /** @@ -265,7 +211,10 @@ public List mandatoryArtifactsResourceIdsWindows() { * @return the LabInner object itself. */ public LabInner withMandatoryArtifactsResourceIdsWindows(List mandatoryArtifactsResourceIdsWindows) { - this.mandatoryArtifactsResourceIdsWindows = mandatoryArtifactsResourceIdsWindows; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withMandatoryArtifactsResourceIdsWindows(mandatoryArtifactsResourceIdsWindows); return this; } @@ -275,7 +224,7 @@ public LabInner withMandatoryArtifactsResourceIdsWindows(List mandatoryA * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -286,7 +235,7 @@ public OffsetDateTime createdDate() { * @return the premiumDataDisks value. */ public PremiumDataDisk premiumDataDisks() { - return this.premiumDataDisks; + return this.innerProperties() == null ? null : this.innerProperties().premiumDataDisks(); } /** @@ -298,7 +247,10 @@ public PremiumDataDisk premiumDataDisks() { * @return the LabInner object itself. */ public LabInner withPremiumDataDisks(PremiumDataDisk premiumDataDisks) { - this.premiumDataDisks = premiumDataDisks; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withPremiumDataDisks(premiumDataDisks); return this; } @@ -309,7 +261,7 @@ public LabInner withPremiumDataDisks(PremiumDataDisk premiumDataDisks) { * @return the environmentPermission value. */ public EnvironmentPermission environmentPermission() { - return this.environmentPermission; + return this.innerProperties() == null ? null : this.innerProperties().environmentPermission(); } /** @@ -320,105 +272,205 @@ public EnvironmentPermission environmentPermission() { * @return the LabInner object itself. */ public LabInner withEnvironmentPermission(EnvironmentPermission environmentPermission) { - this.environmentPermission = environmentPermission; + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withEnvironmentPermission(environmentPermission); + return this; + } + + /** + * Get the vmCreationResourceGroup property: The resource group ID in which all new lab virtual machines will be + * created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest Labs manage resource group creation, set + * this value to null. + * + * @return the vmCreationResourceGroup value. + */ + public String vmCreationResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().vmCreationResourceGroup(); + } + + /** + * Set the vmCreationResourceGroup property: The resource group ID in which all new lab virtual machines will be + * created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest Labs manage resource group creation, set + * this value to null. + * + * @param vmCreationResourceGroup the vmCreationResourceGroup value to set. + * @return the LabInner object itself. + */ + public LabInner withVmCreationResourceGroup(String vmCreationResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withVmCreationResourceGroup(vmCreationResourceGroup); return this; } /** - * Get the announcement property: The properties of any lab announcement associated with this lab. + * Get the publicIpId property: The public IP address for the lab's load balancer. + * + * @return the publicIpId value. + */ + public String publicIpId() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpId(); + } + + /** + * Get the loadBalancerId property: The load balancer used to for lab VMs that use shared IP address. + * + * @return the loadBalancerId value. + */ + public String loadBalancerId() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerId(); + } + + /** + * Get the networkSecurityGroupId property: The Network Security Group attached to the lab VMs Network interfaces to + * restrict open ports. * - * @return the announcement value. + * @return the networkSecurityGroupId value. */ - public LabAnnouncementProperties announcement() { - return this.announcement; + public String networkSecurityGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroupId(); } /** - * Set the announcement property: The properties of any lab announcement associated with this lab. + * Get the extendedProperties property: Extended properties of the lab used for experimental features. * - * @param announcement the announcement value to set. + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); + } + + /** + * Set the extendedProperties property: Extended properties of the lab used for experimental features. + * + * @param extendedProperties the extendedProperties value to set. * @return the LabInner object itself. */ - public LabInner withAnnouncement(LabAnnouncementProperties announcement) { - this.announcement = announcement; + public LabInner withExtendedProperties(Map extendedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withExtendedProperties(extendedProperties); return this; } /** - * Get the support property: The properties of any lab support message associated with this lab. + * Get the browserConnect property: Is browser connect enabled for the lab. * - * @return the support value. + * @return the browserConnect value. */ - public LabSupportProperties support() { - return this.support; + public EnableStatus browserConnect() { + return this.innerProperties() == null ? null : this.innerProperties().browserConnect(); } /** - * Set the support property: The properties of any lab support message associated with this lab. + * Set the browserConnect property: Is browser connect enabled for the lab. * - * @param support the support value to set. + * @param browserConnect the browserConnect value to set. * @return the LabInner object itself. */ - public LabInner withSupport(LabSupportProperties support) { - this.support = support; + public LabInner withBrowserConnect(EnableStatus browserConnect) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withBrowserConnect(browserConnect); return this; } /** - * Get the vmCreationResourceGroup property: The resource group in which all new lab virtual machines will be - * created. To let DevTest Labs manage resource group creation, set this value to null. + * Get the disableAutoUpgradeCseMinorVersion property: Is auto upgrade of CSE disabled for the lab?. * - * @return the vmCreationResourceGroup value. + * @return the disableAutoUpgradeCseMinorVersion value. */ - public String vmCreationResourceGroup() { - return this.vmCreationResourceGroup; + public Boolean disableAutoUpgradeCseMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().disableAutoUpgradeCseMinorVersion(); } /** - * Get the publicIpId property: The public IP address for the lab's load balancer. + * Set the disableAutoUpgradeCseMinorVersion property: Is auto upgrade of CSE disabled for the lab?. * - * @return the publicIpId value. + * @param disableAutoUpgradeCseMinorVersion the disableAutoUpgradeCseMinorVersion value to set. + * @return the LabInner object itself. */ - public String publicIpId() { - return this.publicIpId; + public LabInner withDisableAutoUpgradeCseMinorVersion(Boolean disableAutoUpgradeCseMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withDisableAutoUpgradeCseMinorVersion(disableAutoUpgradeCseMinorVersion); + return this; } /** - * Get the loadBalancerId property: The load balancer used to for lab VMs that use shared IP address. + * Get the managementIdentities property: List of identities which can be used for management of resources. * - * @return the loadBalancerId value. + * @return the managementIdentities value. */ - public String loadBalancerId() { - return this.loadBalancerId; + public Map managementIdentities() { + return this.innerProperties() == null ? null : this.innerProperties().managementIdentities(); } /** - * Get the networkSecurityGroupId property: The Network Security Group attached to the lab VMs Network interfaces to - * restrict open ports. + * Set the managementIdentities property: List of identities which can be used for management of resources. * - * @return the networkSecurityGroupId value. + * @param managementIdentities the managementIdentities value to set. + * @return the LabInner object itself. */ - public String networkSecurityGroupId() { - return this.networkSecurityGroupId; + public LabInner withManagementIdentities(Map managementIdentities) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withManagementIdentities(managementIdentities); + return this; } /** - * Get the extendedProperties property: Extended properties of the lab used for experimental features. + * Get the isolateLabResources property: Indicates whether to create Lab resources (e.g. Storage accounts and Key + * Vaults) in network isolation. * - * @return the extendedProperties value. + * @return the isolateLabResources value. */ - public Map extendedProperties() { - return this.extendedProperties; + public EnableStatus isolateLabResources() { + return this.innerProperties() == null ? null : this.innerProperties().isolateLabResources(); } /** - * Set the extendedProperties property: Extended properties of the lab used for experimental features. + * Set the isolateLabResources property: Indicates whether to create Lab resources (e.g. Storage accounts and Key + * Vaults) in network isolation. * - * @param extendedProperties the extendedProperties value to set. + * @param isolateLabResources the isolateLabResources value to set. * @return the LabInner object itself. */ - public LabInner withExtendedProperties(Map extendedProperties) { - this.extendedProperties = extendedProperties; + public LabInner withIsolateLabResources(EnableStatus isolateLabResources) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withIsolateLabResources(isolateLabResources); + return this; + } + + /** + * Get the defaultSecretName property: Default secret for creating virtual machines. + * + * @return the defaultSecretName value. + */ + public String defaultSecretName() { + return this.innerProperties() == null ? null : this.innerProperties().defaultSecretName(); + } + + /** + * Set the defaultSecretName property: Default secret for creating virtual machines. + * + * @param defaultSecretName the defaultSecretName value to set. + * @return the LabInner object itself. + */ + public LabInner withDefaultSecretName(String defaultSecretName) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withDefaultSecretName(defaultSecretName); return this; } @@ -428,7 +480,7 @@ public LabInner withExtendedProperties(Map extendedProperties) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -437,20 +489,311 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** {@inheritDoc} */ - @Override - public LabInner withLocation(String location) { - super.withLocation(location); + /** + * Get the title property: The plain text title for the lab announcement. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: The plain text title for the lab announcement. + * + * @param title the title value to set. + * @return the LabInner object itself. + */ + public LabInner withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withTitle(title); return this; } - /** {@inheritDoc} */ - @Override - public LabInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the markdown property: The markdown text (if any) that this lab displays in the UI. If left empty/null, + * nothing will be shown. + * + * @return the markdown value. + */ + public String markdown() { + return this.innerProperties() == null ? null : this.innerProperties().markdown(); + } + + /** + * Set the markdown property: The markdown text (if any) that this lab displays in the UI. If left empty/null, + * nothing will be shown. + * + * @param markdown the markdown value to set. + * @return the LabInner object itself. + */ + public LabInner withMarkdown(String markdown) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withMarkdown(markdown); + return this; + } + + /** + * Get the enabled property: Is the lab announcement active/enabled at this time?. + * + * @return the enabled value. + */ + public EnableStatus enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Is the lab announcement active/enabled at this time?. + * + * @param enabled the enabled value to set. + * @return the LabInner object itself. + */ + public LabInner withEnabled(EnableStatus enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the expirationDate property: The time at which the announcement expires (null for never). + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); + } + + /** + * Set the expirationDate property: The time at which the announcement expires (null for never). + * + * @param expirationDate the expirationDate value to set. + * @return the LabInner object itself. + */ + public LabInner withExpirationDate(OffsetDateTime expirationDate) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withExpirationDate(expirationDate); + return this; + } + + /** + * Get the expired property: Has this announcement expired?. + * + * @return the expired value. + */ + public Boolean expired() { + return this.innerProperties() == null ? null : this.innerProperties().expired(); + } + + /** + * Set the expired property: Has this announcement expired?. + * + * @param expired the expired value to set. + * @return the LabInner object itself. + */ + public LabInner withExpired(Boolean expired) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withExpired(expired); + return this; + } + + /** + * Get the provisioningStateAnnouncementProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateAnnouncementProvisioningState value. + */ + public String provisioningStateAnnouncementProvisioningState() { + return this.innerProperties() == null + ? null + : this.innerProperties().provisioningStateAnnouncementProvisioningState(); + } + + /** + * Get the uniqueIdentifierAnnouncementUniqueIdentifier property: The unique immutable identifier of a resource + * (Guid). + * + * @return the uniqueIdentifierAnnouncementUniqueIdentifier value. + */ + public String uniqueIdentifierAnnouncementUniqueIdentifier() { + return this.innerProperties() == null + ? null + : this.innerProperties().uniqueIdentifierAnnouncementUniqueIdentifier(); + } + + /** + * Get the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.innerProperties() == null ? null : this.innerProperties().diskEncryptionSetId(); + } + + /** + * Set the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the LabInner object itself. + */ + public LabInner withDiskEncryptionSetId(String diskEncryptionSetId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + /** + * Get the type property: Gets or sets the type of key used to encrypt the data of the disk. Possible values + * include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @return the type value. + */ + public EncryptionType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Gets or sets the type of key used to encrypt the data of the disk. Possible values + * include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @param type the type value to set. + * @return the LabInner object itself. + */ + public LabInner withTypePropertiesType(EncryptionType type) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the type property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @return the type value. + */ + public ManagedIdentityType typeIdentityType() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @param type the type value to set. + * @return the LabInner object itself. + */ + public LabInner withTypeIdentityType(ManagedIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the principalId property: The principal id of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Set the principalId property: The principal id of resource identity. + * + * @param principalId the principalId value to set. + * @return the LabInner object itself. + */ + public LabInner withPrincipalId(String principalId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withPrincipalId(principalId); + return this; + } + + /** + * Get the tenantId property: The tenant identifier of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Set the tenantId property: The tenant identifier of resource. + * + * @param tenantId the tenantId value to set. + * @return the LabInner object itself. + */ + public LabInner withTenantId(String tenantId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withTenantId(tenantId); + return this; + } + + /** + * Get the clientSecretUrl property: The client secret URL of the identity. + * + * @return the clientSecretUrl value. + */ + public String clientSecretUrl() { + return this.innerIdentity() == null ? null : this.innerIdentity().clientSecretUrl(); + } + + /** + * Set the clientSecretUrl property: The client secret URL of the identity. + * + * @param clientSecretUrl the clientSecretUrl value to set. + * @return the LabInner object itself. + */ + public LabInner withClientSecretUrl(String clientSecretUrl) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withClientSecretUrl(clientSecretUrl); + return this; + } + + /** + * Get the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the LabInner object itself. + */ + public LabInner withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); return this; } @@ -460,11 +803,15 @@ public LabInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (announcement() != null) { - announcement().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model LabInner")); + } else { + innerProperties().validate(); } - if (support() != null) { - support().validate(); + if (innerIdentity() != null) { + innerIdentity().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java new file mode 100644 index 000000000000..a000241f411c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabProperties.java @@ -0,0 +1,844 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.EncryptionType; +import com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission; +import com.azure.resourcemanager.devtestlabs.models.PremiumDataDisk; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of a lab. */ +@Fluent +public final class LabProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabProperties.class); + + /* + * The lab's default storage account. + */ + @JsonProperty(value = "defaultStorageAccount", access = JsonProperty.Access.WRITE_ONLY) + private String defaultStorageAccount; + + /* + * The lab's default premium storage account. + */ + @JsonProperty(value = "defaultPremiumStorageAccount", access = JsonProperty.Access.WRITE_ONLY) + private String defaultPremiumStorageAccount; + + /* + * The lab's artifact storage account. + */ + @JsonProperty(value = "artifactsStorageAccount") + private String artifactsStorageAccount; + + /* + * The lab's premium data disk storage account. + */ + @JsonProperty(value = "premiumDataDiskStorageAccount", access = JsonProperty.Access.WRITE_ONLY) + private String premiumDataDiskStorageAccount; + + /* + * The lab's Key vault. + */ + @JsonProperty(value = "vaultName", access = JsonProperty.Access.WRITE_ONLY) + private String vaultName; + + /* + * Type of storage used by the lab. It can be either Premium or Standard. + * Default is Premium. + */ + @JsonProperty(value = "labStorageType") + private StorageType labStorageType; + + /* + * The ordered list of artifact resource IDs that should be applied on all + * Linux VM creations by default, prior to the artifacts specified by the + * user. + */ + @JsonProperty(value = "mandatoryArtifactsResourceIdsLinux") + private List mandatoryArtifactsResourceIdsLinux; + + /* + * The ordered list of artifact resource IDs that should be applied on all + * Windows VM creations by default, prior to the artifacts specified by the + * user. + */ + @JsonProperty(value = "mandatoryArtifactsResourceIdsWindows") + private List mandatoryArtifactsResourceIdsWindows; + + /* + * The creation date of the lab. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The setting to enable usage of premium data disks. + * When its value is 'Enabled', creation of standard or premium data disks + * is allowed. + * When its value is 'Disabled', only creation of standard data disks is + * allowed. + */ + @JsonProperty(value = "premiumDataDisks") + private PremiumDataDisk premiumDataDisks; + + /* + * The access rights to be granted to the user when provisioning an + * environment + */ + @JsonProperty(value = "environmentPermission") + private EnvironmentPermission environmentPermission; + + /* + * The properties of any lab announcement associated with this lab + */ + @JsonProperty(value = "announcement") + private LabAnnouncementProperties innerAnnouncement; + + /* + * The properties of any lab support message associated with this lab + */ + @JsonProperty(value = "support") + private LabSupportProperties innerSupport; + + /* + * The resource group ID in which all new lab virtual machines will be + * created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest + * Labs manage resource group creation, set this value to null. + */ + @JsonProperty(value = "vmCreationResourceGroup") + private String vmCreationResourceGroup; + + /* + * The public IP address for the lab's load balancer. + */ + @JsonProperty(value = "publicIpId", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpId; + + /* + * The load balancer used to for lab VMs that use shared IP address. + */ + @JsonProperty(value = "loadBalancerId", access = JsonProperty.Access.WRITE_ONLY) + private String loadBalancerId; + + /* + * The Network Security Group attached to the lab VMs Network interfaces to + * restrict open ports. + */ + @JsonProperty(value = "networkSecurityGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String networkSecurityGroupId; + + /* + * Extended properties of the lab used for experimental features + */ + @JsonProperty(value = "extendedProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extendedProperties; + + /* + * Is browser connect enabled for the lab + */ + @JsonProperty(value = "browserConnect") + private EnableStatus browserConnect; + + /* + * Is auto upgrade of CSE disabled for the lab? + */ + @JsonProperty(value = "disableAutoUpgradeCseMinorVersion") + private Boolean disableAutoUpgradeCseMinorVersion; + + /* + * List of identities which can be used for management of resources. + */ + @JsonProperty(value = "managementIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map managementIdentities; + + /* + * Indicates whether to create Lab resources (e.g. Storage accounts and Key + * Vaults) in network isolation. + */ + @JsonProperty(value = "isolateLabResources") + private EnableStatus isolateLabResources; + + /* + * Mechanism used for encryption of resources in a lab (such as virtual + * machines). + */ + @JsonProperty(value = "encryption") + private Encryption innerEncryption; + + /* + * Default secret for creating virtual machines. + */ + @JsonProperty(value = "defaultSecretName") + private String defaultSecretName; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the defaultStorageAccount property: The lab's default storage account. + * + * @return the defaultStorageAccount value. + */ + public String defaultStorageAccount() { + return this.defaultStorageAccount; + } + + /** + * Get the defaultPremiumStorageAccount property: The lab's default premium storage account. + * + * @return the defaultPremiumStorageAccount value. + */ + public String defaultPremiumStorageAccount() { + return this.defaultPremiumStorageAccount; + } + + /** + * Get the artifactsStorageAccount property: The lab's artifact storage account. + * + * @return the artifactsStorageAccount value. + */ + public String artifactsStorageAccount() { + return this.artifactsStorageAccount; + } + + /** + * Set the artifactsStorageAccount property: The lab's artifact storage account. + * + * @param artifactsStorageAccount the artifactsStorageAccount value to set. + * @return the LabProperties object itself. + */ + public LabProperties withArtifactsStorageAccount(String artifactsStorageAccount) { + this.artifactsStorageAccount = artifactsStorageAccount; + return this; + } + + /** + * Get the premiumDataDiskStorageAccount property: The lab's premium data disk storage account. + * + * @return the premiumDataDiskStorageAccount value. + */ + public String premiumDataDiskStorageAccount() { + return this.premiumDataDiskStorageAccount; + } + + /** + * Get the vaultName property: The lab's Key vault. + * + * @return the vaultName value. + */ + public String vaultName() { + return this.vaultName; + } + + /** + * Get the labStorageType property: Type of storage used by the lab. It can be either Premium or Standard. Default + * is Premium. + * + * @return the labStorageType value. + */ + public StorageType labStorageType() { + return this.labStorageType; + } + + /** + * Set the labStorageType property: Type of storage used by the lab. It can be either Premium or Standard. Default + * is Premium. + * + * @param labStorageType the labStorageType value to set. + * @return the LabProperties object itself. + */ + public LabProperties withLabStorageType(StorageType labStorageType) { + this.labStorageType = labStorageType; + return this; + } + + /** + * Get the mandatoryArtifactsResourceIdsLinux property: The ordered list of artifact resource IDs that should be + * applied on all Linux VM creations by default, prior to the artifacts specified by the user. + * + * @return the mandatoryArtifactsResourceIdsLinux value. + */ + public List mandatoryArtifactsResourceIdsLinux() { + return this.mandatoryArtifactsResourceIdsLinux; + } + + /** + * Set the mandatoryArtifactsResourceIdsLinux property: The ordered list of artifact resource IDs that should be + * applied on all Linux VM creations by default, prior to the artifacts specified by the user. + * + * @param mandatoryArtifactsResourceIdsLinux the mandatoryArtifactsResourceIdsLinux value to set. + * @return the LabProperties object itself. + */ + public LabProperties withMandatoryArtifactsResourceIdsLinux(List mandatoryArtifactsResourceIdsLinux) { + this.mandatoryArtifactsResourceIdsLinux = mandatoryArtifactsResourceIdsLinux; + return this; + } + + /** + * Get the mandatoryArtifactsResourceIdsWindows property: The ordered list of artifact resource IDs that should be + * applied on all Windows VM creations by default, prior to the artifacts specified by the user. + * + * @return the mandatoryArtifactsResourceIdsWindows value. + */ + public List mandatoryArtifactsResourceIdsWindows() { + return this.mandatoryArtifactsResourceIdsWindows; + } + + /** + * Set the mandatoryArtifactsResourceIdsWindows property: The ordered list of artifact resource IDs that should be + * applied on all Windows VM creations by default, prior to the artifacts specified by the user. + * + * @param mandatoryArtifactsResourceIdsWindows the mandatoryArtifactsResourceIdsWindows value to set. + * @return the LabProperties object itself. + */ + public LabProperties withMandatoryArtifactsResourceIdsWindows(List mandatoryArtifactsResourceIdsWindows) { + this.mandatoryArtifactsResourceIdsWindows = mandatoryArtifactsResourceIdsWindows; + return this; + } + + /** + * Get the createdDate property: The creation date of the lab. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the premiumDataDisks property: The setting to enable usage of premium data disks. When its value is + * 'Enabled', creation of standard or premium data disks is allowed. When its value is 'Disabled', only creation of + * standard data disks is allowed. + * + * @return the premiumDataDisks value. + */ + public PremiumDataDisk premiumDataDisks() { + return this.premiumDataDisks; + } + + /** + * Set the premiumDataDisks property: The setting to enable usage of premium data disks. When its value is + * 'Enabled', creation of standard or premium data disks is allowed. When its value is 'Disabled', only creation of + * standard data disks is allowed. + * + * @param premiumDataDisks the premiumDataDisks value to set. + * @return the LabProperties object itself. + */ + public LabProperties withPremiumDataDisks(PremiumDataDisk premiumDataDisks) { + this.premiumDataDisks = premiumDataDisks; + return this; + } + + /** + * Get the environmentPermission property: The access rights to be granted to the user when provisioning an + * environment. + * + * @return the environmentPermission value. + */ + public EnvironmentPermission environmentPermission() { + return this.environmentPermission; + } + + /** + * Set the environmentPermission property: The access rights to be granted to the user when provisioning an + * environment. + * + * @param environmentPermission the environmentPermission value to set. + * @return the LabProperties object itself. + */ + public LabProperties withEnvironmentPermission(EnvironmentPermission environmentPermission) { + this.environmentPermission = environmentPermission; + return this; + } + + /** + * Get the innerAnnouncement property: The properties of any lab announcement associated with this lab. + * + * @return the innerAnnouncement value. + */ + private LabAnnouncementProperties innerAnnouncement() { + return this.innerAnnouncement; + } + + /** + * Get the innerSupport property: The properties of any lab support message associated with this lab. + * + * @return the innerSupport value. + */ + private LabSupportProperties innerSupport() { + return this.innerSupport; + } + + /** + * Get the vmCreationResourceGroup property: The resource group ID in which all new lab virtual machines will be + * created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest Labs manage resource group creation, set + * this value to null. + * + * @return the vmCreationResourceGroup value. + */ + public String vmCreationResourceGroup() { + return this.vmCreationResourceGroup; + } + + /** + * Set the vmCreationResourceGroup property: The resource group ID in which all new lab virtual machines will be + * created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest Labs manage resource group creation, set + * this value to null. + * + * @param vmCreationResourceGroup the vmCreationResourceGroup value to set. + * @return the LabProperties object itself. + */ + public LabProperties withVmCreationResourceGroup(String vmCreationResourceGroup) { + this.vmCreationResourceGroup = vmCreationResourceGroup; + return this; + } + + /** + * Get the publicIpId property: The public IP address for the lab's load balancer. + * + * @return the publicIpId value. + */ + public String publicIpId() { + return this.publicIpId; + } + + /** + * Get the loadBalancerId property: The load balancer used to for lab VMs that use shared IP address. + * + * @return the loadBalancerId value. + */ + public String loadBalancerId() { + return this.loadBalancerId; + } + + /** + * Get the networkSecurityGroupId property: The Network Security Group attached to the lab VMs Network interfaces to + * restrict open ports. + * + * @return the networkSecurityGroupId value. + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Get the extendedProperties property: Extended properties of the lab used for experimental features. + * + * @return the extendedProperties value. + */ + public Map extendedProperties() { + return this.extendedProperties; + } + + /** + * Set the extendedProperties property: Extended properties of the lab used for experimental features. + * + * @param extendedProperties the extendedProperties value to set. + * @return the LabProperties object itself. + */ + public LabProperties withExtendedProperties(Map extendedProperties) { + this.extendedProperties = extendedProperties; + return this; + } + + /** + * Get the browserConnect property: Is browser connect enabled for the lab. + * + * @return the browserConnect value. + */ + public EnableStatus browserConnect() { + return this.browserConnect; + } + + /** + * Set the browserConnect property: Is browser connect enabled for the lab. + * + * @param browserConnect the browserConnect value to set. + * @return the LabProperties object itself. + */ + public LabProperties withBrowserConnect(EnableStatus browserConnect) { + this.browserConnect = browserConnect; + return this; + } + + /** + * Get the disableAutoUpgradeCseMinorVersion property: Is auto upgrade of CSE disabled for the lab?. + * + * @return the disableAutoUpgradeCseMinorVersion value. + */ + public Boolean disableAutoUpgradeCseMinorVersion() { + return this.disableAutoUpgradeCseMinorVersion; + } + + /** + * Set the disableAutoUpgradeCseMinorVersion property: Is auto upgrade of CSE disabled for the lab?. + * + * @param disableAutoUpgradeCseMinorVersion the disableAutoUpgradeCseMinorVersion value to set. + * @return the LabProperties object itself. + */ + public LabProperties withDisableAutoUpgradeCseMinorVersion(Boolean disableAutoUpgradeCseMinorVersion) { + this.disableAutoUpgradeCseMinorVersion = disableAutoUpgradeCseMinorVersion; + return this; + } + + /** + * Get the managementIdentities property: List of identities which can be used for management of resources. + * + * @return the managementIdentities value. + */ + public Map managementIdentities() { + return this.managementIdentities; + } + + /** + * Set the managementIdentities property: List of identities which can be used for management of resources. + * + * @param managementIdentities the managementIdentities value to set. + * @return the LabProperties object itself. + */ + public LabProperties withManagementIdentities(Map managementIdentities) { + this.managementIdentities = managementIdentities; + return this; + } + + /** + * Get the isolateLabResources property: Indicates whether to create Lab resources (e.g. Storage accounts and Key + * Vaults) in network isolation. + * + * @return the isolateLabResources value. + */ + public EnableStatus isolateLabResources() { + return this.isolateLabResources; + } + + /** + * Set the isolateLabResources property: Indicates whether to create Lab resources (e.g. Storage accounts and Key + * Vaults) in network isolation. + * + * @param isolateLabResources the isolateLabResources value to set. + * @return the LabProperties object itself. + */ + public LabProperties withIsolateLabResources(EnableStatus isolateLabResources) { + this.isolateLabResources = isolateLabResources; + return this; + } + + /** + * Get the innerEncryption property: Mechanism used for encryption of resources in a lab (such as virtual machines). + * + * @return the innerEncryption value. + */ + private Encryption innerEncryption() { + return this.innerEncryption; + } + + /** + * Get the defaultSecretName property: Default secret for creating virtual machines. + * + * @return the defaultSecretName value. + */ + public String defaultSecretName() { + return this.defaultSecretName; + } + + /** + * Set the defaultSecretName property: Default secret for creating virtual machines. + * + * @param defaultSecretName the defaultSecretName value to set. + * @return the LabProperties object itself. + */ + public LabProperties withDefaultSecretName(String defaultSecretName) { + this.defaultSecretName = defaultSecretName; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the title property: The plain text title for the lab announcement. + * + * @return the title value. + */ + public String title() { + return this.innerAnnouncement() == null ? null : this.innerAnnouncement().title(); + } + + /** + * Set the title property: The plain text title for the lab announcement. + * + * @param title the title value to set. + * @return the LabProperties object itself. + */ + public LabProperties withTitle(String title) { + if (this.innerAnnouncement() == null) { + this.innerAnnouncement = new LabAnnouncementProperties(); + } + this.innerAnnouncement().withTitle(title); + return this; + } + + /** + * Get the markdown property: The markdown text (if any) that this lab displays in the UI. If left empty/null, + * nothing will be shown. + * + * @return the markdown value. + */ + public String markdown() { + return this.innerAnnouncement() == null ? null : this.innerAnnouncement().markdown(); + } + + /** + * Set the markdown property: The markdown text (if any) that this lab displays in the UI. If left empty/null, + * nothing will be shown. + * + * @param markdown the markdown value to set. + * @return the LabProperties object itself. + */ + public LabProperties withMarkdown(String markdown) { + if (this.innerAnnouncement() == null) { + this.innerAnnouncement = new LabAnnouncementProperties(); + } + this.innerAnnouncement().withMarkdown(markdown); + return this; + } + + /** + * Get the enabled property: Is the lab announcement active/enabled at this time?. + * + * @return the enabled value. + */ + public EnableStatus enabled() { + return this.innerAnnouncement() == null ? null : this.innerAnnouncement().enabled(); + } + + /** + * Set the enabled property: Is the lab announcement active/enabled at this time?. + * + * @param enabled the enabled value to set. + * @return the LabProperties object itself. + */ + public LabProperties withEnabled(EnableStatus enabled) { + if (this.innerAnnouncement() == null) { + this.innerAnnouncement = new LabAnnouncementProperties(); + } + this.innerAnnouncement().withEnabled(enabled); + return this; + } + + /** + * Get the expirationDate property: The time at which the announcement expires (null for never). + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.innerAnnouncement() == null ? null : this.innerAnnouncement().expirationDate(); + } + + /** + * Set the expirationDate property: The time at which the announcement expires (null for never). + * + * @param expirationDate the expirationDate value to set. + * @return the LabProperties object itself. + */ + public LabProperties withExpirationDate(OffsetDateTime expirationDate) { + if (this.innerAnnouncement() == null) { + this.innerAnnouncement = new LabAnnouncementProperties(); + } + this.innerAnnouncement().withExpirationDate(expirationDate); + return this; + } + + /** + * Get the expired property: Has this announcement expired?. + * + * @return the expired value. + */ + public Boolean expired() { + return this.innerAnnouncement() == null ? null : this.innerAnnouncement().expired(); + } + + /** + * Set the expired property: Has this announcement expired?. + * + * @param expired the expired value to set. + * @return the LabProperties object itself. + */ + public LabProperties withExpired(Boolean expired) { + if (this.innerAnnouncement() == null) { + this.innerAnnouncement = new LabAnnouncementProperties(); + } + this.innerAnnouncement().withExpired(expired); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningStateAnnouncementProvisioningState() { + return this.innerAnnouncement() == null ? null : this.innerAnnouncement().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifierAnnouncementUniqueIdentifier() { + return this.innerAnnouncement() == null ? null : this.innerAnnouncement().uniqueIdentifier(); + } + + /** + * Get the enabled property: Is the lab support banner active/enabled at this time?. + * + * @return the enabled value. + */ + public EnableStatus enabled() { + return this.innerSupport() == null ? null : this.innerSupport().enabled(); + } + + /** + * Set the enabled property: Is the lab support banner active/enabled at this time?. + * + * @param enabled the enabled value to set. + * @return the LabProperties object itself. + */ + public LabProperties withEnabled(EnableStatus enabled) { + if (this.innerSupport() == null) { + this.innerSupport = new LabSupportProperties(); + } + this.innerSupport().withEnabled(enabled); + return this; + } + + /** + * Get the markdown property: The markdown text (if any) that this lab displays in the UI. If left empty/null, + * nothing will be shown. + * + * @return the markdown value. + */ + public String markdown() { + return this.innerSupport() == null ? null : this.innerSupport().markdown(); + } + + /** + * Set the markdown property: The markdown text (if any) that this lab displays in the UI. If left empty/null, + * nothing will be shown. + * + * @param markdown the markdown value to set. + * @return the LabProperties object itself. + */ + public LabProperties withMarkdown(String markdown) { + if (this.innerSupport() == null) { + this.innerSupport = new LabSupportProperties(); + } + this.innerSupport().withMarkdown(markdown); + return this; + } + + /** + * Get the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.innerEncryption() == null ? null : this.innerEncryption().diskEncryptionSetId(); + } + + /** + * Set the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the LabProperties object itself. + */ + public LabProperties withDiskEncryptionSetId(String diskEncryptionSetId) { + if (this.innerEncryption() == null) { + this.innerEncryption = new Encryption(); + } + this.innerEncryption().withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + /** + * Get the type property: Gets or sets the type of key used to encrypt the data of the disk. Possible values + * include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @return the type value. + */ + public EncryptionType type() { + return this.innerEncryption() == null ? null : this.innerEncryption().type(); + } + + /** + * Set the type property: Gets or sets the type of key used to encrypt the data of the disk. Possible values + * include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @param type the type value to set. + * @return the LabProperties object itself. + */ + public LabProperties withType(EncryptionType type) { + if (this.innerEncryption() == null) { + this.innerEncryption = new Encryption(); + } + this.innerEncryption().withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerAnnouncement() != null) { + innerAnnouncement().validate(); + } + if (innerSupport() != null) { + innerSupport().validate(); + } + if (innerEncryption() != null) { + innerEncryption().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSecretInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSecretInner.java new file mode 100644 index 000000000000..aa21bca3ad29 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSecretInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A shared secret in a lab. */ +@Fluent +public final class LabSecretInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabSecretInner.class); + + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties", required = true) + private LabSecretProperties innerProperties = new LabSecretProperties(); + + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. + */ + private LabSecretProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public LabSecretInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabSecretInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the value property: The value of the secret for secret creation. + * + * @return the value value. + */ + public String value() { + return this.innerProperties() == null ? null : this.innerProperties().value(); + } + + /** + * Set the value property: The value of the secret for secret creation. + * + * @param value the value value to set. + * @return the LabSecretInner object itself. + */ + public LabSecretInner withValue(String value) { + if (this.innerProperties() == null) { + this.innerProperties = new LabSecretProperties(); + } + this.innerProperties().withValue(value); + return this; + } + + /** + * Get the keyVaultEntry property: The name of the entry in the lab KeyVault. + * + * @return the keyVaultEntry value. + */ + public String keyVaultEntry() { + return this.innerProperties() == null ? null : this.innerProperties().keyVaultEntry(); + } + + /** + * Get the enabledForArtifacts property: Is the secret enabled for use with artifacts?. + * + * @return the enabledForArtifacts value. + */ + public Boolean enabledForArtifacts() { + return this.innerProperties() == null ? null : this.innerProperties().enabledForArtifacts(); + } + + /** + * Set the enabledForArtifacts property: Is the secret enabled for use with artifacts?. + * + * @param enabledForArtifacts the enabledForArtifacts value to set. + * @return the LabSecretInner object itself. + */ + public LabSecretInner withEnabledForArtifacts(Boolean enabledForArtifacts) { + if (this.innerProperties() == null) { + this.innerProperties = new LabSecretProperties(); + } + this.innerProperties().withEnabledForArtifacts(enabledForArtifacts); + return this; + } + + /** + * Get the enabledForVmCreation property: Is the secret enabled for use with creation of VMs?. + * + * @return the enabledForVmCreation value. + */ + public Boolean enabledForVmCreation() { + return this.innerProperties() == null ? null : this.innerProperties().enabledForVmCreation(); + } + + /** + * Set the enabledForVmCreation property: Is the secret enabled for use with creation of VMs?. + * + * @param enabledForVmCreation the enabledForVmCreation value to set. + * @return the LabSecretInner object itself. + */ + public LabSecretInner withEnabledForVmCreation(Boolean enabledForVmCreation) { + if (this.innerProperties() == null) { + this.innerProperties = new LabSecretProperties(); + } + this.innerProperties().withEnabledForVmCreation(enabledForVmCreation); + return this; + } + + /** + * Get the enabledForArmEnvironments property: Is the secret enabled for use with ARM environments?. + * + * @return the enabledForArmEnvironments value. + */ + public Boolean enabledForArmEnvironments() { + return this.innerProperties() == null ? null : this.innerProperties().enabledForArmEnvironments(); + } + + /** + * Set the enabledForArmEnvironments property: Is the secret enabled for use with ARM environments?. + * + * @param enabledForArmEnvironments the enabledForArmEnvironments value to set. + * @return the LabSecretInner object itself. + */ + public LabSecretInner withEnabledForArmEnvironments(Boolean enabledForArmEnvironments) { + if (this.innerProperties() == null) { + this.innerProperties = new LabSecretProperties(); + } + this.innerProperties().withEnabledForArmEnvironments(enabledForArmEnvironments); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model LabSecretInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSecretProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSecretProperties.java new file mode 100644 index 000000000000..f9b046acff52 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSecretProperties.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of labs secrets. */ +@Fluent +public final class LabSecretProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabSecretProperties.class); + + /* + * The value of the secret for secret creation. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The name of the entry in the lab KeyVault. + */ + @JsonProperty(value = "keyVaultEntry", access = JsonProperty.Access.WRITE_ONLY) + private String keyVaultEntry; + + /* + * Is the secret enabled for use with artifacts? + */ + @JsonProperty(value = "enabledForArtifacts") + private Boolean enabledForArtifacts; + + /* + * Is the secret enabled for use with creation of VMs? + */ + @JsonProperty(value = "enabledForVmCreation") + private Boolean enabledForVmCreation; + + /* + * Is the secret enabled for use with ARM environments? + */ + @JsonProperty(value = "enabledForArmEnvironments") + private Boolean enabledForArmEnvironments; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the value property: The value of the secret for secret creation. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the secret for secret creation. + * + * @param value the value value to set. + * @return the LabSecretProperties object itself. + */ + public LabSecretProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the keyVaultEntry property: The name of the entry in the lab KeyVault. + * + * @return the keyVaultEntry value. + */ + public String keyVaultEntry() { + return this.keyVaultEntry; + } + + /** + * Get the enabledForArtifacts property: Is the secret enabled for use with artifacts?. + * + * @return the enabledForArtifacts value. + */ + public Boolean enabledForArtifacts() { + return this.enabledForArtifacts; + } + + /** + * Set the enabledForArtifacts property: Is the secret enabled for use with artifacts?. + * + * @param enabledForArtifacts the enabledForArtifacts value to set. + * @return the LabSecretProperties object itself. + */ + public LabSecretProperties withEnabledForArtifacts(Boolean enabledForArtifacts) { + this.enabledForArtifacts = enabledForArtifacts; + return this; + } + + /** + * Get the enabledForVmCreation property: Is the secret enabled for use with creation of VMs?. + * + * @return the enabledForVmCreation value. + */ + public Boolean enabledForVmCreation() { + return this.enabledForVmCreation; + } + + /** + * Set the enabledForVmCreation property: Is the secret enabled for use with creation of VMs?. + * + * @param enabledForVmCreation the enabledForVmCreation value to set. + * @return the LabSecretProperties object itself. + */ + public LabSecretProperties withEnabledForVmCreation(Boolean enabledForVmCreation) { + this.enabledForVmCreation = enabledForVmCreation; + return this; + } + + /** + * Get the enabledForArmEnvironments property: Is the secret enabled for use with ARM environments?. + * + * @return the enabledForArmEnvironments value. + */ + public Boolean enabledForArmEnvironments() { + return this.enabledForArmEnvironments; + } + + /** + * Set the enabledForArmEnvironments property: Is the secret enabled for use with ARM environments?. + * + * @param enabledForArmEnvironments the enabledForArmEnvironments value to set. + * @return the LabSecretProperties object itself. + */ + public LabSecretProperties withEnabledForArmEnvironments(Boolean enabledForArmEnvironments) { + this.enabledForArmEnvironments = enabledForArmEnvironments; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSupportProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSupportProperties.java similarity index 94% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSupportProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSupportProperties.java index e22bb44b49cf..7b57e5c8be24 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSupportProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabSupportProperties.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterInner.java new file mode 100644 index 000000000000..55b631278534 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterInner.java @@ -0,0 +1,1468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties for creating a virtual machine. */ +@Fluent +public final class LabVirtualMachineCreationParameterInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineCreationParameterInner.class); + + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties", required = true) + private LabVirtualMachineCreationParameterPropertiesInner innerProperties = + new LabVirtualMachineCreationParameterPropertiesInner(); + + /* + * The name of the virtual machine or environment + */ + @JsonProperty(value = "name") + private String name; + + /* + * The location of the new virtual machine or environment + */ + @JsonProperty(value = "location") + private String location; + + /* + * The tags of the resource. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. + */ + private LabVirtualMachineCreationParameterPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the name property: The name of the virtual machine or environment. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the virtual machine or environment. + * + * @param name the name value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location property: The location of the new virtual machine or environment. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the new virtual machine or environment. + * + * @param location the location value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: The tags of the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags of the resource. + * + * @param tags the tags value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + public String notes() { + return this.innerProperties() == null ? null : this.innerProperties().notes(); + } + + /** + * Set the notes property: The notes of the virtual machine. + * + * @param notes the notes value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withNotes(String notes) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withNotes(notes); + return this; + } + + /** + * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + public String ownerObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().ownerObjectId(); + } + + /** + * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @param ownerObjectId the ownerObjectId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withOwnerObjectId(String ownerObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withOwnerObjectId(ownerObjectId); + return this; + } + + /** + * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + public String ownerUserPrincipalName() { + return this.innerProperties() == null ? null : this.innerProperties().ownerUserPrincipalName(); + } + + /** + * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withOwnerUserPrincipalName(ownerUserPrincipalName); + return this; + } + + /** + * Get the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + public String createdByUserId() { + return this.innerProperties() == null ? null : this.innerProperties().createdByUserId(); + } + + /** + * Get the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.innerProperties() == null ? null : this.innerProperties().createdByUser(); + } + + /** + * Get the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Set the createdDate property: The creation date of the virtual machine. + * + * @param createdDate the createdDate value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withCreatedDate(OffsetDateTime createdDate) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withCreatedDate(createdDate); + return this; + } + + /** + * Get the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + public String computeId() { + return this.innerProperties() == null ? null : this.innerProperties().computeId(); + } + + /** + * Get the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + public String customImageId() { + return this.innerProperties() == null ? null : this.innerProperties().customImageId(); + } + + /** + * Set the customImageId property: The custom image identifier of the virtual machine. + * + * @param customImageId the customImageId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withCustomImageId(String customImageId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withCustomImageId(customImageId); + return this; + } + + /** + * Get the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + public String galleryImageVersionId() { + return this.innerProperties() == null ? null : this.innerProperties().galleryImageVersionId(); + } + + /** + * Set the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @param galleryImageVersionId the galleryImageVersionId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withGalleryImageVersionId(String galleryImageVersionId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withGalleryImageVersionId(galleryImageVersionId); + return this; + } + + /** + * Get the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + public String sharedImageId() { + return this.innerProperties() == null ? null : this.innerProperties().sharedImageId(); + } + + /** + * Set the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @param sharedImageId the sharedImageId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withSharedImageId(String sharedImageId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withSharedImageId(sharedImageId); + return this; + } + + /** + * Get the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + public String sharedImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().sharedImageVersion(); + } + + /** + * Set the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @param sharedImageVersion the sharedImageVersion value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withSharedImageVersion(String sharedImageVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withSharedImageVersion(sharedImageVersion); + return this; + } + + /** + * Get the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + public String osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Get the size property: The size of the virtual machine. + * + * @return the size value. + */ + public String size() { + return this.innerProperties() == null ? null : this.innerProperties().size(); + } + + /** + * Set the size property: The size of the virtual machine. + * + * @param size the size value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withSize(String size) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withSize(size); + return this; + } + + /** + * Get the username property: The user name of the virtual machine. + * + * @return the username value. + */ + public String username() { + return this.innerProperties() == null ? null : this.innerProperties().username(); + } + + /** + * Set the username property: The user name of the virtual machine. + * + * @param username the username value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withUsername(String username) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withUsername(username); + return this; + } + + /** + * Get the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + public String password() { + return this.innerProperties() == null ? null : this.innerProperties().password(); + } + + /** + * Set the password property: The password of the virtual machine administrator. + * + * @param password the password value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withPassword(String password) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withPassword(password); + return this; + } + + /** + * Get the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + public String sshKey() { + return this.innerProperties() == null ? null : this.innerProperties().sshKey(); + } + + /** + * Set the sshKey property: The SSH key of the virtual machine administrator. + * + * @param sshKey the sshKey value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withSshKey(String sshKey) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withSshKey(sshKey); + return this; + } + + /** + * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + public Boolean isAuthenticationWithSshKey() { + return this.innerProperties() == null ? null : this.innerProperties().isAuthenticationWithSshKey(); + } + + /** + * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withIsAuthenticationWithSshKey(isAuthenticationWithSshKey); + return this; + } + + /** + * Get the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + public String labSubnetName() { + return this.innerProperties() == null ? null : this.innerProperties().labSubnetName(); + } + + /** + * Set the labSubnetName property: The lab subnet name of the virtual machine. + * + * @param labSubnetName the labSubnetName value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withLabSubnetName(String labSubnetName) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withLabSubnetName(labSubnetName); + return this; + } + + /** + * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + public String labVirtualNetworkId() { + return this.innerProperties() == null ? null : this.innerProperties().labVirtualNetworkId(); + } + + /** + * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @param labVirtualNetworkId the labVirtualNetworkId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withLabVirtualNetworkId(String labVirtualNetworkId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withLabVirtualNetworkId(labVirtualNetworkId); + return this; + } + + /** + * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @return the disallowPublicIpAddress value. + */ + public Boolean disallowPublicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().disallowPublicIpAddress(); + } + + /** + * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withDisallowPublicIpAddress(disallowPublicIpAddress); + return this; + } + + /** + * Get the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); + } + + /** + * Set the artifacts property: The artifacts to be installed on the virtual machine. + * + * @param artifacts the artifacts value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withArtifacts(List artifacts) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withArtifacts(artifacts); + return this; + } + + /** + * Get the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + public String planId() { + return this.innerProperties() == null ? null : this.innerProperties().planId(); + } + + /** + * Set the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId the planId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withPlanId(String planId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withPlanId(planId); + return this; + } + + /** + * Get the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + public Integer osDiskSizeGb() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskSizeGb(); + } + + /** + * Set the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @param osDiskSizeGb the osDiskSizeGb value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withOsDiskSizeGb(Integer osDiskSizeGb) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withOsDiskSizeGb(osDiskSizeGb); + return this; + } + + /** + * Get the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); + } + + /** + * Set the expirationDate property: The expiration date for VM. + * + * @param expirationDate the expirationDate value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withExpirationDate(OffsetDateTime expirationDate) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withExpirationDate(expirationDate); + return this; + } + + /** + * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + public Boolean allowClaim() { + return this.innerProperties() == null ? null : this.innerProperties().allowClaim(); + } + + /** + * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @param allowClaim the allowClaim value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withAllowClaim(Boolean allowClaim) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withAllowClaim(allowClaim); + return this; + } + + /** + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.innerProperties() == null ? null : this.innerProperties().storageType(); + } + + /** + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @param storageType the storageType value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withStorageType(StorageType storageType) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withStorageType(storageType); + return this; + } + + /** + * Get the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineCreationSource(); + } + + /** + * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); + } + + /** + * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @param environmentId the environmentId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withEnvironmentId(String environmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withEnvironmentId(environmentId); + return this; + } + + /** + * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + public List dataDiskParameters() { + return this.innerProperties() == null ? null : this.innerProperties().dataDiskParameters(); + } + + /** + * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @param dataDiskParameters the dataDiskParameters value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withDataDiskParameters(List dataDiskParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withDataDiskParameters(dataDiskParameters); + return this; + } + + /** + * Get the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + public List scheduleParameters() { + return this.innerProperties() == null ? null : this.innerProperties().scheduleParameters(); + } + + /** + * Set the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters the scheduleParameters value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withScheduleParameters( + List scheduleParameters) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withScheduleParameters(scheduleParameters); + return this; + } + + /** + * Get the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + public String lastKnownPowerState() { + return this.innerProperties() == null ? null : this.innerProperties().lastKnownPowerState(); + } + + /** + * Get the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of fetching + * the document. + * + * @return the canApplyArtifacts value. + */ + public Boolean canApplyArtifacts() { + return this.innerProperties() == null ? null : this.innerProperties().canApplyArtifacts(); + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Get the instanceCount property: The number of virtual machine instances to create. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.innerProperties() == null ? null : this.innerProperties().instanceCount(); + } + + /** + * Set the instanceCount property: The number of virtual machine instances to create. + * + * @param instanceCount the instanceCount value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withInstanceCount(Integer instanceCount) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withInstanceCount(instanceCount); + return this; + } + + /** + * Get the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + public String deploymentStatus() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentStatus(); + } + + /** + * Get the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + public Integer artifactsApplied() { + return this.innerProperties() == null ? null : this.innerProperties().artifactsApplied(); + } + + /** + * Get the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + public Integer totalArtifacts() { + return this.innerProperties() == null ? null : this.innerProperties().totalArtifacts(); + } + + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerProperties() == null ? null : this.innerProperties().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withOffer(String offer) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withOffer(offer); + return this; + } + + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withSku(String sku) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + public String osTypeGalleryImageReferenceOsType() { + return this.innerProperties() == null ? null : this.innerProperties().osTypeGalleryImageReferenceOsType(); + } + + /** + * Set the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @param osTypeGalleryImageReferenceOsType the osTypeGalleryImageReferenceOsType value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withOsTypeGalleryImageReferenceOsType( + String osTypeGalleryImageReferenceOsType) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withOsTypeGalleryImageReferenceOsType(osTypeGalleryImageReferenceOsType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerProperties() == null ? null : this.innerProperties().statuses(); + } + + /** + * Get the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + public String osTypeComputeVmOsType() { + return this.innerProperties() == null ? null : this.innerProperties().osTypeComputeVmOsType(); + } + + /** + * Get the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerProperties() == null ? null : this.innerProperties().vmSize(); + } + + /** + * Get the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.innerProperties() == null ? null : this.innerProperties().networkInterfaceId(); + } + + /** + * Get the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + public String osDiskId() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskId(); + } + + /** + * Get the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + public List dataDiskIds() { + return this.innerProperties() == null ? null : this.innerProperties().dataDiskIds(); + } + + /** + * Get the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.innerProperties() == null ? null : this.innerProperties().dataDisks(); + } + + /** + * Get the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkId(); + } + + /** + * Set the virtualNetworkId property: The resource ID of the virtual network. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withVirtualNetworkId(String virtualNetworkId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withVirtualNetworkId(virtualNetworkId); + return this; + } + + /** + * Get the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); + } + + /** + * Set the subnetId property: The resource ID of the sub net. + * + * @param subnetId the subnetId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withSubnetId(String subnetId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withSubnetId(subnetId); + return this; + } + + /** + * Get the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressId(); + } + + /** + * Set the publicIpAddressId property: The resource ID of the public IP address. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withPublicIpAddressId(String publicIpAddressId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withPublicIpAddressId(publicIpAddressId); + return this; + } + + /** + * Get the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); + } + + /** + * Set the publicIpAddress property: The public IP address. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withPublicIpAddress(String publicIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: The private IP address. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withPrivateIpAddress(String privateIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.innerProperties() == null ? null : this.innerProperties().dnsName(); + } + + /** + * Set the dnsName property: The DNS name. + * + * @param dnsName the dnsName value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withDnsName(String dnsName) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withDnsName(dnsName); + return this; + } + + /** + * Get the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + public String rdpAuthority() { + return this.innerProperties() == null ? null : this.innerProperties().rdpAuthority(); + } + + /** + * Set the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @param rdpAuthority the rdpAuthority value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withRdpAuthority(String rdpAuthority) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withRdpAuthority(rdpAuthority); + return this; + } + + /** + * Get the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + public String sshAuthority() { + return this.innerProperties() == null ? null : this.innerProperties().sshAuthority(); + } + + /** + * Set the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @param sshAuthority the sshAuthority value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withSshAuthority(String sshAuthority) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withSshAuthority(sshAuthority); + return this; + } + + /** + * Get the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().inboundNatRules(); + } + + /** + * Set the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. + * @return the LabVirtualMachineCreationParameterInner object itself. + */ + public LabVirtualMachineCreationParameterInner withInboundNatRules(List inboundNatRules) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachineCreationParameterPropertiesInner(); + } + this.innerProperties().withInboundNatRules(inboundNatRules); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.innerProperties() == null ? null : this.innerProperties().systemData(); + } + + /** + * Get the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerProperties() == null ? null : this.innerProperties().systemDataPropertiesSystemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerProperties() == null ? null : this.innerProperties().taskType(); + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); + } + + /** + * Get the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerProperties() == null + ? null + : this.innerProperties().createdDateApplicableScheduleCreatedDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); + } + + /** + * Get the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerProperties() == null + ? null + : this.innerProperties().provisioningStateApplicableScheduleProvisioningState(); + } + + /** + * Get the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerProperties() == null + ? null + : this.innerProperties().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerProperties() == null ? null : this.innerProperties().weekdays(); + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerProperties() == null ? null : this.innerProperties().time(); + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerProperties() == null ? null : this.innerProperties().minute(); + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().statusNotificationSettingsStatus(); + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().timeInMinutes(); + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String locationPropertiesLocation() { + return this.innerProperties() == null ? null : this.innerProperties().location(); + } + + /** + * Get the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.innerProperties() == null ? null : this.innerProperties().tagsPropertiesTags(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LabVirtualMachineCreationParameterInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterPropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterPropertiesInner.java new file mode 100644 index 000000000000..d1dafe6edc10 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineCreationParameterPropertiesInner.java @@ -0,0 +1,1997 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties for virtual machine creation. */ +@Fluent +public final class LabVirtualMachineCreationParameterPropertiesInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(LabVirtualMachineCreationParameterPropertiesInner.class); + + /* + * The number of virtual machine instances to create. + */ + @JsonProperty(value = "bulkCreationParameters") + private BulkCreationParameters innerBulkCreationParameters; + + /* + * The notes of the virtual machine. + */ + @JsonProperty(value = "notes") + private String notes; + + /* + * The object identifier of the owner of the virtual machine. + */ + @JsonProperty(value = "ownerObjectId") + private String ownerObjectId; + + /* + * The user principal name of the virtual machine owner. + */ + @JsonProperty(value = "ownerUserPrincipalName") + private String ownerUserPrincipalName; + + /* + * The object identifier of the creator of the virtual machine. + */ + @JsonProperty(value = "createdByUserId", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUserId; + + /* + * The email address of creator of the virtual machine. + */ + @JsonProperty(value = "createdByUser", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUser; + + /* + * The creation date of the virtual machine. + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * The resource identifier (Microsoft.Compute) of the virtual machine. + */ + @JsonProperty(value = "computeId", access = JsonProperty.Access.WRITE_ONLY) + private String computeId; + + /* + * The custom image identifier of the virtual machine. + */ + @JsonProperty(value = "customImageId") + private String customImageId; + + /* + * The shared gallery image version resource identifier of the virtual + * machine. + */ + @JsonProperty(value = "galleryImageVersionId") + private String galleryImageVersionId; + + /* + * The shared image resource identifier of the virtual machine. + */ + @JsonProperty(value = "sharedImageId") + private String sharedImageId; + + /* + * The shared image version for the specified shared image Id. Will use + * latest if not specified. + */ + @JsonProperty(value = "sharedImageVersion") + private String sharedImageVersion; + + /* + * The OS type of the virtual machine. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * The size of the virtual machine. + */ + @JsonProperty(value = "size") + private String size; + + /* + * The user name of the virtual machine. + */ + @JsonProperty(value = "userName") + private String username; + + /* + * The password of the virtual machine administrator. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The SSH key of the virtual machine administrator. + */ + @JsonProperty(value = "sshKey") + private String sshKey; + + /* + * Indicates whether this virtual machine uses an SSH key for + * authentication. + */ + @JsonProperty(value = "isAuthenticationWithSshKey") + private Boolean isAuthenticationWithSshKey; + + /* + * The fully-qualified domain name of the virtual machine. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The lab subnet name of the virtual machine. + */ + @JsonProperty(value = "labSubnetName") + private String labSubnetName; + + /* + * The lab virtual network identifier of the virtual machine. + */ + @JsonProperty(value = "labVirtualNetworkId") + private String labVirtualNetworkId; + + /* + * Indicates whether the virtual machine is to be created without a public + * IP address. + */ + @JsonProperty(value = "disallowPublicIpAddress") + private Boolean disallowPublicIpAddress; + + /* + * The artifacts to be installed on the virtual machine. + */ + @JsonProperty(value = "artifacts") + private List artifacts; + + /* + * The artifact deployment status for the virtual machine. + */ + @JsonProperty(value = "artifactDeploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private ArtifactDeploymentStatusProperties innerArtifactDeploymentStatus; + + /* + * The Microsoft Azure Marketplace image reference of the virtual machine. + */ + @JsonProperty(value = "galleryImageReference") + private GalleryImageReference innerGalleryImageReference; + + /* + * The id of the plan associated with the virtual machine image + */ + @JsonProperty(value = "planId") + private String planId; + + /* + * Specifies the size of an empty data disk in gigabytes. This element can + * be used to overwrite the size of the disk in a virtual machine image. + */ + @JsonProperty(value = "osDiskSizeGb") + private Integer osDiskSizeGb; + + /* + * The compute virtual machine properties. + */ + @JsonProperty(value = "computeVm", access = JsonProperty.Access.WRITE_ONLY) + private ComputeVmProperties innerComputeVm; + + /* + * The network interface properties. + */ + @JsonProperty(value = "networkInterface") + private NetworkInterfaceProperties innerNetworkInterface; + + /* + * The applicable schedule for the virtual machine. + */ + @JsonProperty(value = "applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) + private ApplicableScheduleInner innerApplicableSchedule; + + /* + * The expiration date for VM. + */ + @JsonProperty(value = "expirationDate") + private OffsetDateTime expirationDate; + + /* + * Indicates whether another user can take ownership of the virtual machine + */ + @JsonProperty(value = "allowClaim") + private Boolean allowClaim; + + /* + * Storage type to use for virtual machine (i.e. Standard, Premium, + * StandardSSD). + */ + @JsonProperty(value = "storageType") + private StorageType storageType; + + /* + * Tells source of creation of lab virtual machine. Output property only. + */ + @JsonProperty(value = "virtualMachineCreationSource", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineCreationSource virtualMachineCreationSource; + + /* + * The resource ID of the environment that contains this virtual machine, + * if any. + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * New or existing data disks to attach to the virtual machine after + * creation + */ + @JsonProperty(value = "dataDiskParameters") + private List dataDiskParameters; + + /* + * Virtual Machine schedules to be created + */ + @JsonProperty(value = "scheduleParameters") + private List scheduleParameters; + + /* + * Last known compute power state captured in DTL + */ + @JsonProperty(value = "lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) + private String lastKnownPowerState; + + /* + * Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. + */ + @JsonProperty(value = "canApplyArtifacts", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canApplyArtifacts; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the innerBulkCreationParameters property: The number of virtual machine instances to create. + * + * @return the innerBulkCreationParameters value. + */ + private BulkCreationParameters innerBulkCreationParameters() { + return this.innerBulkCreationParameters; + } + + /** + * Get the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes of the virtual machine. + * + * @param notes the notes value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + public String ownerObjectId() { + return this.ownerObjectId; + } + + /** + * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @param ownerObjectId the ownerObjectId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withOwnerObjectId(String ownerObjectId) { + this.ownerObjectId = ownerObjectId; + return this; + } + + /** + * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + public String ownerUserPrincipalName() { + return this.ownerUserPrincipalName; + } + + /** + * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { + this.ownerUserPrincipalName = ownerUserPrincipalName; + return this; + } + + /** + * Get the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + public String createdByUserId() { + return this.createdByUserId; + } + + /** + * Get the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.createdByUser; + } + + /** + * Get the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The creation date of the virtual machine. + * + * @param createdDate the createdDate value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + public String computeId() { + return this.computeId; + } + + /** + * Get the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + public String customImageId() { + return this.customImageId; + } + + /** + * Set the customImageId property: The custom image identifier of the virtual machine. + * + * @param customImageId the customImageId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withCustomImageId(String customImageId) { + this.customImageId = customImageId; + return this; + } + + /** + * Get the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + public String galleryImageVersionId() { + return this.galleryImageVersionId; + } + + /** + * Set the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @param galleryImageVersionId the galleryImageVersionId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withGalleryImageVersionId(String galleryImageVersionId) { + this.galleryImageVersionId = galleryImageVersionId; + return this; + } + + /** + * Get the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + public String sharedImageId() { + return this.sharedImageId; + } + + /** + * Set the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @param sharedImageId the sharedImageId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withSharedImageId(String sharedImageId) { + this.sharedImageId = sharedImageId; + return this; + } + + /** + * Get the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + public String sharedImageVersion() { + return this.sharedImageVersion; + } + + /** + * Set the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @param sharedImageVersion the sharedImageVersion value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withSharedImageVersion(String sharedImageVersion) { + this.sharedImageVersion = sharedImageVersion; + return this; + } + + /** + * Get the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the size property: The size of the virtual machine. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The size of the virtual machine. + * + * @param size the size value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the username property: The user name of the virtual machine. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The user name of the virtual machine. + * + * @param username the username value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the virtual machine administrator. + * + * @param password the password value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + public String sshKey() { + return this.sshKey; + } + + /** + * Set the sshKey property: The SSH key of the virtual machine administrator. + * + * @param sshKey the sshKey value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withSshKey(String sshKey) { + this.sshKey = sshKey; + return this; + } + + /** + * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + public Boolean isAuthenticationWithSshKey() { + return this.isAuthenticationWithSshKey; + } + + /** + * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withIsAuthenticationWithSshKey( + Boolean isAuthenticationWithSshKey) { + this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; + return this; + } + + /** + * Get the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + public String labSubnetName() { + return this.labSubnetName; + } + + /** + * Set the labSubnetName property: The lab subnet name of the virtual machine. + * + * @param labSubnetName the labSubnetName value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withLabSubnetName(String labSubnetName) { + this.labSubnetName = labSubnetName; + return this; + } + + /** + * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + public String labVirtualNetworkId() { + return this.labVirtualNetworkId; + } + + /** + * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @param labVirtualNetworkId the labVirtualNetworkId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withLabVirtualNetworkId(String labVirtualNetworkId) { + this.labVirtualNetworkId = labVirtualNetworkId; + return this; + } + + /** + * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @return the disallowPublicIpAddress value. + */ + public Boolean disallowPublicIpAddress() { + return this.disallowPublicIpAddress; + } + + /** + * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withDisallowPublicIpAddress( + Boolean disallowPublicIpAddress) { + this.disallowPublicIpAddress = disallowPublicIpAddress; + return this; + } + + /** + * Get the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: The artifacts to be installed on the virtual machine. + * + * @param artifacts the artifacts value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the innerArtifactDeploymentStatus property: The artifact deployment status for the virtual machine. + * + * @return the innerArtifactDeploymentStatus value. + */ + private ArtifactDeploymentStatusProperties innerArtifactDeploymentStatus() { + return this.innerArtifactDeploymentStatus; + } + + /** + * Get the innerGalleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual + * machine. + * + * @return the innerGalleryImageReference value. + */ + private GalleryImageReference innerGalleryImageReference() { + return this.innerGalleryImageReference; + } + + /** + * Get the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId the planId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + public Integer osDiskSizeGb() { + return this.osDiskSizeGb; + } + + /** + * Set the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @param osDiskSizeGb the osDiskSizeGb value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withOsDiskSizeGb(Integer osDiskSizeGb) { + this.osDiskSizeGb = osDiskSizeGb; + return this; + } + + /** + * Get the innerComputeVm property: The compute virtual machine properties. + * + * @return the innerComputeVm value. + */ + private ComputeVmProperties innerComputeVm() { + return this.innerComputeVm; + } + + /** + * Get the innerNetworkInterface property: The network interface properties. + * + * @return the innerNetworkInterface value. + */ + private NetworkInterfaceProperties innerNetworkInterface() { + return this.innerNetworkInterface; + } + + /** + * Get the innerApplicableSchedule property: The applicable schedule for the virtual machine. + * + * @return the innerApplicableSchedule value. + */ + private ApplicableScheduleInner innerApplicableSchedule() { + return this.innerApplicableSchedule; + } + + /** + * Get the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: The expiration date for VM. + * + * @param expirationDate the expirationDate value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + public Boolean allowClaim() { + return this.allowClaim; + } + + /** + * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @param allowClaim the allowClaim value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withAllowClaim(Boolean allowClaim) { + this.allowClaim = allowClaim; + return this; + } + + /** + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @param storageType the storageType value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withStorageType(StorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.virtualMachineCreationSource; + } + + /** + * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @param environmentId the environmentId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + public List dataDiskParameters() { + return this.dataDiskParameters; + } + + /** + * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @param dataDiskParameters the dataDiskParameters value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withDataDiskParameters( + List dataDiskParameters) { + this.dataDiskParameters = dataDiskParameters; + return this; + } + + /** + * Get the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + public List scheduleParameters() { + return this.scheduleParameters; + } + + /** + * Set the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters the scheduleParameters value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withScheduleParameters( + List scheduleParameters) { + this.scheduleParameters = scheduleParameters; + return this; + } + + /** + * Get the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + public String lastKnownPowerState() { + return this.lastKnownPowerState; + } + + /** + * Get the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of fetching + * the document. + * + * @return the canApplyArtifacts value. + */ + public Boolean canApplyArtifacts() { + return this.canApplyArtifacts; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the instanceCount property: The number of virtual machine instances to create. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.innerBulkCreationParameters() == null ? null : this.innerBulkCreationParameters().instanceCount(); + } + + /** + * Set the instanceCount property: The number of virtual machine instances to create. + * + * @param instanceCount the instanceCount value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withInstanceCount(Integer instanceCount) { + if (this.innerBulkCreationParameters() == null) { + this.innerBulkCreationParameters = new BulkCreationParameters(); + } + this.innerBulkCreationParameters().withInstanceCount(instanceCount); + return this; + } + + /** + * Get the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + public String deploymentStatus() { + return this.innerArtifactDeploymentStatus() == null + ? null + : this.innerArtifactDeploymentStatus().deploymentStatus(); + } + + /** + * Set the deploymentStatus property: The deployment status of the artifact. + * + * @param deploymentStatus the deploymentStatus value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withDeploymentStatus(String deploymentStatus) { + if (this.innerArtifactDeploymentStatus() == null) { + this.innerArtifactDeploymentStatus = new ArtifactDeploymentStatusProperties(); + } + this.innerArtifactDeploymentStatus().withDeploymentStatus(deploymentStatus); + return this; + } + + /** + * Get the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + public Integer artifactsApplied() { + return this.innerArtifactDeploymentStatus() == null + ? null + : this.innerArtifactDeploymentStatus().artifactsApplied(); + } + + /** + * Set the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @param artifactsApplied the artifactsApplied value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withArtifactsApplied(Integer artifactsApplied) { + if (this.innerArtifactDeploymentStatus() == null) { + this.innerArtifactDeploymentStatus = new ArtifactDeploymentStatusProperties(); + } + this.innerArtifactDeploymentStatus().withArtifactsApplied(artifactsApplied); + return this; + } + + /** + * Get the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + public Integer totalArtifacts() { + return this.innerArtifactDeploymentStatus() == null + ? null + : this.innerArtifactDeploymentStatus().totalArtifacts(); + } + + /** + * Set the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @param totalArtifacts the totalArtifacts value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTotalArtifacts(Integer totalArtifacts) { + if (this.innerArtifactDeploymentStatus() == null) { + this.innerArtifactDeploymentStatus = new ArtifactDeploymentStatusProperties(); + } + this.innerArtifactDeploymentStatus().withTotalArtifacts(totalArtifacts); + return this; + } + + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withOffer(String offer) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withOffer(offer); + return this; + } + + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withPublisher(String publisher) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withSku(String sku) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withSku(sku); + return this; + } + + /** + * Get the osType property: The OS type of the gallery image. + * + * @return the osType value. + */ + public String osTypeGalleryImageReferenceOsType() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().osType(); + } + + /** + * Set the osType property: The OS type of the gallery image. + * + * @param osType the osType value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withOsTypeGalleryImageReferenceOsType(String osType) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withOsType(osType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withVersion(String version) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withVersion(version); + return this; + } + + /** + * Get the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().statuses(); + } + + /** + * Set the statuses property: Gets the statuses of the virtual machine. + * + * @param statuses the statuses value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withStatuses(List statuses) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withStatuses(statuses); + return this; + } + + /** + * Get the osType property: Gets the OS type of the virtual machine. + * + * @return the osType value. + */ + public String osTypeComputeVmOsType() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().osType(); + } + + /** + * Set the osType property: Gets the OS type of the virtual machine. + * + * @param osType the osType value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withOsTypeComputeVmOsType(String osType) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withOsType(osType); + return this; + } + + /** + * Get the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().vmSize(); + } + + /** + * Set the vmSize property: Gets the size of the virtual machine. + * + * @param vmSize the vmSize value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withVmSize(String vmSize) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withVmSize(vmSize); + return this; + } + + /** + * Get the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().networkInterfaceId(); + } + + /** + * Set the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @param networkInterfaceId the networkInterfaceId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withNetworkInterfaceId(String networkInterfaceId) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withNetworkInterfaceId(networkInterfaceId); + return this; + } + + /** + * Get the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + public String osDiskId() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().osDiskId(); + } + + /** + * Set the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @param osDiskId the osDiskId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withOsDiskId(String osDiskId) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withOsDiskId(osDiskId); + return this; + } + + /** + * Get the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + public List dataDiskIds() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().dataDiskIds(); + } + + /** + * Set the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @param dataDiskIds the dataDiskIds value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withDataDiskIds(List dataDiskIds) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withDataDiskIds(dataDiskIds); + return this; + } + + /** + * Get the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().dataDisks(); + } + + /** + * Set the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @param dataDisks the dataDisks value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withDataDisks(List dataDisks) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withDataDisks(dataDisks); + return this; + } + + /** + * Get the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().virtualNetworkId(); + } + + /** + * Set the virtualNetworkId property: The resource ID of the virtual network. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withVirtualNetworkId(String virtualNetworkId) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withVirtualNetworkId(virtualNetworkId); + return this; + } + + /** + * Get the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().subnetId(); + } + + /** + * Set the subnetId property: The resource ID of the sub net. + * + * @param subnetId the subnetId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withSubnetId(String subnetId) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withSubnetId(subnetId); + return this; + } + + /** + * Get the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().publicIpAddressId(); + } + + /** + * Set the publicIpAddressId property: The resource ID of the public IP address. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withPublicIpAddressId(String publicIpAddressId) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withPublicIpAddressId(publicIpAddressId); + return this; + } + + /** + * Get the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().publicIpAddress(); + } + + /** + * Set the publicIpAddress property: The public IP address. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withPublicIpAddress(String publicIpAddress) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: The private IP address. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withPrivateIpAddress(String privateIpAddress) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().dnsName(); + } + + /** + * Set the dnsName property: The DNS name. + * + * @param dnsName the dnsName value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withDnsName(String dnsName) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withDnsName(dnsName); + return this; + } + + /** + * Get the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + public String rdpAuthority() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().rdpAuthority(); + } + + /** + * Set the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @param rdpAuthority the rdpAuthority value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withRdpAuthority(String rdpAuthority) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withRdpAuthority(rdpAuthority); + return this; + } + + /** + * Get the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + public String sshAuthority() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().sshAuthority(); + } + + /** + * Set the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @param sshAuthority the sshAuthority value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withSshAuthority(String sshAuthority) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withSshAuthority(sshAuthority); + return this; + } + + /** + * Get the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().inboundNatRules(); + } + + /** + * Set the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withInboundNatRules(List inboundNatRules) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withInboundNatRules(inboundNatRules); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().systemData(); + } + + /** + * Get the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerApplicableSchedule() == null + ? null + : this.innerApplicableSchedule().systemDataPropertiesSystemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().status(); + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withStatus(EnableStatus status) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withStatus(status); + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().taskType(); + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTaskType(String taskType) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTaskType(taskType); + return this; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().timeZoneId(); + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTimeZoneId(String timeZoneId) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().targetResourceId(); + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTargetResourceId(String targetResourceId) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTargetResourceId(targetResourceId); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withWeekdays(List weekdays) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTime(String time) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withMinute(Integer minute) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withMinute(minute); + return this; + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerApplicableSchedule() == null + ? null + : this.innerApplicableSchedule().statusNotificationSettingsStatus(); + } + + /** + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withStatusNotificationSettingsStatus( + EnableStatus statusNotificationSettingsStatus) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTimeInMinutes(Integer timeInMinutes) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withWebhookUrl(String webhookUrl) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withEmailRecipient(String emailRecipient) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withNotificationLocale(String notificationLocale) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String location() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().location(); + } + + /** + * Set the location property: the geo-location where the resource live. + * + * @param location the location value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withLocation(String location) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withLocation(location); + return this; + } + + /** + * Get the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().tagsPropertiesTags(); + } + + /** + * Set the tagsPropertiesTags property: the tags of the resource. + * + * @param tagsPropertiesTags the tagsPropertiesTags value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTagsPropertiesTags( + Map tagsPropertiesTags) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTagsPropertiesTags(tagsPropertiesTags); + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().tags(); + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LabVirtualMachineCreationParameterPropertiesInner object itself. + */ + public LabVirtualMachineCreationParameterPropertiesInner withTags(Map tags) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerBulkCreationParameters() != null) { + innerBulkCreationParameters().validate(); + } + if (artifacts() != null) { + artifacts().forEach(e -> e.validate()); + } + if (innerArtifactDeploymentStatus() != null) { + innerArtifactDeploymentStatus().validate(); + } + if (innerGalleryImageReference() != null) { + innerGalleryImageReference().validate(); + } + if (innerComputeVm() != null) { + innerComputeVm().validate(); + } + if (innerNetworkInterface() != null) { + innerNetworkInterface().validate(); + } + if (innerApplicableSchedule() != null) { + innerApplicableSchedule().validate(); + } + if (dataDiskParameters() != null) { + dataDiskParameters().forEach(e -> e.validate()); + } + if (scheduleParameters() != null) { + scheduleParameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java index 5bad56a004e4..9b7a5ad4f6bb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachineInner.java @@ -5,16 +5,17 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.ArtifactDeploymentStatusProperties; import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; -import com.azure.resourcemanager.devtestlabs.models.ComputeVmProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; -import com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageTypes; import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -23,224 +24,53 @@ import java.util.Map; /** A virtual machine. */ -@JsonFlatten @Fluent -public class LabVirtualMachineInner extends Resource { +public final class LabVirtualMachineInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineInner.class); /* - * The notes of the virtual machine. + * The properties of the resource. */ - @JsonProperty(value = "properties.notes") - private String notes; + @JsonProperty(value = "properties", required = true) + private LabVirtualMachinePropertiesInner innerProperties = new LabVirtualMachinePropertiesInner(); /* - * The object identifier of the owner of the virtual machine. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.ownerObjectId") - private String ownerObjectId; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The user principal name of the virtual machine owner. - */ - @JsonProperty(value = "properties.ownerUserPrincipalName") - private String ownerUserPrincipalName; - - /* - * The object identifier of the creator of the virtual machine. - */ - @JsonProperty(value = "properties.createdByUserId", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUserId; - - /* - * The email address of creator of the virtual machine. - */ - @JsonProperty(value = "properties.createdByUser", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUser; - - /* - * The creation date of the virtual machine. - */ - @JsonProperty(value = "properties.createdDate") - private OffsetDateTime createdDate; - - /* - * The resource identifier (Microsoft.Compute) of the virtual machine. - */ - @JsonProperty(value = "properties.computeId", access = JsonProperty.Access.WRITE_ONLY) - private String computeId; - - /* - * The custom image identifier of the virtual machine. - */ - @JsonProperty(value = "properties.customImageId") - private String customImageId; - - /* - * The OS type of the virtual machine. - */ - @JsonProperty(value = "properties.osType", access = JsonProperty.Access.WRITE_ONLY) - private String osType; - - /* - * The size of the virtual machine. - */ - @JsonProperty(value = "properties.size") - private String size; - - /* - * The user name of the virtual machine. - */ - @JsonProperty(value = "properties.userName") - private String username; - - /* - * The password of the virtual machine administrator. - */ - @JsonProperty(value = "properties.password") - private String password; - - /* - * The SSH key of the virtual machine administrator. - */ - @JsonProperty(value = "properties.sshKey") - private String sshKey; - - /* - * Indicates whether this virtual machine uses an SSH key for - * authentication. - */ - @JsonProperty(value = "properties.isAuthenticationWithSshKey") - private Boolean isAuthenticationWithSshKey; - - /* - * The fully-qualified domain name of the virtual machine. - */ - @JsonProperty(value = "properties.fqdn", access = JsonProperty.Access.WRITE_ONLY) - private String fqdn; - - /* - * The lab subnet name of the virtual machine. - */ - @JsonProperty(value = "properties.labSubnetName") - private String labSubnetName; - - /* - * The lab virtual network identifier of the virtual machine. - */ - @JsonProperty(value = "properties.labVirtualNetworkId") - private String labVirtualNetworkId; - - /* - * Indicates whether the virtual machine is to be created without a public - * IP address. - */ - @JsonProperty(value = "properties.disallowPublicIpAddress") - private Boolean disallowPublicIpAddress; - - /* - * The artifacts to be installed on the virtual machine. - */ - @JsonProperty(value = "properties.artifacts") - private List artifacts; - - /* - * The artifact deployment status for the virtual machine. - */ - @JsonProperty(value = "properties.artifactDeploymentStatus", access = JsonProperty.Access.WRITE_ONLY) - private ArtifactDeploymentStatusProperties artifactDeploymentStatus; - - /* - * The Microsoft Azure Marketplace image reference of the virtual machine. - */ - @JsonProperty(value = "properties.galleryImageReference") - private GalleryImageReference galleryImageReference; - - /* - * The id of the plan associated with the virtual machine image - */ - @JsonProperty(value = "properties.planId") - private String planId; - - /* - * The compute virtual machine properties. - */ - @JsonProperty(value = "properties.computeVm", access = JsonProperty.Access.WRITE_ONLY) - private ComputeVmProperties computeVm; - - /* - * The network interface properties. - */ - @JsonProperty(value = "properties.networkInterface") - private NetworkInterfaceProperties networkInterface; - - /* - * The applicable schedule for the virtual machine. - */ - @JsonProperty(value = "properties.applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) - private ApplicableScheduleInner applicableSchedule; - - /* - * The expiration date for VM. - */ - @JsonProperty(value = "properties.expirationDate") - private OffsetDateTime expirationDate; - - /* - * Indicates whether another user can take ownership of the virtual machine - */ - @JsonProperty(value = "properties.allowClaim") - private Boolean allowClaim; - - /* - * Storage type to use for virtual machine (i.e. Standard, Premium). - */ - @JsonProperty(value = "properties.storageType") - private String storageType; - - /* - * Tells source of creation of lab virtual machine. Output property only. - */ - @JsonProperty(value = "properties.virtualMachineCreationSource", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineCreationSource virtualMachineCreationSource; - - /* - * The resource ID of the environment that contains this virtual machine, - * if any. - */ - @JsonProperty(value = "properties.environmentId") - private String environmentId; - - /* - * New or existing data disks to attach to the virtual machine after - * creation - */ - @JsonProperty(value = "properties.dataDiskParameters") - private List dataDiskParameters; - - /* - * Virtual Machine schedules to be created + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.scheduleParameters") - private List scheduleParameters; + private LabVirtualMachinePropertiesInner innerProperties() { + return this.innerProperties; + } - /* - * Last known compute power state captured in DTL + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) - private String lastKnownPowerState; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public LabVirtualMachineInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public LabVirtualMachineInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the notes property: The notes of the virtual machine. @@ -248,7 +78,7 @@ public class LabVirtualMachineInner extends Resource { * @return the notes value. */ public String notes() { - return this.notes; + return this.innerProperties() == null ? null : this.innerProperties().notes(); } /** @@ -258,7 +88,10 @@ public String notes() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withNotes(String notes) { - this.notes = notes; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withNotes(notes); return this; } @@ -268,7 +101,7 @@ public LabVirtualMachineInner withNotes(String notes) { * @return the ownerObjectId value. */ public String ownerObjectId() { - return this.ownerObjectId; + return this.innerProperties() == null ? null : this.innerProperties().ownerObjectId(); } /** @@ -278,7 +111,10 @@ public String ownerObjectId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withOwnerObjectId(String ownerObjectId) { - this.ownerObjectId = ownerObjectId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withOwnerObjectId(ownerObjectId); return this; } @@ -288,7 +124,7 @@ public LabVirtualMachineInner withOwnerObjectId(String ownerObjectId) { * @return the ownerUserPrincipalName value. */ public String ownerUserPrincipalName() { - return this.ownerUserPrincipalName; + return this.innerProperties() == null ? null : this.innerProperties().ownerUserPrincipalName(); } /** @@ -298,7 +134,10 @@ public String ownerUserPrincipalName() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { - this.ownerUserPrincipalName = ownerUserPrincipalName; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withOwnerUserPrincipalName(ownerUserPrincipalName); return this; } @@ -308,7 +147,7 @@ public LabVirtualMachineInner withOwnerUserPrincipalName(String ownerUserPrincip * @return the createdByUserId value. */ public String createdByUserId() { - return this.createdByUserId; + return this.innerProperties() == null ? null : this.innerProperties().createdByUserId(); } /** @@ -317,7 +156,7 @@ public String createdByUserId() { * @return the createdByUser value. */ public String createdByUser() { - return this.createdByUser; + return this.innerProperties() == null ? null : this.innerProperties().createdByUser(); } /** @@ -326,7 +165,7 @@ public String createdByUser() { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -336,7 +175,10 @@ public OffsetDateTime createdDate() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withCreatedDate(createdDate); return this; } @@ -346,7 +188,7 @@ public LabVirtualMachineInner withCreatedDate(OffsetDateTime createdDate) { * @return the computeId value. */ public String computeId() { - return this.computeId; + return this.innerProperties() == null ? null : this.innerProperties().computeId(); } /** @@ -355,7 +197,7 @@ public String computeId() { * @return the customImageId value. */ public String customImageId() { - return this.customImageId; + return this.innerProperties() == null ? null : this.innerProperties().customImageId(); } /** @@ -365,7 +207,83 @@ public String customImageId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withCustomImageId(String customImageId) { - this.customImageId = customImageId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withCustomImageId(customImageId); + return this; + } + + /** + * Get the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + public String galleryImageVersionId() { + return this.innerProperties() == null ? null : this.innerProperties().galleryImageVersionId(); + } + + /** + * Set the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @param galleryImageVersionId the galleryImageVersionId value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withGalleryImageVersionId(String galleryImageVersionId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withGalleryImageVersionId(galleryImageVersionId); + return this; + } + + /** + * Get the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + public String sharedImageId() { + return this.innerProperties() == null ? null : this.innerProperties().sharedImageId(); + } + + /** + * Set the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @param sharedImageId the sharedImageId value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withSharedImageId(String sharedImageId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSharedImageId(sharedImageId); + return this; + } + + /** + * Get the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + public String sharedImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().sharedImageVersion(); + } + + /** + * Set the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @param sharedImageVersion the sharedImageVersion value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withSharedImageVersion(String sharedImageVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSharedImageVersion(sharedImageVersion); return this; } @@ -375,7 +293,7 @@ public LabVirtualMachineInner withCustomImageId(String customImageId) { * @return the osType value. */ public String osType() { - return this.osType; + return this.innerProperties() == null ? null : this.innerProperties().osType(); } /** @@ -384,7 +302,7 @@ public String osType() { * @return the size value. */ public String size() { - return this.size; + return this.innerProperties() == null ? null : this.innerProperties().size(); } /** @@ -394,7 +312,10 @@ public String size() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withSize(String size) { - this.size = size; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSize(size); return this; } @@ -404,7 +325,7 @@ public LabVirtualMachineInner withSize(String size) { * @return the username value. */ public String username() { - return this.username; + return this.innerProperties() == null ? null : this.innerProperties().username(); } /** @@ -414,7 +335,10 @@ public String username() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withUsername(String username) { - this.username = username; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withUsername(username); return this; } @@ -424,7 +348,7 @@ public LabVirtualMachineInner withUsername(String username) { * @return the password value. */ public String password() { - return this.password; + return this.innerProperties() == null ? null : this.innerProperties().password(); } /** @@ -434,7 +358,10 @@ public String password() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withPassword(String password) { - this.password = password; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withPassword(password); return this; } @@ -444,7 +371,7 @@ public LabVirtualMachineInner withPassword(String password) { * @return the sshKey value. */ public String sshKey() { - return this.sshKey; + return this.innerProperties() == null ? null : this.innerProperties().sshKey(); } /** @@ -454,7 +381,10 @@ public String sshKey() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withSshKey(String sshKey) { - this.sshKey = sshKey; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSshKey(sshKey); return this; } @@ -465,7 +395,7 @@ public LabVirtualMachineInner withSshKey(String sshKey) { * @return the isAuthenticationWithSshKey value. */ public Boolean isAuthenticationWithSshKey() { - return this.isAuthenticationWithSshKey; + return this.innerProperties() == null ? null : this.innerProperties().isAuthenticationWithSshKey(); } /** @@ -476,7 +406,10 @@ public Boolean isAuthenticationWithSshKey() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { - this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withIsAuthenticationWithSshKey(isAuthenticationWithSshKey); return this; } @@ -486,7 +419,7 @@ public LabVirtualMachineInner withIsAuthenticationWithSshKey(Boolean isAuthentic * @return the fqdn value. */ public String fqdn() { - return this.fqdn; + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); } /** @@ -495,7 +428,7 @@ public String fqdn() { * @return the labSubnetName value. */ public String labSubnetName() { - return this.labSubnetName; + return this.innerProperties() == null ? null : this.innerProperties().labSubnetName(); } /** @@ -505,7 +438,10 @@ public String labSubnetName() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withLabSubnetName(String labSubnetName) { - this.labSubnetName = labSubnetName; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withLabSubnetName(labSubnetName); return this; } @@ -515,7 +451,7 @@ public LabVirtualMachineInner withLabSubnetName(String labSubnetName) { * @return the labVirtualNetworkId value. */ public String labVirtualNetworkId() { - return this.labVirtualNetworkId; + return this.innerProperties() == null ? null : this.innerProperties().labVirtualNetworkId(); } /** @@ -525,7 +461,10 @@ public String labVirtualNetworkId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withLabVirtualNetworkId(String labVirtualNetworkId) { - this.labVirtualNetworkId = labVirtualNetworkId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withLabVirtualNetworkId(labVirtualNetworkId); return this; } @@ -536,7 +475,7 @@ public LabVirtualMachineInner withLabVirtualNetworkId(String labVirtualNetworkId * @return the disallowPublicIpAddress value. */ public Boolean disallowPublicIpAddress() { - return this.disallowPublicIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().disallowPublicIpAddress(); } /** @@ -547,7 +486,10 @@ public Boolean disallowPublicIpAddress() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { - this.disallowPublicIpAddress = disallowPublicIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withDisallowPublicIpAddress(disallowPublicIpAddress); return this; } @@ -557,7 +499,7 @@ public LabVirtualMachineInner withDisallowPublicIpAddress(Boolean disallowPublic * @return the artifacts value. */ public List artifacts() { - return this.artifacts; + return this.innerProperties() == null ? null : this.innerProperties().artifacts(); } /** @@ -567,36 +509,10 @@ public List artifacts() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withArtifacts(List artifacts) { - this.artifacts = artifacts; - return this; - } - - /** - * Get the artifactDeploymentStatus property: The artifact deployment status for the virtual machine. - * - * @return the artifactDeploymentStatus value. - */ - public ArtifactDeploymentStatusProperties artifactDeploymentStatus() { - return this.artifactDeploymentStatus; - } - - /** - * Get the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. - * - * @return the galleryImageReference value. - */ - public GalleryImageReference galleryImageReference() { - return this.galleryImageReference; - } - - /** - * Set the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. - * - * @param galleryImageReference the galleryImageReference value to set. - * @return the LabVirtualMachineInner object itself. - */ - public LabVirtualMachineInner withGalleryImageReference(GalleryImageReference galleryImageReference) { - this.galleryImageReference = galleryImageReference; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withArtifacts(artifacts); return this; } @@ -606,7 +522,7 @@ public LabVirtualMachineInner withGalleryImageReference(GalleryImageReference ga * @return the planId value. */ public String planId() { - return this.planId; + return this.innerProperties() == null ? null : this.innerProperties().planId(); } /** @@ -616,55 +532,45 @@ public String planId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withPlanId(String planId) { - this.planId = planId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withPlanId(planId); return this; } /** - * Get the computeVm property: The compute virtual machine properties. + * Get the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. * - * @return the computeVm value. + * @return the osDiskSizeGb value. */ - public ComputeVmProperties computeVm() { - return this.computeVm; + public Integer osDiskSizeGb() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskSizeGb(); } /** - * Get the networkInterface property: The network interface properties. + * Set the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. * - * @return the networkInterface value. - */ - public NetworkInterfaceProperties networkInterface() { - return this.networkInterface; - } - - /** - * Set the networkInterface property: The network interface properties. - * - * @param networkInterface the networkInterface value to set. + * @param osDiskSizeGb the osDiskSizeGb value to set. * @return the LabVirtualMachineInner object itself. */ - public LabVirtualMachineInner withNetworkInterface(NetworkInterfaceProperties networkInterface) { - this.networkInterface = networkInterface; + public LabVirtualMachineInner withOsDiskSizeGb(Integer osDiskSizeGb) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withOsDiskSizeGb(osDiskSizeGb); return this; } - /** - * Get the applicableSchedule property: The applicable schedule for the virtual machine. - * - * @return the applicableSchedule value. - */ - public ApplicableScheduleInner applicableSchedule() { - return this.applicableSchedule; - } - /** * Get the expirationDate property: The expiration date for VM. * * @return the expirationDate value. */ public OffsetDateTime expirationDate() { - return this.expirationDate; + return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); } /** @@ -674,7 +580,10 @@ public OffsetDateTime expirationDate() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withExpirationDate(OffsetDateTime expirationDate) { - this.expirationDate = expirationDate; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withExpirationDate(expirationDate); return this; } @@ -684,7 +593,7 @@ public LabVirtualMachineInner withExpirationDate(OffsetDateTime expirationDate) * @return the allowClaim value. */ public Boolean allowClaim() { - return this.allowClaim; + return this.innerProperties() == null ? null : this.innerProperties().allowClaim(); } /** @@ -694,27 +603,33 @@ public Boolean allowClaim() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withAllowClaim(Boolean allowClaim) { - this.allowClaim = allowClaim; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withAllowClaim(allowClaim); return this; } /** - * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). * * @return the storageType value. */ - public String storageType() { - return this.storageType; + public StorageTypes storageType() { + return this.innerProperties() == null ? null : this.innerProperties().storageType(); } /** - * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). * * @param storageType the storageType value to set. * @return the LabVirtualMachineInner object itself. */ - public LabVirtualMachineInner withStorageType(String storageType) { - this.storageType = storageType; + public LabVirtualMachineInner withStorageType(StorageTypes storageType) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withStorageType(storageType); return this; } @@ -725,7 +640,7 @@ public LabVirtualMachineInner withStorageType(String storageType) { * @return the virtualMachineCreationSource value. */ public VirtualMachineCreationSource virtualMachineCreationSource() { - return this.virtualMachineCreationSource; + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineCreationSource(); } /** @@ -734,7 +649,7 @@ public VirtualMachineCreationSource virtualMachineCreationSource() { * @return the environmentId value. */ public String environmentId() { - return this.environmentId; + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); } /** @@ -744,7 +659,10 @@ public String environmentId() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withEnvironmentId(String environmentId) { - this.environmentId = environmentId; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withEnvironmentId(environmentId); return this; } @@ -754,7 +672,7 @@ public LabVirtualMachineInner withEnvironmentId(String environmentId) { * @return the dataDiskParameters value. */ public List dataDiskParameters() { - return this.dataDiskParameters; + return this.innerProperties() == null ? null : this.innerProperties().dataDiskParameters(); } /** @@ -764,7 +682,10 @@ public List dataDiskParameters() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withDataDiskParameters(List dataDiskParameters) { - this.dataDiskParameters = dataDiskParameters; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withDataDiskParameters(dataDiskParameters); return this; } @@ -774,7 +695,7 @@ public LabVirtualMachineInner withDataDiskParameters(List da * @return the scheduleParameters value. */ public List scheduleParameters() { - return this.scheduleParameters; + return this.innerProperties() == null ? null : this.innerProperties().scheduleParameters(); } /** @@ -784,7 +705,10 @@ public List scheduleParameters() { * @return the LabVirtualMachineInner object itself. */ public LabVirtualMachineInner withScheduleParameters(List scheduleParameters) { - this.scheduleParameters = scheduleParameters; + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withScheduleParameters(scheduleParameters); return this; } @@ -794,7 +718,17 @@ public LabVirtualMachineInner withScheduleParameters(List tags) { - super.withTags(tags); - return this; + /** + * Get the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + public Integer artifactsApplied() { + return this.innerProperties() == null ? null : this.innerProperties().artifactsApplied(); } /** - * Validates the instance. + * Get the totalArtifacts property: The total count of the artifacts that were tentatively applied. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the totalArtifacts value. */ - public void validate() { - if (artifacts() != null) { - artifacts().forEach(e -> e.validate()); - } - if (artifactDeploymentStatus() != null) { - artifactDeploymentStatus().validate(); - } - if (galleryImageReference() != null) { - galleryImageReference().validate(); - } - if (computeVm() != null) { - computeVm().validate(); - } - if (networkInterface() != null) { - networkInterface().validate(); - } - if (applicableSchedule() != null) { - applicableSchedule().validate(); + public Integer totalArtifacts() { + return this.innerProperties() == null ? null : this.innerProperties().totalArtifacts(); + } + + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerProperties() == null ? null : this.innerProperties().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withOffer(String offer) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); } - if (dataDiskParameters() != null) { - dataDiskParameters().forEach(e -> e.validate()); + this.innerProperties().withOffer(offer); + return this; + } + + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); } - if (scheduleParameters() != null) { - scheduleParameters().forEach(e -> e.validate()); + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withSku(String sku) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + public String osTypeGalleryImageReferenceOsType() { + return this.innerProperties() == null ? null : this.innerProperties().osTypeGalleryImageReferenceOsType(); + } + + /** + * Set the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @param osTypeGalleryImageReferenceOsType the osTypeGalleryImageReferenceOsType value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withOsTypeGalleryImageReferenceOsType(String osTypeGalleryImageReferenceOsType) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withOsTypeGalleryImageReferenceOsType(osTypeGalleryImageReferenceOsType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerProperties() == null ? null : this.innerProperties().statuses(); + } + + /** + * Get the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + public String osTypeComputeVmOsType() { + return this.innerProperties() == null ? null : this.innerProperties().osTypeComputeVmOsType(); + } + + /** + * Get the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerProperties() == null ? null : this.innerProperties().vmSize(); + } + + /** + * Get the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.innerProperties() == null ? null : this.innerProperties().networkInterfaceId(); + } + + /** + * Get the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + public String osDiskId() { + return this.innerProperties() == null ? null : this.innerProperties().osDiskId(); + } + + /** + * Get the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + public List dataDiskIds() { + return this.innerProperties() == null ? null : this.innerProperties().dataDiskIds(); + } + + /** + * Get the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.innerProperties() == null ? null : this.innerProperties().dataDisks(); + } + + /** + * Get the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkId(); + } + + /** + * Set the virtualNetworkId property: The resource ID of the virtual network. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withVirtualNetworkId(String virtualNetworkId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withVirtualNetworkId(virtualNetworkId); + return this; + } + + /** + * Get the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); + } + + /** + * Set the subnetId property: The resource ID of the sub net. + * + * @param subnetId the subnetId value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withSubnetId(String subnetId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSubnetId(subnetId); + return this; + } + + /** + * Get the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressId(); + } + + /** + * Set the publicIpAddressId property: The resource ID of the public IP address. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withPublicIpAddressId(String publicIpAddressId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withPublicIpAddressId(publicIpAddressId); + return this; + } + + /** + * Get the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddress(); + } + + /** + * Set the publicIpAddress property: The public IP address. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withPublicIpAddress(String publicIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: The private IP address. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withPrivateIpAddress(String privateIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.innerProperties() == null ? null : this.innerProperties().dnsName(); + } + + /** + * Set the dnsName property: The DNS name. + * + * @param dnsName the dnsName value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withDnsName(String dnsName) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withDnsName(dnsName); + return this; + } + + /** + * Get the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + public String rdpAuthority() { + return this.innerProperties() == null ? null : this.innerProperties().rdpAuthority(); + } + + /** + * Set the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @param rdpAuthority the rdpAuthority value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withRdpAuthority(String rdpAuthority) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withRdpAuthority(rdpAuthority); + return this; + } + + /** + * Get the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + public String sshAuthority() { + return this.innerProperties() == null ? null : this.innerProperties().sshAuthority(); + } + + /** + * Set the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @param sshAuthority the sshAuthority value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withSshAuthority(String sshAuthority) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withSshAuthority(sshAuthority); + return this; + } + + /** + * Get the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().inboundNatRules(); + } + + /** + * Set the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. + * @return the LabVirtualMachineInner object itself. + */ + public LabVirtualMachineInner withInboundNatRules(List inboundNatRules) { + if (this.innerProperties() == null) { + this.innerProperties = new LabVirtualMachinePropertiesInner(); + } + this.innerProperties().withInboundNatRules(inboundNatRules); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerProperties() == null ? null : this.innerProperties().systemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerProperties() == null ? null : this.innerProperties().taskType(); + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); + } + + /** + * Get the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerProperties() == null + ? null + : this.innerProperties().createdDateApplicableScheduleCreatedDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); + } + + /** + * Get the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerProperties() == null + ? null + : this.innerProperties().provisioningStateApplicableScheduleProvisioningState(); + } + + /** + * Get the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerProperties() == null + ? null + : this.innerProperties().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerProperties() == null ? null : this.innerProperties().weekdays(); + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerProperties() == null ? null : this.innerProperties().time(); + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerProperties() == null ? null : this.innerProperties().minute(); + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().statusNotificationSettingsStatus(); + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().timeInMinutes(); + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String locationPropertiesLocation() { + return this.innerProperties() == null ? null : this.innerProperties().location(); + } + + /** + * Get the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.innerProperties() == null ? null : this.innerProperties().tagsPropertiesTags(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LabVirtualMachineInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java new file mode 100644 index 000000000000..a26b6a0c867e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LabVirtualMachinePropertiesInner.java @@ -0,0 +1,1950 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageTypes; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of a virtual machine. */ +@Fluent +public final class LabVirtualMachinePropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachinePropertiesInner.class); + + /* + * The notes of the virtual machine. + */ + @JsonProperty(value = "notes") + private String notes; + + /* + * The object identifier of the owner of the virtual machine. + */ + @JsonProperty(value = "ownerObjectId") + private String ownerObjectId; + + /* + * The user principal name of the virtual machine owner. + */ + @JsonProperty(value = "ownerUserPrincipalName") + private String ownerUserPrincipalName; + + /* + * The object identifier of the creator of the virtual machine. + */ + @JsonProperty(value = "createdByUserId", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUserId; + + /* + * The email address of creator of the virtual machine. + */ + @JsonProperty(value = "createdByUser", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUser; + + /* + * The creation date of the virtual machine. + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * The resource identifier (Microsoft.Compute) of the virtual machine. + */ + @JsonProperty(value = "computeId", access = JsonProperty.Access.WRITE_ONLY) + private String computeId; + + /* + * The custom image identifier of the virtual machine. + */ + @JsonProperty(value = "customImageId") + private String customImageId; + + /* + * The shared gallery image version resource identifier of the virtual + * machine. + */ + @JsonProperty(value = "galleryImageVersionId") + private String galleryImageVersionId; + + /* + * The shared image resource identifier of the virtual machine. + */ + @JsonProperty(value = "sharedImageId") + private String sharedImageId; + + /* + * The shared image version for the specified shared image Id. Will use + * latest if not specified. + */ + @JsonProperty(value = "sharedImageVersion") + private String sharedImageVersion; + + /* + * The OS type of the virtual machine. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /* + * The size of the virtual machine. + */ + @JsonProperty(value = "size") + private String size; + + /* + * The user name of the virtual machine. + */ + @JsonProperty(value = "userName") + private String username; + + /* + * The password of the virtual machine administrator. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The SSH key of the virtual machine administrator. + */ + @JsonProperty(value = "sshKey") + private String sshKey; + + /* + * Indicates whether this virtual machine uses an SSH key for + * authentication. + */ + @JsonProperty(value = "isAuthenticationWithSshKey") + private Boolean isAuthenticationWithSshKey; + + /* + * The fully-qualified domain name of the virtual machine. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The lab subnet name of the virtual machine. + */ + @JsonProperty(value = "labSubnetName") + private String labSubnetName; + + /* + * The lab virtual network identifier of the virtual machine. + */ + @JsonProperty(value = "labVirtualNetworkId") + private String labVirtualNetworkId; + + /* + * Indicates whether the virtual machine is to be created without a public + * IP address. + */ + @JsonProperty(value = "disallowPublicIpAddress") + private Boolean disallowPublicIpAddress; + + /* + * The artifacts to be installed on the virtual machine. + */ + @JsonProperty(value = "artifacts") + private List artifacts; + + /* + * The artifact deployment status for the virtual machine. + */ + @JsonProperty(value = "artifactDeploymentStatus", access = JsonProperty.Access.WRITE_ONLY) + private ArtifactDeploymentStatusProperties innerArtifactDeploymentStatus; + + /* + * The Microsoft Azure Marketplace image reference of the virtual machine. + */ + @JsonProperty(value = "galleryImageReference") + private GalleryImageReference innerGalleryImageReference; + + /* + * The id of the plan associated with the virtual machine image + */ + @JsonProperty(value = "planId") + private String planId; + + /* + * Specifies the size of an empty data disk in gigabytes. This element can + * be used to overwrite the size of the disk in a virtual machine image. + */ + @JsonProperty(value = "osDiskSizeGb") + private Integer osDiskSizeGb; + + /* + * The compute virtual machine properties. + */ + @JsonProperty(value = "computeVm", access = JsonProperty.Access.WRITE_ONLY) + private ComputeVmProperties innerComputeVm; + + /* + * The network interface properties. + */ + @JsonProperty(value = "networkInterface") + private NetworkInterfaceProperties innerNetworkInterface; + + /* + * The applicable schedule for the virtual machine. + */ + @JsonProperty(value = "applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) + private ApplicableScheduleInner innerApplicableSchedule; + + /* + * The expiration date for VM. + */ + @JsonProperty(value = "expirationDate") + private OffsetDateTime expirationDate; + + /* + * Indicates whether another user can take ownership of the virtual machine + */ + @JsonProperty(value = "allowClaim") + private Boolean allowClaim; + + /* + * Storage type to use for virtual machine (i.e. Standard, Premium, + * StandardSSD). + */ + @JsonProperty(value = "storageType") + private StorageTypes storageType; + + /* + * Tells source of creation of lab virtual machine. Output property only. + */ + @JsonProperty(value = "virtualMachineCreationSource", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineCreationSource virtualMachineCreationSource; + + /* + * The resource ID of the environment that contains this virtual machine, + * if any. + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * New or existing data disks to attach to the virtual machine after + * creation + */ + @JsonProperty(value = "dataDiskParameters") + private List dataDiskParameters; + + /* + * Virtual Machine schedules to be created + */ + @JsonProperty(value = "scheduleParameters") + private List scheduleParameters; + + /* + * Last known compute power state captured in DTL + */ + @JsonProperty(value = "lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) + private String lastKnownPowerState; + + /* + * Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. + */ + @JsonProperty(value = "canApplyArtifacts", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canApplyArtifacts; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: The notes of the virtual machine. + * + * @param notes the notes value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + public String ownerObjectId() { + return this.ownerObjectId; + } + + /** + * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @param ownerObjectId the ownerObjectId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOwnerObjectId(String ownerObjectId) { + this.ownerObjectId = ownerObjectId; + return this; + } + + /** + * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + public String ownerUserPrincipalName() { + return this.ownerUserPrincipalName; + } + + /** + * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOwnerUserPrincipalName(String ownerUserPrincipalName) { + this.ownerUserPrincipalName = ownerUserPrincipalName; + return this; + } + + /** + * Get the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + public String createdByUserId() { + return this.createdByUserId; + } + + /** + * Get the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + public String createdByUser() { + return this.createdByUser; + } + + /** + * Get the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The creation date of the virtual machine. + * + * @param createdDate the createdDate value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + public String computeId() { + return this.computeId; + } + + /** + * Get the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + public String customImageId() { + return this.customImageId; + } + + /** + * Set the customImageId property: The custom image identifier of the virtual machine. + * + * @param customImageId the customImageId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withCustomImageId(String customImageId) { + this.customImageId = customImageId; + return this; + } + + /** + * Get the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + public String galleryImageVersionId() { + return this.galleryImageVersionId; + } + + /** + * Set the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @param galleryImageVersionId the galleryImageVersionId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withGalleryImageVersionId(String galleryImageVersionId) { + this.galleryImageVersionId = galleryImageVersionId; + return this; + } + + /** + * Get the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + public String sharedImageId() { + return this.sharedImageId; + } + + /** + * Set the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @param sharedImageId the sharedImageId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSharedImageId(String sharedImageId) { + this.sharedImageId = sharedImageId; + return this; + } + + /** + * Get the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + public String sharedImageVersion() { + return this.sharedImageVersion; + } + + /** + * Set the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @param sharedImageVersion the sharedImageVersion value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSharedImageVersion(String sharedImageVersion) { + this.sharedImageVersion = sharedImageVersion; + return this; + } + + /** + * Get the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Get the size property: The size of the virtual machine. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The size of the virtual machine. + * + * @param size the size value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the username property: The user name of the virtual machine. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The user name of the virtual machine. + * + * @param username the username value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the virtual machine administrator. + * + * @param password the password value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + public String sshKey() { + return this.sshKey; + } + + /** + * Set the sshKey property: The SSH key of the virtual machine administrator. + * + * @param sshKey the sshKey value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSshKey(String sshKey) { + this.sshKey = sshKey; + return this; + } + + /** + * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + public Boolean isAuthenticationWithSshKey() { + return this.isAuthenticationWithSshKey; + } + + /** + * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { + this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; + return this; + } + + /** + * Get the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + public String labSubnetName() { + return this.labSubnetName; + } + + /** + * Set the labSubnetName property: The lab subnet name of the virtual machine. + * + * @param labSubnetName the labSubnetName value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withLabSubnetName(String labSubnetName) { + this.labSubnetName = labSubnetName; + return this; + } + + /** + * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + public String labVirtualNetworkId() { + return this.labVirtualNetworkId; + } + + /** + * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @param labVirtualNetworkId the labVirtualNetworkId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withLabVirtualNetworkId(String labVirtualNetworkId) { + this.labVirtualNetworkId = labVirtualNetworkId; + return this; + } + + /** + * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @return the disallowPublicIpAddress value. + */ + public Boolean disallowPublicIpAddress() { + return this.disallowPublicIpAddress; + } + + /** + * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public + * IP address. + * + * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { + this.disallowPublicIpAddress = disallowPublicIpAddress; + return this; + } + + /** + * Get the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: The artifacts to be installed on the virtual machine. + * + * @param artifacts the artifacts value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the innerArtifactDeploymentStatus property: The artifact deployment status for the virtual machine. + * + * @return the innerArtifactDeploymentStatus value. + */ + private ArtifactDeploymentStatusProperties innerArtifactDeploymentStatus() { + return this.innerArtifactDeploymentStatus; + } + + /** + * Get the innerGalleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual + * machine. + * + * @return the innerGalleryImageReference value. + */ + private GalleryImageReference innerGalleryImageReference() { + return this.innerGalleryImageReference; + } + + /** + * Get the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId the planId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + public Integer osDiskSizeGb() { + return this.osDiskSizeGb; + } + + /** + * Set the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * + * @param osDiskSizeGb the osDiskSizeGb value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOsDiskSizeGb(Integer osDiskSizeGb) { + this.osDiskSizeGb = osDiskSizeGb; + return this; + } + + /** + * Get the innerComputeVm property: The compute virtual machine properties. + * + * @return the innerComputeVm value. + */ + private ComputeVmProperties innerComputeVm() { + return this.innerComputeVm; + } + + /** + * Get the innerNetworkInterface property: The network interface properties. + * + * @return the innerNetworkInterface value. + */ + private NetworkInterfaceProperties innerNetworkInterface() { + return this.innerNetworkInterface; + } + + /** + * Get the innerApplicableSchedule property: The applicable schedule for the virtual machine. + * + * @return the innerApplicableSchedule value. + */ + private ApplicableScheduleInner innerApplicableSchedule() { + return this.innerApplicableSchedule; + } + + /** + * Get the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: The expiration date for VM. + * + * @param expirationDate the expirationDate value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + public Boolean allowClaim() { + return this.allowClaim; + } + + /** + * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @param allowClaim the allowClaim value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withAllowClaim(Boolean allowClaim) { + this.allowClaim = allowClaim; + return this; + } + + /** + * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + public StorageTypes storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @param storageType the storageType value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withStorageType(StorageTypes storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.virtualMachineCreationSource; + } + + /** + * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @param environmentId the environmentId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + public List dataDiskParameters() { + return this.dataDiskParameters; + } + + /** + * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @param dataDiskParameters the dataDiskParameters value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDataDiskParameters(List dataDiskParameters) { + this.dataDiskParameters = dataDiskParameters; + return this; + } + + /** + * Get the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + public List scheduleParameters() { + return this.scheduleParameters; + } + + /** + * Set the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters the scheduleParameters value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withScheduleParameters(List scheduleParameters) { + this.scheduleParameters = scheduleParameters; + return this; + } + + /** + * Get the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + public String lastKnownPowerState() { + return this.lastKnownPowerState; + } + + /** + * Get the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of fetching + * the document. + * + * @return the canApplyArtifacts value. + */ + public Boolean canApplyArtifacts() { + return this.canApplyArtifacts; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + public String deploymentStatus() { + return this.innerArtifactDeploymentStatus() == null + ? null + : this.innerArtifactDeploymentStatus().deploymentStatus(); + } + + /** + * Set the deploymentStatus property: The deployment status of the artifact. + * + * @param deploymentStatus the deploymentStatus value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDeploymentStatus(String deploymentStatus) { + if (this.innerArtifactDeploymentStatus() == null) { + this.innerArtifactDeploymentStatus = new ArtifactDeploymentStatusProperties(); + } + this.innerArtifactDeploymentStatus().withDeploymentStatus(deploymentStatus); + return this; + } + + /** + * Get the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + public Integer artifactsApplied() { + return this.innerArtifactDeploymentStatus() == null + ? null + : this.innerArtifactDeploymentStatus().artifactsApplied(); + } + + /** + * Set the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @param artifactsApplied the artifactsApplied value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withArtifactsApplied(Integer artifactsApplied) { + if (this.innerArtifactDeploymentStatus() == null) { + this.innerArtifactDeploymentStatus = new ArtifactDeploymentStatusProperties(); + } + this.innerArtifactDeploymentStatus().withArtifactsApplied(artifactsApplied); + return this; + } + + /** + * Get the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + public Integer totalArtifacts() { + return this.innerArtifactDeploymentStatus() == null + ? null + : this.innerArtifactDeploymentStatus().totalArtifacts(); + } + + /** + * Set the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @param totalArtifacts the totalArtifacts value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTotalArtifacts(Integer totalArtifacts) { + if (this.innerArtifactDeploymentStatus() == null) { + this.innerArtifactDeploymentStatus = new ArtifactDeploymentStatusProperties(); + } + this.innerArtifactDeploymentStatus().withTotalArtifacts(totalArtifacts); + return this; + } + + /** + * Get the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + public String offer() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().offer(); + } + + /** + * Set the offer property: The offer of the gallery image. + * + * @param offer the offer value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOffer(String offer) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withOffer(offer); + return this; + } + + /** + * Get the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().publisher(); + } + + /** + * Set the publisher property: The publisher of the gallery image. + * + * @param publisher the publisher value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPublisher(String publisher) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withPublisher(publisher); + return this; + } + + /** + * Get the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + public String sku() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().sku(); + } + + /** + * Set the sku property: The SKU of the gallery image. + * + * @param sku the sku value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSku(String sku) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withSku(sku); + return this; + } + + /** + * Get the osType property: The OS type of the gallery image. + * + * @return the osType value. + */ + public String osTypeGalleryImageReferenceOsType() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().osType(); + } + + /** + * Set the osType property: The OS type of the gallery image. + * + * @param osType the osType value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOsTypeGalleryImageReferenceOsType(String osType) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withOsType(osType); + return this; + } + + /** + * Get the version property: The version of the gallery image. + * + * @return the version value. + */ + public String version() { + return this.innerGalleryImageReference() == null ? null : this.innerGalleryImageReference().version(); + } + + /** + * Set the version property: The version of the gallery image. + * + * @param version the version value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withVersion(String version) { + if (this.innerGalleryImageReference() == null) { + this.innerGalleryImageReference = new GalleryImageReference(); + } + this.innerGalleryImageReference().withVersion(version); + return this; + } + + /** + * Get the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + public List statuses() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().statuses(); + } + + /** + * Set the statuses property: Gets the statuses of the virtual machine. + * + * @param statuses the statuses value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withStatuses(List statuses) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withStatuses(statuses); + return this; + } + + /** + * Get the osType property: Gets the OS type of the virtual machine. + * + * @return the osType value. + */ + public String osTypeComputeVmOsType() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().osType(); + } + + /** + * Set the osType property: Gets the OS type of the virtual machine. + * + * @param osType the osType value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOsTypeComputeVmOsType(String osType) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withOsType(osType); + return this; + } + + /** + * Get the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().vmSize(); + } + + /** + * Set the vmSize property: Gets the size of the virtual machine. + * + * @param vmSize the vmSize value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withVmSize(String vmSize) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withVmSize(vmSize); + return this; + } + + /** + * Get the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().networkInterfaceId(); + } + + /** + * Set the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @param networkInterfaceId the networkInterfaceId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withNetworkInterfaceId(String networkInterfaceId) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withNetworkInterfaceId(networkInterfaceId); + return this; + } + + /** + * Get the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + public String osDiskId() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().osDiskId(); + } + + /** + * Set the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @param osDiskId the osDiskId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withOsDiskId(String osDiskId) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withOsDiskId(osDiskId); + return this; + } + + /** + * Get the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + public List dataDiskIds() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().dataDiskIds(); + } + + /** + * Set the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @param dataDiskIds the dataDiskIds value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDataDiskIds(List dataDiskIds) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withDataDiskIds(dataDiskIds); + return this; + } + + /** + * Get the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.innerComputeVm() == null ? null : this.innerComputeVm().dataDisks(); + } + + /** + * Set the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @param dataDisks the dataDisks value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDataDisks(List dataDisks) { + if (this.innerComputeVm() == null) { + this.innerComputeVm = new ComputeVmProperties(); + } + this.innerComputeVm().withDataDisks(dataDisks); + return this; + } + + /** + * Get the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + public String virtualNetworkId() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().virtualNetworkId(); + } + + /** + * Set the virtualNetworkId property: The resource ID of the virtual network. + * + * @param virtualNetworkId the virtualNetworkId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withVirtualNetworkId(String virtualNetworkId) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withVirtualNetworkId(virtualNetworkId); + return this; + } + + /** + * Get the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().subnetId(); + } + + /** + * Set the subnetId property: The resource ID of the sub net. + * + * @param subnetId the subnetId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSubnetId(String subnetId) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withSubnetId(subnetId); + return this; + } + + /** + * Get the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().publicIpAddressId(); + } + + /** + * Set the publicIpAddressId property: The resource ID of the public IP address. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPublicIpAddressId(String publicIpAddressId) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withPublicIpAddressId(publicIpAddressId); + return this; + } + + /** + * Get the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().publicIpAddress(); + } + + /** + * Set the publicIpAddress property: The public IP address. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPublicIpAddress(String publicIpAddress) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: The private IP address. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withPrivateIpAddress(String privateIpAddress) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().dnsName(); + } + + /** + * Set the dnsName property: The DNS name. + * + * @param dnsName the dnsName value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withDnsName(String dnsName) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withDnsName(dnsName); + return this; + } + + /** + * Get the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + public String rdpAuthority() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().rdpAuthority(); + } + + /** + * Set the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @param rdpAuthority the rdpAuthority value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withRdpAuthority(String rdpAuthority) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withRdpAuthority(rdpAuthority); + return this; + } + + /** + * Get the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + public String sshAuthority() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().sshAuthority(); + } + + /** + * Set the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @param sshAuthority the sshAuthority value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withSshAuthority(String sshAuthority) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withSshAuthority(sshAuthority); + return this; + } + + /** + * Get the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerNetworkInterface() == null ? null : this.innerNetworkInterface().inboundNatRules(); + } + + /** + * Set the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withInboundNatRules(List inboundNatRules) { + if (this.innerNetworkInterface() == null) { + this.innerNetworkInterface = new NetworkInterfaceProperties(); + } + this.innerNetworkInterface().withInboundNatRules(inboundNatRules); + return this; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().systemData(); + } + + /** + * Get the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerApplicableSchedule() == null + ? null + : this.innerApplicableSchedule().systemDataPropertiesSystemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().status(); + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withStatus(EnableStatus status) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withStatus(status); + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().taskType(); + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTaskType(String taskType) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTaskType(taskType); + return this; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().timeZoneId(); + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTimeZoneId(String timeZoneId) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().targetResourceId(); + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTargetResourceId(String targetResourceId) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTargetResourceId(targetResourceId); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withWeekdays(List weekdays) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTime(String time) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withMinute(Integer minute) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withMinute(minute); + return this; + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerApplicableSchedule() == null + ? null + : this.innerApplicableSchedule().statusNotificationSettingsStatus(); + } + + /** + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withStatusNotificationSettingsStatus( + EnableStatus statusNotificationSettingsStatus) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTimeInMinutes(Integer timeInMinutes) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withWebhookUrl(String webhookUrl) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withEmailRecipient(String emailRecipient) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withNotificationLocale(String notificationLocale) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String location() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().location(); + } + + /** + * Set the location property: the geo-location where the resource live. + * + * @param location the location value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withLocation(String location) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withLocation(location); + return this; + } + + /** + * Get the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().tagsPropertiesTags(); + } + + /** + * Set the tagsPropertiesTags property: the tags of the resource. + * + * @param tagsPropertiesTags the tagsPropertiesTags value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTagsPropertiesTags(Map tagsPropertiesTags) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTagsPropertiesTags(tagsPropertiesTags); + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().tags(); + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LabVirtualMachinePropertiesInner object itself. + */ + public LabVirtualMachinePropertiesInner withTags(Map tags) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifacts() != null) { + artifacts().forEach(e -> e.validate()); + } + if (innerArtifactDeploymentStatus() != null) { + innerArtifactDeploymentStatus().validate(); + } + if (innerGalleryImageReference() != null) { + innerGalleryImageReference().validate(); + } + if (innerComputeVm() != null) { + innerComputeVm().validate(); + } + if (innerNetworkInterface() != null) { + innerNetworkInterface().validate(); + } + if (innerApplicableSchedule() != null) { + innerApplicableSchedule().validate(); + } + if (dataDiskParameters() != null) { + dataDiskParameters().forEach(e -> e.validate()); + } + if (scheduleParameters() != null) { + scheduleParameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LinuxOsInfo.java similarity index 92% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LinuxOsInfo.java index b0fdefb03534..f34a20c13311 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LinuxOsInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/LinuxOsInfo.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NetworkInterfaceProperties.java similarity index 81% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NetworkInterfaceProperties.java index 98894826a3c0..102f4d950888 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NetworkInterfaceProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NetworkInterfaceProperties.java @@ -2,12 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties of a network interface. */ @Fluent @@ -69,7 +71,7 @@ public final class NetworkInterfaceProperties { * virtual machines. */ @JsonProperty(value = "sharedPublicIpAddressConfiguration") - private SharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration; + private SharedPublicIpAddressConfiguration innerSharedPublicIpAddressConfiguration; /** * Get the virtualNetworkId property: The resource ID of the virtual network. @@ -236,25 +238,37 @@ public NetworkInterfaceProperties withSshAuthority(String sshAuthority) { } /** - * Get the sharedPublicIpAddressConfiguration property: The configuration for sharing a public IP address across - * multiple virtual machines. + * Get the innerSharedPublicIpAddressConfiguration property: The configuration for sharing a public IP address + * across multiple virtual machines. * - * @return the sharedPublicIpAddressConfiguration value. + * @return the innerSharedPublicIpAddressConfiguration value. */ - public SharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration() { - return this.sharedPublicIpAddressConfiguration; + private SharedPublicIpAddressConfiguration innerSharedPublicIpAddressConfiguration() { + return this.innerSharedPublicIpAddressConfiguration; } /** - * Set the sharedPublicIpAddressConfiguration property: The configuration for sharing a public IP address across - * multiple virtual machines. + * Get the inboundNatRules property: The incoming NAT rules. * - * @param sharedPublicIpAddressConfiguration the sharedPublicIpAddressConfiguration value to set. + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerSharedPublicIpAddressConfiguration() == null + ? null + : this.innerSharedPublicIpAddressConfiguration().inboundNatRules(); + } + + /** + * Set the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules the inboundNatRules value to set. * @return the NetworkInterfaceProperties object itself. */ - public NetworkInterfaceProperties withSharedPublicIpAddressConfiguration( - SharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration) { - this.sharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; + public NetworkInterfaceProperties withInboundNatRules(List inboundNatRules) { + if (this.innerSharedPublicIpAddressConfiguration() == null) { + this.innerSharedPublicIpAddressConfiguration = new SharedPublicIpAddressConfiguration(); + } + this.innerSharedPublicIpAddressConfiguration().withInboundNatRules(inboundNatRules); return this; } @@ -264,8 +278,8 @@ public NetworkInterfaceProperties withSharedPublicIpAddressConfiguration( * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sharedPublicIpAddressConfiguration() != null) { - sharedPublicIpAddressConfiguration().validate(); + if (innerSharedPublicIpAddressConfiguration() != null) { + innerSharedPublicIpAddressConfiguration().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java index a58c1b1518d5..390b377e5de1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.Event; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -16,60 +16,53 @@ import java.util.Map; /** A notification. */ -@JsonFlatten @Fluent -public class NotificationChannelInner extends Resource { +public final class NotificationChannelInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationChannelInner.class); /* - * The webhook URL to send notifications to. + * The properties of the resource. */ - @JsonProperty(value = "properties.webHookUrl") - private String webhookUrl; + @JsonProperty(value = "properties", required = true) + private NotificationChannelProperties innerProperties = new NotificationChannelProperties(); /* - * The email recipient to send notifications to (can be a list of - * semi-colon separated email addresses). + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.emailRecipient") - private String emailRecipient; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The locale to use when sending a notification (fallback for unsupported - * languages is EN). - */ - @JsonProperty(value = "properties.notificationLocale") - private String notificationLocale; - - /* - * Description of notification. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * The list of event for which this notification is enabled. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.events") - private List events; + private NotificationChannelProperties innerProperties() { + return this.innerProperties; + } - /* - * The creation date of the notification channel. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public NotificationChannelInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public NotificationChannelInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the webhookUrl property: The webhook URL to send notifications to. @@ -77,7 +70,7 @@ public class NotificationChannelInner extends Resource { * @return the webhookUrl value. */ public String webhookUrl() { - return this.webhookUrl; + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); } /** @@ -87,7 +80,10 @@ public String webhookUrl() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withWebhookUrl(String webhookUrl) { - this.webhookUrl = webhookUrl; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withWebhookUrl(webhookUrl); return this; } @@ -98,7 +94,7 @@ public NotificationChannelInner withWebhookUrl(String webhookUrl) { * @return the emailRecipient value. */ public String emailRecipient() { - return this.emailRecipient; + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); } /** @@ -109,7 +105,10 @@ public String emailRecipient() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withEmailRecipient(String emailRecipient) { - this.emailRecipient = emailRecipient; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withEmailRecipient(emailRecipient); return this; } @@ -120,7 +119,7 @@ public NotificationChannelInner withEmailRecipient(String emailRecipient) { * @return the notificationLocale value. */ public String notificationLocale() { - return this.notificationLocale; + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); } /** @@ -131,7 +130,10 @@ public String notificationLocale() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withNotificationLocale(String notificationLocale) { - this.notificationLocale = notificationLocale; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withNotificationLocale(notificationLocale); return this; } @@ -141,7 +143,7 @@ public NotificationChannelInner withNotificationLocale(String notificationLocale * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -151,7 +153,10 @@ public String description() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -161,7 +166,7 @@ public NotificationChannelInner withDescription(String description) { * @return the events value. */ public List events() { - return this.events; + return this.innerProperties() == null ? null : this.innerProperties().events(); } /** @@ -171,7 +176,10 @@ public List events() { * @return the NotificationChannelInner object itself. */ public NotificationChannelInner withEvents(List events) { - this.events = events; + if (this.innerProperties() == null) { + this.innerProperties = new NotificationChannelProperties(); + } + this.innerProperties().withEvents(events); return this; } @@ -181,7 +189,7 @@ public NotificationChannelInner withEvents(List events) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -190,7 +198,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -199,21 +207,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public NotificationChannelInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public NotificationChannelInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -222,8 +216,13 @@ public NotificationChannelInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (events() != null) { - events().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model NotificationChannelInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java new file mode 100644 index 000000000000..5153fd6f21e7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationChannelProperties.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.Event; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a schedule. */ +@Fluent +public final class NotificationChannelProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationChannelProperties.class); + + /* + * The webhook URL to send notifications to. + */ + @JsonProperty(value = "webHookUrl") + private String webhookUrl; + + /* + * The email recipient to send notifications to (can be a list of + * semi-colon separated email addresses). + */ + @JsonProperty(value = "emailRecipient") + private String emailRecipient; + + /* + * The locale to use when sending a notification (fallback for unsupported + * languages is EN). + */ + @JsonProperty(value = "notificationLocale") + private String notificationLocale; + + /* + * Description of notification. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The list of event for which this notification is enabled. + */ + @JsonProperty(value = "events") + private List events; + + /* + * The creation date of the notification channel. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the webhookUrl property: The webhook URL to send notifications to. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.webhookUrl; + } + + /** + * Set the webhookUrl property: The webhook URL to send notifications to. + * + * @param webhookUrl the webhookUrl value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withWebhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.emailRecipient; + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withEmailRecipient(String emailRecipient) { + this.emailRecipient = emailRecipient; + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.notificationLocale; + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withNotificationLocale(String notificationLocale) { + this.notificationLocale = notificationLocale; + return this; + } + + /** + * Get the description property: Description of notification. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of notification. + * + * @param description the description value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the events property: The list of event for which this notification is enabled. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: The list of event for which this notification is enabled. + * + * @param events the events value to set. + * @return the NotificationChannelProperties object itself. + */ + public NotificationChannelProperties withEvents(List events) { + this.events = events; + return this; + } + + /** + * Get the createdDate property: The creation date of the notification channel. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationSettings.java similarity index 97% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationSettings.java index 18dded9cf6f6..9d202e3e772d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationSettings.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/NotificationSettings.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationError.java similarity index 96% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationError.java index 884d343f4ee6..4c5804107a79 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationError.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationError.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java index ab919833b35c..9d100610dbcc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/OperationResultInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.HttpStatusCode; -import com.azure.resourcemanager.devtestlabs.models.OperationError; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -32,7 +31,7 @@ public final class OperationResultInner { * Error details for the operation in case of a failure. */ @JsonProperty(value = "error") - private OperationError error; + private OperationError innerError; /** * Get the status property: The operation status. @@ -75,22 +74,57 @@ public OperationResultInner withStatusCode(HttpStatusCode statusCode) { } /** - * Get the error property: Error details for the operation in case of a failure. + * Get the innerError property: Error details for the operation in case of a failure. * - * @return the error value. + * @return the innerError value. */ - public OperationError error() { - return this.error; + private OperationError innerError() { + return this.innerError; } /** - * Set the error property: Error details for the operation in case of a failure. + * Get the code property: The error code of the operation error. * - * @param error the error value to set. + * @return the code value. + */ + public String code() { + return this.innerError() == null ? null : this.innerError().code(); + } + + /** + * Set the code property: The error code of the operation error. + * + * @param code the code value to set. * @return the OperationResultInner object itself. */ - public OperationResultInner withError(OperationError error) { - this.error = error; + public OperationResultInner withCode(String code) { + if (this.innerError() == null) { + this.innerError = new OperationError(); + } + this.innerError().withCode(code); + return this; + } + + /** + * Get the message property: The error message of the operation error. + * + * @return the message value. + */ + public String message() { + return this.innerError() == null ? null : this.innerError().message(); + } + + /** + * Set the message property: The error message of the operation error. + * + * @param message the message value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withMessage(String message) { + if (this.innerError() == null) { + this.innerError = new OperationError(); + } + this.innerError().withMessage(message); return this; } @@ -100,8 +134,8 @@ public OperationResultInner withError(OperationError error) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (error() != null) { - error().validate(); + if (innerError() != null) { + innerError().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PercentageCostThresholdProperties.java similarity index 96% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PercentageCostThresholdProperties.java index 706208c05507..6cc3bc282350 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PercentageCostThresholdProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PercentageCostThresholdProperties.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java index c8ede6a5a05e..76ceee0f1ccc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; @@ -17,67 +17,53 @@ import java.util.Map; /** A Policy. */ -@JsonFlatten @Fluent -public class PolicyInner extends Resource { +public final class PolicyInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyInner.class); /* - * The description of the policy. + * The properties of the resource. */ - @JsonProperty(value = "properties.description") - private String description; + @JsonProperty(value = "properties", required = true) + private PolicyProperties innerProperties = new PolicyProperties(); /* - * The status of the policy. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.status") - private PolicyStatus status; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The fact name of the policy (e.g. LabVmCount, LabVmSize, - * MaxVmsAllowedPerLab, etc. - */ - @JsonProperty(value = "properties.factName") - private PolicyFactName factName; - - /* - * The fact data of the policy. - */ - @JsonProperty(value = "properties.factData") - private String factData; - - /* - * The threshold of the policy (i.e. a number for MaxValuePolicy, and a - * JSON array of values for AllowedValuesPolicy). - */ - @JsonProperty(value = "properties.threshold") - private String threshold; - - /* - * The evaluator type of the policy (i.e. AllowedValuesPolicy, - * MaxValuePolicy). + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.evaluatorType") - private PolicyEvaluatorType evaluatorType; + private PolicyProperties innerProperties() { + return this.innerProperties; + } - /* - * The creation date of the policy. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public PolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public PolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the description property: The description of the policy. @@ -85,7 +71,7 @@ public class PolicyInner extends Resource { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -95,7 +81,10 @@ public String description() { * @return the PolicyInner object itself. */ public PolicyInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -105,7 +94,7 @@ public PolicyInner withDescription(String description) { * @return the status value. */ public PolicyStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -115,7 +104,10 @@ public PolicyStatus status() { * @return the PolicyInner object itself. */ public PolicyInner withStatus(PolicyStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -125,7 +117,7 @@ public PolicyInner withStatus(PolicyStatus status) { * @return the factName value. */ public PolicyFactName factName() { - return this.factName; + return this.innerProperties() == null ? null : this.innerProperties().factName(); } /** @@ -135,7 +127,10 @@ public PolicyFactName factName() { * @return the PolicyInner object itself. */ public PolicyInner withFactName(PolicyFactName factName) { - this.factName = factName; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withFactName(factName); return this; } @@ -145,7 +140,7 @@ public PolicyInner withFactName(PolicyFactName factName) { * @return the factData value. */ public String factData() { - return this.factData; + return this.innerProperties() == null ? null : this.innerProperties().factData(); } /** @@ -155,7 +150,10 @@ public String factData() { * @return the PolicyInner object itself. */ public PolicyInner withFactData(String factData) { - this.factData = factData; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withFactData(factData); return this; } @@ -166,7 +164,7 @@ public PolicyInner withFactData(String factData) { * @return the threshold value. */ public String threshold() { - return this.threshold; + return this.innerProperties() == null ? null : this.innerProperties().threshold(); } /** @@ -177,7 +175,10 @@ public String threshold() { * @return the PolicyInner object itself. */ public PolicyInner withThreshold(String threshold) { - this.threshold = threshold; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withThreshold(threshold); return this; } @@ -187,7 +188,7 @@ public PolicyInner withThreshold(String threshold) { * @return the evaluatorType value. */ public PolicyEvaluatorType evaluatorType() { - return this.evaluatorType; + return this.innerProperties() == null ? null : this.innerProperties().evaluatorType(); } /** @@ -197,7 +198,10 @@ public PolicyEvaluatorType evaluatorType() { * @return the PolicyInner object itself. */ public PolicyInner withEvaluatorType(PolicyEvaluatorType evaluatorType) { - this.evaluatorType = evaluatorType; + if (this.innerProperties() == null) { + this.innerProperties = new PolicyProperties(); + } + this.innerProperties().withEvaluatorType(evaluatorType); return this; } @@ -207,7 +211,7 @@ public PolicyInner withEvaluatorType(PolicyEvaluatorType evaluatorType) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -216,7 +220,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -225,21 +229,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public PolicyInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public PolicyInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -248,5 +238,12 @@ public PolicyInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model PolicyInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java new file mode 100644 index 000000000000..ed324f712920 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicyProperties.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; +import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; +import com.azure.resourcemanager.devtestlabs.models.PolicyStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a Policy. */ +@Fluent +public final class PolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyProperties.class); + + /* + * The description of the policy. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The status of the policy. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /* + * The fact name of the policy (e.g. LabVmCount, LabVmSize, + * MaxVmsAllowedPerLab, etc. + */ + @JsonProperty(value = "factName") + private PolicyFactName factName; + + /* + * The fact data of the policy. + */ + @JsonProperty(value = "factData") + private String factData; + + /* + * The threshold of the policy (i.e. a number for MaxValuePolicy, and a + * JSON array of values for AllowedValuesPolicy). + */ + @JsonProperty(value = "threshold") + private String threshold; + + /* + * The evaluator type of the policy (i.e. AllowedValuesPolicy, + * MaxValuePolicy). + */ + @JsonProperty(value = "evaluatorType") + private PolicyEvaluatorType evaluatorType; + + /* + * The creation date of the policy. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the description property: The description of the policy. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the policy. + * + * @param description the description value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: The status of the policy. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the policy. + * + * @param status the status value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Get the factName property: The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. + * + * @return the factName value. + */ + public PolicyFactName factName() { + return this.factName; + } + + /** + * Set the factName property: The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. + * + * @param factName the factName value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withFactName(PolicyFactName factName) { + this.factName = factName; + return this; + } + + /** + * Get the factData property: The fact data of the policy. + * + * @return the factData value. + */ + public String factData() { + return this.factData; + } + + /** + * Set the factData property: The fact data of the policy. + * + * @param factData the factData value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withFactData(String factData) { + this.factData = factData; + return this; + } + + /** + * Get the threshold property: The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of + * values for AllowedValuesPolicy). + * + * @return the threshold value. + */ + public String threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of + * values for AllowedValuesPolicy). + * + * @param threshold the threshold value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withThreshold(String threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get the evaluatorType property: The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). + * + * @return the evaluatorType value. + */ + public PolicyEvaluatorType evaluatorType() { + return this.evaluatorType; + } + + /** + * Set the evaluatorType property: The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). + * + * @param evaluatorType the evaluatorType value to set. + * @return the PolicyProperties object itself. + */ + public PolicyProperties withEvaluatorType(PolicyEvaluatorType evaluatorType) { + this.evaluatorType = evaluatorType; + return this; + } + + /** + * Get the createdDate property: The creation date of the policy. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicySetInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicySetInner.java new file mode 100644 index 000000000000..ca675adc6916 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicySetInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A PolicySet. */ +@Fluent +public final class PolicySetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicySetInner.class); + + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties", required = true) + private PolicySetProperties innerProperties = new PolicySetProperties(); + + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. + */ + private PolicySetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model PolicySetInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicySetProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicySetProperties.java new file mode 100644 index 000000000000..033a5442a88f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/PolicySetProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a PolicySet. */ +@Immutable +public final class PolicySetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicySetProperties.class); + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java new file mode 100644 index 000000000000..54816b46e3a5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleCreationParameterProperties.java @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties for schedule creation. */ +@Fluent +public final class ScheduleCreationParameterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleCreationParameterProperties.class); + + /* + * The status of the schedule (i.e. Enabled, Disabled) + */ + @JsonProperty(value = "status") + private EnableStatus status; + + /* + * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + */ + @JsonProperty(value = "taskType") + private String taskType; + + /* + * If the schedule will occur only some days of the week, specify the + * weekly recurrence. + */ + @JsonProperty(value = "weeklyRecurrence") + private WeekDetails innerWeeklyRecurrence; + + /* + * If the schedule will occur once each day of the week, specify the daily + * recurrence. + */ + @JsonProperty(value = "dailyRecurrence") + private DayDetails innerDailyRecurrence; + + /* + * If the schedule will occur multiple times a day, specify the hourly + * recurrence. + */ + @JsonProperty(value = "hourlyRecurrence") + private HourDetails innerHourlyRecurrence; + + /* + * The time zone ID (e.g. Pacific Standard time). + */ + @JsonProperty(value = "timeZoneId") + private String timeZoneId; + + /* + * Notification settings. + */ + @JsonProperty(value = "notificationSettings") + private NotificationSettings innerNotificationSettings; + + /* + * The creation date of the schedule. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The resource ID to which the schedule belongs + */ + @JsonProperty(value = "targetResourceId") + private String targetResourceId; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withStatus(EnableStatus status) { + this.status = status; + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.taskType; + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTaskType(String taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get the innerWeeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly + * recurrence. + * + * @return the innerWeeklyRecurrence value. + */ + private WeekDetails innerWeeklyRecurrence() { + return this.innerWeeklyRecurrence; + } + + /** + * Get the innerDailyRecurrence property: If the schedule will occur once each day of the week, specify the daily + * recurrence. + * + * @return the innerDailyRecurrence value. + */ + private DayDetails innerDailyRecurrence() { + return this.innerDailyRecurrence; + } + + /** + * Get the innerHourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly + * recurrence. + * + * @return the innerHourlyRecurrence value. + */ + private HourDetails innerHourlyRecurrence() { + return this.innerHourlyRecurrence; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.timeZoneId; + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + return this; + } + + /** + * Get the innerNotificationSettings property: Notification settings. + * + * @return the innerNotificationSettings value. + */ + private NotificationSettings innerNotificationSettings() { + return this.innerNotificationSettings; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerWeeklyRecurrence() == null ? null : this.innerWeeklyRecurrence().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withWeekdays(List weekdays) { + if (this.innerWeeklyRecurrence() == null) { + this.innerWeeklyRecurrence = new WeekDetails(); + } + this.innerWeeklyRecurrence().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerWeeklyRecurrence() == null ? null : this.innerWeeklyRecurrence().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTime(String time) { + if (this.innerWeeklyRecurrence() == null) { + this.innerWeeklyRecurrence = new WeekDetails(); + } + this.innerWeeklyRecurrence().withTime(time); + return this; + } + + /** + * Get the time property: The time of day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerDailyRecurrence() == null ? null : this.innerDailyRecurrence().time(); + } + + /** + * Set the time property: The time of day the schedule will occur. + * + * @param time the time value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTime(String time) { + if (this.innerDailyRecurrence() == null) { + this.innerDailyRecurrence = new DayDetails(); + } + this.innerDailyRecurrence().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerHourlyRecurrence() == null ? null : this.innerHourlyRecurrence().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withMinute(Integer minute) { + if (this.innerHourlyRecurrence() == null) { + this.innerHourlyRecurrence = new HourDetails(); + } + this.innerHourlyRecurrence().withMinute(minute); + return this; + } + + /** + * Get the status property: If notifications are enabled for this schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().status(); + } + + /** + * Set the status property: If notifications are enabled for this schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withStatusNotificationSettingsStatus(EnableStatus status) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withStatus(status); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withTimeInMinutes(Integer timeInMinutes) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withWebhookUrl(String webhookUrl) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withEmailRecipient(String emailRecipient) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ScheduleCreationParameterProperties object itself. + */ + public ScheduleCreationParameterProperties withNotificationLocale(String notificationLocale) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerWeeklyRecurrence() != null) { + innerWeeklyRecurrence().validate(); + } + if (innerDailyRecurrence() != null) { + innerDailyRecurrence().validate(); + } + if (innerHourlyRecurrence() != null) { + innerHourlyRecurrence().validate(); + } + if (innerNotificationSettings() != null) { + innerNotificationSettings().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java index 21f71b94a9d1..89c663f79297 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleInner.java @@ -5,93 +5,64 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.DayDetails; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; -import com.azure.resourcemanager.devtestlabs.models.HourDetails; -import com.azure.resourcemanager.devtestlabs.models.NotificationSettings; -import com.azure.resourcemanager.devtestlabs.models.WeekDetails; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** A schedule. */ -@JsonFlatten @Fluent -public class ScheduleInner extends Resource { +public final class ScheduleInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleInner.class); /* - * The status of the schedule (i.e. Enabled, Disabled) + * The properties of the resource. */ - @JsonProperty(value = "properties.status") - private EnableStatus status; + @JsonProperty(value = "properties", required = true) + private ScheduleProperties innerProperties = new ScheduleProperties(); /* - * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.taskType") - private String taskType; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * If the schedule will occur only some days of the week, specify the - * weekly recurrence. - */ - @JsonProperty(value = "properties.weeklyRecurrence") - private WeekDetails weeklyRecurrence; - - /* - * If the schedule will occur once each day of the week, specify the daily - * recurrence. - */ - @JsonProperty(value = "properties.dailyRecurrence") - private DayDetails dailyRecurrence; - - /* - * If the schedule will occur multiple times a day, specify the hourly - * recurrence. - */ - @JsonProperty(value = "properties.hourlyRecurrence") - private HourDetails hourlyRecurrence; - - /* - * The time zone ID (e.g. Pacific Standard time). - */ - @JsonProperty(value = "properties.timeZoneId") - private String timeZoneId; - - /* - * Notification settings. - */ - @JsonProperty(value = "properties.notificationSettings") - private NotificationSettings notificationSettings; - - /* - * The creation date of the schedule. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private ScheduleProperties innerProperties() { + return this.innerProperties; + } - /* - * The resource ID to which the schedule belongs + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.targetResourceId") - private String targetResourceId; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public ScheduleInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public ScheduleInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the status property: The status of the schedule (i.e. Enabled, Disabled). @@ -99,7 +70,7 @@ public class ScheduleInner extends Resource { * @return the status value. */ public EnableStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -109,7 +80,10 @@ public EnableStatus status() { * @return the ScheduleInner object itself. */ public ScheduleInner withStatus(EnableStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -119,7 +93,7 @@ public ScheduleInner withStatus(EnableStatus status) { * @return the taskType value. */ public String taskType() { - return this.taskType; + return this.innerProperties() == null ? null : this.innerProperties().taskType(); } /** @@ -129,174 +103,275 @@ public String taskType() { * @return the ScheduleInner object itself. */ public ScheduleInner withTaskType(String taskType) { - this.taskType = taskType; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTaskType(taskType); return this; } /** - * Get the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly - * recurrence. + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). * - * @return the weeklyRecurrence value. + * @return the timeZoneId value. */ - public WeekDetails weeklyRecurrence() { - return this.weeklyRecurrence; + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); } /** - * Set the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly - * recurrence. + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). * - * @param weeklyRecurrence the weeklyRecurrence value to set. + * @param timeZoneId the timeZoneId value to set. * @return the ScheduleInner object itself. */ - public ScheduleInner withWeeklyRecurrence(WeekDetails weeklyRecurrence) { - this.weeklyRecurrence = weeklyRecurrence; + public ScheduleInner withTimeZoneId(String timeZoneId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTimeZoneId(timeZoneId); return this; } /** - * Get the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily - * recurrence. + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. * - * @return the dailyRecurrence value. + * @return the targetResourceId value. */ - public DayDetails dailyRecurrence() { - return this.dailyRecurrence; + public String targetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); } /** - * Set the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily - * recurrence. + * Set the targetResourceId property: The resource ID to which the schedule belongs. * - * @param dailyRecurrence the dailyRecurrence value to set. + * @param targetResourceId the targetResourceId value to set. * @return the ScheduleInner object itself. */ - public ScheduleInner withDailyRecurrence(DayDetails dailyRecurrence) { - this.dailyRecurrence = dailyRecurrence; + public ScheduleInner withTargetResourceId(String targetResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTargetResourceId(targetResourceId); return this; } /** - * Get the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly - * recurrence. + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). * - * @return the hourlyRecurrence value. + * @return the weekdays value. */ - public HourDetails hourlyRecurrence() { - return this.hourlyRecurrence; + public List weekdays() { + return this.innerProperties() == null ? null : this.innerProperties().weekdays(); } /** - * Set the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly - * recurrence. + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). * - * @param hourlyRecurrence the hourlyRecurrence value to set. + * @param weekdays the weekdays value to set. * @return the ScheduleInner object itself. */ - public ScheduleInner withHourlyRecurrence(HourDetails hourlyRecurrence) { - this.hourlyRecurrence = hourlyRecurrence; + public ScheduleInner withWeekdays(List weekdays) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withWeekdays(weekdays); return this; } /** - * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * Get the time property: The time of the day the schedule will occur. * - * @return the timeZoneId value. + * @return the time value. */ - public String timeZoneId() { - return this.timeZoneId; + public String time() { + return this.innerProperties() == null ? null : this.innerProperties().time(); } /** - * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * Set the time property: The time of the day the schedule will occur. * - * @param timeZoneId the timeZoneId value to set. + * @param time the time value to set. * @return the ScheduleInner object itself. */ - public ScheduleInner withTimeZoneId(String timeZoneId) { - this.timeZoneId = timeZoneId; + public ScheduleInner withTime(String time) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTime(time); return this; } /** - * Get the notificationSettings property: Notification settings. + * Get the minute property: Minutes of the hour the schedule will run. * - * @return the notificationSettings value. + * @return the minute value. */ - public NotificationSettings notificationSettings() { - return this.notificationSettings; + public Integer minute() { + return this.innerProperties() == null ? null : this.innerProperties().minute(); } /** - * Set the notificationSettings property: Notification settings. + * Set the minute property: Minutes of the hour the schedule will run. * - * @param notificationSettings the notificationSettings value to set. + * @param minute the minute value to set. * @return the ScheduleInner object itself. */ - public ScheduleInner withNotificationSettings(NotificationSettings notificationSettings) { - this.notificationSettings = notificationSettings; + public ScheduleInner withMinute(Integer minute) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withMinute(minute); return this; } /** - * Get the createdDate property: The creation date of the schedule. + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * - * @return the createdDate value. + * @return the statusNotificationSettingsStatus value. */ - public OffsetDateTime createdDate() { - return this.createdDate; + public EnableStatus statusNotificationSettingsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().statusNotificationSettingsStatus(); } /** - * Get the targetResourceId property: The resource ID to which the schedule belongs. + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * - * @return the targetResourceId value. + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. + * @return the ScheduleInner object itself. */ - public String targetResourceId() { - return this.targetResourceId; + public ScheduleInner withStatusNotificationSettingsStatus(EnableStatus statusNotificationSettingsStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; } /** - * Set the targetResourceId property: The resource ID to which the schedule belongs. + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. * - * @param targetResourceId the targetResourceId value to set. + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. * @return the ScheduleInner object itself. */ - public ScheduleInner withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; + public ScheduleInner withTimeInMinutes(Integer timeInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTimeInMinutes(timeInMinutes); return this; } /** - * Get the provisioningState property: The provisioning status of the resource. + * Get the webhookUrl property: The webhook URL to which the notification will be sent. * - * @return the provisioningState value. + * @return the webhookUrl value. */ - public String provisioningState() { - return this.provisioningState; + public String webhookUrl() { + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); } /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Set the webhookUrl property: The webhook URL to which the notification will be sent. * - * @return the uniqueIdentifier value. + * @param webhookUrl the webhookUrl value to set. + * @return the ScheduleInner object itself. */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; + public ScheduleInner withWebhookUrl(String webhookUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withWebhookUrl(webhookUrl); + return this; } - /** {@inheritDoc} */ - @Override - public ScheduleInner withLocation(String location) { - super.withLocation(location); + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withEmailRecipient(String emailRecipient) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withEmailRecipient(emailRecipient); return this; } - /** {@inheritDoc} */ - @Override - public ScheduleInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withNotificationLocale(String notificationLocale) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withNotificationLocale(notificationLocale); return this; } @@ -306,17 +381,12 @@ public ScheduleInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (weeklyRecurrence() != null) { - weeklyRecurrence().validate(); - } - if (dailyRecurrence() != null) { - dailyRecurrence().validate(); - } - if (hourlyRecurrence() != null) { - hourlyRecurrence().validate(); - } - if (notificationSettings() != null) { - notificationSettings().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model ScheduleInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java new file mode 100644 index 000000000000..82476ffa3543 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ScheduleProperties.java @@ -0,0 +1,467 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a schedule. */ +@Fluent +public final class ScheduleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleProperties.class); + + /* + * The status of the schedule (i.e. Enabled, Disabled) + */ + @JsonProperty(value = "status") + private EnableStatus status; + + /* + * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + */ + @JsonProperty(value = "taskType") + private String taskType; + + /* + * If the schedule will occur only some days of the week, specify the + * weekly recurrence. + */ + @JsonProperty(value = "weeklyRecurrence") + private WeekDetails innerWeeklyRecurrence; + + /* + * If the schedule will occur once each day of the week, specify the daily + * recurrence. + */ + @JsonProperty(value = "dailyRecurrence") + private DayDetails innerDailyRecurrence; + + /* + * If the schedule will occur multiple times a day, specify the hourly + * recurrence. + */ + @JsonProperty(value = "hourlyRecurrence") + private HourDetails innerHourlyRecurrence; + + /* + * The time zone ID (e.g. Pacific Standard time). + */ + @JsonProperty(value = "timeZoneId") + private String timeZoneId; + + /* + * Notification settings. + */ + @JsonProperty(value = "notificationSettings") + private NotificationSettings innerNotificationSettings; + + /* + * The creation date of the schedule. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The resource ID to which the schedule belongs + */ + @JsonProperty(value = "targetResourceId") + private String targetResourceId; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withStatus(EnableStatus status) { + this.status = status; + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.taskType; + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTaskType(String taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get the innerWeeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly + * recurrence. + * + * @return the innerWeeklyRecurrence value. + */ + private WeekDetails innerWeeklyRecurrence() { + return this.innerWeeklyRecurrence; + } + + /** + * Get the innerDailyRecurrence property: If the schedule will occur once each day of the week, specify the daily + * recurrence. + * + * @return the innerDailyRecurrence value. + */ + private DayDetails innerDailyRecurrence() { + return this.innerDailyRecurrence; + } + + /** + * Get the innerHourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly + * recurrence. + * + * @return the innerHourlyRecurrence value. + */ + private HourDetails innerHourlyRecurrence() { + return this.innerHourlyRecurrence; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.timeZoneId; + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + return this; + } + + /** + * Get the innerNotificationSettings property: Notification settings. + * + * @return the innerNotificationSettings value. + */ + private NotificationSettings innerNotificationSettings() { + return this.innerNotificationSettings; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerWeeklyRecurrence() == null ? null : this.innerWeeklyRecurrence().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withWeekdays(List weekdays) { + if (this.innerWeeklyRecurrence() == null) { + this.innerWeeklyRecurrence = new WeekDetails(); + } + this.innerWeeklyRecurrence().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerWeeklyRecurrence() == null ? null : this.innerWeeklyRecurrence().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTime(String time) { + if (this.innerWeeklyRecurrence() == null) { + this.innerWeeklyRecurrence = new WeekDetails(); + } + this.innerWeeklyRecurrence().withTime(time); + return this; + } + + /** + * Get the time property: The time of day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerDailyRecurrence() == null ? null : this.innerDailyRecurrence().time(); + } + + /** + * Set the time property: The time of day the schedule will occur. + * + * @param time the time value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTime(String time) { + if (this.innerDailyRecurrence() == null) { + this.innerDailyRecurrence = new DayDetails(); + } + this.innerDailyRecurrence().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerHourlyRecurrence() == null ? null : this.innerHourlyRecurrence().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withMinute(Integer minute) { + if (this.innerHourlyRecurrence() == null) { + this.innerHourlyRecurrence = new HourDetails(); + } + this.innerHourlyRecurrence().withMinute(minute); + return this; + } + + /** + * Get the status property: If notifications are enabled for this schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().status(); + } + + /** + * Set the status property: If notifications are enabled for this schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withStatusNotificationSettingsStatus(EnableStatus status) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withStatus(status); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withTimeInMinutes(Integer timeInMinutes) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withWebhookUrl(String webhookUrl) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withEmailRecipient(String emailRecipient) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerNotificationSettings() == null ? null : this.innerNotificationSettings().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ScheduleProperties object itself. + */ + public ScheduleProperties withNotificationLocale(String notificationLocale) { + if (this.innerNotificationSettings() == null) { + this.innerNotificationSettings = new NotificationSettings(); + } + this.innerNotificationSettings().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerWeeklyRecurrence() != null) { + innerWeeklyRecurrence().validate(); + } + if (innerDailyRecurrence() != null) { + innerDailyRecurrence().validate(); + } + if (innerHourlyRecurrence() != null) { + innerHourlyRecurrence().validate(); + } + if (innerNotificationSettings() != null) { + innerNotificationSettings().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java index 3f6f0af07f97..3ca664e87301 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretInner.java @@ -5,36 +5,61 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** A secret. */ -@JsonFlatten @Fluent -public class SecretInner extends Resource { +public final class SecretInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretInner.class); /* - * The value of the secret for secret creation. + * The properties of the resource. */ - @JsonProperty(value = "properties.value") - private String value; + @JsonProperty(value = "properties", required = true) + private SecretProperties innerProperties = new SecretProperties(); /* - * The provisioning status of the resource. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The unique immutable identifier of a resource (Guid). + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + private SecretProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SecretInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the value property: The value of the secret for secret creation. @@ -42,7 +67,7 @@ public class SecretInner extends Resource { * @return the value value. */ public String value() { - return this.value; + return this.innerProperties() == null ? null : this.innerProperties().value(); } /** @@ -52,7 +77,10 @@ public String value() { * @return the SecretInner object itself. */ public SecretInner withValue(String value) { - this.value = value; + if (this.innerProperties() == null) { + this.innerProperties = new SecretProperties(); + } + this.innerProperties().withValue(value); return this; } @@ -62,7 +90,7 @@ public SecretInner withValue(String value) { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -71,21 +99,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public SecretInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecretInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -94,5 +108,12 @@ public SecretInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model SecretInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java new file mode 100644 index 000000000000..925ad43c638e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SecretProperties.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a secret. */ +@Fluent +public final class SecretProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretProperties.class); + + /* + * The value of the secret for secret creation. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the value property: The value of the secret for secret creation. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the secret for secret creation. + * + * @param value the value value to set. + * @return the SecretProperties object itself. + */ + public SecretProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java index fcc1dbed870a..6be3003e7da9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricInner.java @@ -5,49 +5,64 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** A Service Fabric. */ -@JsonFlatten @Fluent -public class ServiceFabricInner extends Resource { +public final class ServiceFabricInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceFabricInner.class); /* - * The backing service fabric resource's id + * The properties of the resource. */ - @JsonProperty(value = "properties.externalServiceFabricId") - private String externalServiceFabricId; + @JsonProperty(value = "properties", required = true) + private ServiceFabricPropertiesInner innerProperties = new ServiceFabricPropertiesInner(); /* - * The resource id of the environment under which the service fabric - * resource is present + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.environmentId") - private String environmentId; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The applicable schedule for the virtual machine. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) - private ApplicableScheduleInner applicableSchedule; + private ServiceFabricPropertiesInner innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + public SystemData systemData() { + return this.systemData; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public ServiceFabricInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceFabricInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the externalServiceFabricId property: The backing service fabric resource's id. @@ -55,7 +70,7 @@ public class ServiceFabricInner extends Resource { * @return the externalServiceFabricId value. */ public String externalServiceFabricId() { - return this.externalServiceFabricId; + return this.innerProperties() == null ? null : this.innerProperties().externalServiceFabricId(); } /** @@ -65,7 +80,10 @@ public String externalServiceFabricId() { * @return the ServiceFabricInner object itself. */ public ServiceFabricInner withExternalServiceFabricId(String externalServiceFabricId) { - this.externalServiceFabricId = externalServiceFabricId; + if (this.innerProperties() == null) { + this.innerProperties = new ServiceFabricPropertiesInner(); + } + this.innerProperties().withExternalServiceFabricId(externalServiceFabricId); return this; } @@ -76,7 +94,7 @@ public ServiceFabricInner withExternalServiceFabricId(String externalServiceFabr * @return the environmentId value. */ public String environmentId() { - return this.environmentId; + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); } /** @@ -87,26 +105,20 @@ public String environmentId() { * @return the ServiceFabricInner object itself. */ public ServiceFabricInner withEnvironmentId(String environmentId) { - this.environmentId = environmentId; + if (this.innerProperties() == null) { + this.innerProperties = new ServiceFabricPropertiesInner(); + } + this.innerProperties().withEnvironmentId(environmentId); return this; } - /** - * Get the applicableSchedule property: The applicable schedule for the virtual machine. - * - * @return the applicableSchedule value. - */ - public ApplicableScheduleInner applicableSchedule() { - return this.applicableSchedule; - } - /** * Get the provisioningState property: The provisioning status of the resource. * * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -115,21 +127,205 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } - /** {@inheritDoc} */ - @Override - public ServiceFabricInner withLocation(String location) { - super.withLocation(location); - return this; + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerProperties() == null ? null : this.innerProperties().systemData(); } - /** {@inheritDoc} */ - @Override - public ServiceFabricInner withTags(Map tags) { - super.withTags(tags); - return this; + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerProperties() == null ? null : this.innerProperties().taskType(); + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); + } + + /** + * Get the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerProperties() == null + ? null + : this.innerProperties().provisioningStateApplicableScheduleProvisioningState(); + } + + /** + * Get the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerProperties() == null + ? null + : this.innerProperties().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerProperties() == null ? null : this.innerProperties().weekdays(); + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerProperties() == null ? null : this.innerProperties().time(); + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerProperties() == null ? null : this.innerProperties().minute(); + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().statusNotificationSettingsStatus(); + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().timeInMinutes(); + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String locationPropertiesLocation() { + return this.innerProperties() == null ? null : this.innerProperties().location(); + } + + /** + * Get the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.innerProperties() == null ? null : this.innerProperties().tagsPropertiesTags(); } /** @@ -138,8 +334,13 @@ public ServiceFabricInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (applicableSchedule() != null) { - applicableSchedule().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ServiceFabricInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java new file mode 100644 index 000000000000..a930326013f4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceFabricPropertiesInner.java @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of a service fabric. */ +@Fluent +public final class ServiceFabricPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceFabricPropertiesInner.class); + + /* + * The backing service fabric resource's id + */ + @JsonProperty(value = "externalServiceFabricId") + private String externalServiceFabricId; + + /* + * The resource id of the environment under which the service fabric + * resource is present + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * The applicable schedule for the virtual machine. + */ + @JsonProperty(value = "applicableSchedule", access = JsonProperty.Access.WRITE_ONLY) + private ApplicableScheduleInner innerApplicableSchedule; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the externalServiceFabricId property: The backing service fabric resource's id. + * + * @return the externalServiceFabricId value. + */ + public String externalServiceFabricId() { + return this.externalServiceFabricId; + } + + /** + * Set the externalServiceFabricId property: The backing service fabric resource's id. + * + * @param externalServiceFabricId the externalServiceFabricId value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withExternalServiceFabricId(String externalServiceFabricId) { + this.externalServiceFabricId = externalServiceFabricId; + return this; + } + + /** + * Get the environmentId property: The resource id of the environment under which the service fabric resource is + * present. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource id of the environment under which the service fabric resource is + * present. + * + * @param environmentId the environmentId value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the innerApplicableSchedule property: The applicable schedule for the virtual machine. + * + * @return the innerApplicableSchedule value. + */ + private ApplicableScheduleInner innerApplicableSchedule() { + return this.innerApplicableSchedule; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().systemData(); + } + + /** + * Get the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + public SystemData systemDataPropertiesSystemData() { + return this.innerApplicableSchedule() == null + ? null + : this.innerApplicableSchedule().systemDataPropertiesSystemData(); + } + + /** + * Get the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + public EnableStatus status() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().status(); + } + + /** + * Set the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @param status the status value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withStatus(EnableStatus status) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withStatus(status); + return this; + } + + /** + * Get the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + public String taskType() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().taskType(); + } + + /** + * Set the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @param taskType the taskType value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withTaskType(String taskType) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTaskType(taskType); + return this; + } + + /** + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().timeZoneId(); + } + + /** + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @param timeZoneId the timeZoneId value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withTimeZoneId(String timeZoneId) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().targetResourceId(); + } + + /** + * Set the targetResourceId property: The resource ID to which the schedule belongs. + * + * @param targetResourceId the targetResourceId value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withTargetResourceId(String targetResourceId) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTargetResourceId(targetResourceId); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withWeekdays(List weekdays) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withWeekdays(weekdays); + return this; + } + + /** + * Get the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + public String time() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().time(); + } + + /** + * Set the time property: The time of the day the schedule will occur. + * + * @param time the time value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withTime(String time) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTime(time); + return this; + } + + /** + * Get the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + public Integer minute() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().minute(); + } + + /** + * Set the minute property: Minutes of the hour the schedule will run. + * + * @param minute the minute value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withMinute(Integer minute) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withMinute(minute); + return this; + } + + /** + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + public EnableStatus statusNotificationSettingsStatus() { + return this.innerApplicableSchedule() == null + ? null + : this.innerApplicableSchedule().statusNotificationSettingsStatus(); + } + + /** + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withStatusNotificationSettingsStatus( + EnableStatus statusNotificationSettingsStatus) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; + } + + /** + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + public Integer timeInMinutes() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withTimeInMinutes(Integer timeInMinutes) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withWebhookUrl(String webhookUrl) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withEmailRecipient(String emailRecipient) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withNotificationLocale(String notificationLocale) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Get the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().id(); + } + + /** + * Get the name property: the name of the resource. + * + * @return the name value. + */ + public String name() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().name(); + } + + /** + * Get the type property: the type of the resource. + * + * @return the type value. + */ + public String type() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().type(); + } + + /** + * Get the location property: the geo-location where the resource live. + * + * @return the location value. + */ + public String location() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().location(); + } + + /** + * Set the location property: the geo-location where the resource live. + * + * @param location the location value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withLocation(String location) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withLocation(location); + return this; + } + + /** + * Get the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + public Map tagsPropertiesTags() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().tagsPropertiesTags(); + } + + /** + * Set the tagsPropertiesTags property: the tags of the resource. + * + * @param tagsPropertiesTags the tagsPropertiesTags value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withTagsPropertiesTags(Map tagsPropertiesTags) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTagsPropertiesTags(tagsPropertiesTags); + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.innerApplicableSchedule() == null ? null : this.innerApplicableSchedule().tags(); + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ServiceFabricPropertiesInner object itself. + */ + public ServiceFabricPropertiesInner withTags(Map tags) { + if (this.innerApplicableSchedule() == null) { + this.innerApplicableSchedule = new ApplicableScheduleInner(); + } + this.innerApplicableSchedule().withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerApplicableSchedule() != null) { + innerApplicableSchedule().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java index 3502af945969..c30f18d10856 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerInner.java @@ -6,8 +6,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.IdentityProperties; +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -17,30 +18,49 @@ public final class ServiceRunnerInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRunnerInner.class); + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties", required = true) + private ServiceRunnerProperties innerProperties = new ServiceRunnerProperties(); + /* * The identity of the resource. */ @JsonProperty(value = "identity") - private IdentityProperties identity; + private IdentityProperties innerIdentity; + + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the identity property: The identity of the resource. + * Get the innerProperties property: The properties of the resource. * - * @return the identity value. + * @return the innerProperties value. */ - public IdentityProperties identity() { - return this.identity; + private ServiceRunnerProperties innerProperties() { + return this.innerProperties; } /** - * Set the identity property: The identity of the resource. + * Get the innerIdentity property: The identity of the resource. * - * @param identity the identity value to set. - * @return the ServiceRunnerInner object itself. + * @return the innerIdentity value. */ - public ServiceRunnerInner withIdentity(IdentityProperties identity) { - this.identity = identity; - return this; + private IdentityProperties innerIdentity() { + return this.innerIdentity; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; } /** {@inheritDoc} */ @@ -57,14 +77,180 @@ public ServiceRunnerInner withTags(Map tags) { return this; } + /** + * Get the identityUsageType property: The purpose of bringing the identity to the lab. Ex: To use during + * Environment creation or to deploy on the VMs. + * + * @return the identityUsageType value. + */ + public String identityUsageType() { + return this.innerProperties() == null ? null : this.innerProperties().identityUsageType(); + } + + /** + * Set the identityUsageType property: The purpose of bringing the identity to the lab. Ex: To use during + * Environment creation or to deploy on the VMs. + * + * @param identityUsageType the identityUsageType value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withIdentityUsageType(String identityUsageType) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceRunnerProperties(); + } + this.innerProperties().withIdentityUsageType(identityUsageType); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Get the type property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @return the type value. + */ + public ManagedIdentityType typeIdentityType() { + return this.innerIdentity() == null ? null : this.innerIdentity().type(); + } + + /** + * Set the type property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @param type the type value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withTypeIdentityType(ManagedIdentityType type) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withType(type); + return this; + } + + /** + * Get the principalId property: The principal id of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Set the principalId property: The principal id of resource identity. + * + * @param principalId the principalId value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withPrincipalId(String principalId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withPrincipalId(principalId); + return this; + } + + /** + * Get the tenantId property: The tenant identifier of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Set the tenantId property: The tenant identifier of resource. + * + * @param tenantId the tenantId value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withTenantId(String tenantId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withTenantId(tenantId); + return this; + } + + /** + * Get the clientSecretUrl property: The client secret URL of the identity. + * + * @return the clientSecretUrl value. + */ + public String clientSecretUrl() { + return this.innerIdentity() == null ? null : this.innerIdentity().clientSecretUrl(); + } + + /** + * Set the clientSecretUrl property: The client secret URL of the identity. + * + * @param clientSecretUrl the clientSecretUrl value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withClientSecretUrl(String clientSecretUrl) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withClientSecretUrl(clientSecretUrl); + return this; + } + + /** + * Get the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.innerIdentity() == null ? null : this.innerIdentity().userAssignedIdentities(); + } + + /** + * Set the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ServiceRunnerInner object itself. + */ + public ServiceRunnerInner withUserAssignedIdentities(Map userAssignedIdentities) { + if (this.innerIdentity() == null) { + this.innerIdentity = new IdentityProperties(); + } + this.innerIdentity().withUserAssignedIdentities(userAssignedIdentities); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { - identity().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ServiceRunnerInner")); + } else { + innerProperties().validate(); + } + if (innerIdentity() != null) { + innerIdentity().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerProperties.java new file mode 100644 index 000000000000..baaf56ab30d4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/ServiceRunnerProperties.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a virtual machine. */ +@Fluent +public final class ServiceRunnerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRunnerProperties.class); + + /* + * The purpose of bringing the identity to the lab. Ex: To use during + * Environment creation or to deploy on the VMs. + */ + @JsonProperty(value = "identityUsageType") + private String identityUsageType; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the identityUsageType property: The purpose of bringing the identity to the lab. Ex: To use during + * Environment creation or to deploy on the VMs. + * + * @return the identityUsageType value. + */ + public String identityUsageType() { + return this.identityUsageType; + } + + /** + * Set the identityUsageType property: The purpose of bringing the identity to the lab. Ex: To use during + * Environment creation or to deploy on the VMs. + * + * @param identityUsageType the identityUsageType value to set. + * @return the ServiceRunnerProperties object itself. + */ + public ServiceRunnerProperties withIdentityUsageType(String identityUsageType) { + this.identityUsageType = identityUsageType; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedGalleryInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedGalleryInner.java new file mode 100644 index 000000000000..60cf6672c3c7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedGalleryInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties of a shared gallery. */ +@Fluent +public final class SharedGalleryInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryInner.class); + + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties", required = true) + private SharedGalleryProperties innerProperties = new SharedGalleryProperties(); + + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. + */ + private SharedGalleryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SharedGalleryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the galleryId property: The shared image gallery resource Id. + * + * @return the galleryId value. + */ + public String galleryId() { + return this.innerProperties() == null ? null : this.innerProperties().galleryId(); + } + + /** + * Set the galleryId property: The shared image gallery resource Id. + * + * @param galleryId the galleryId value to set. + * @return the SharedGalleryInner object itself. + */ + public SharedGalleryInner withGalleryId(String galleryId) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryProperties(); + } + this.innerProperties().withGalleryId(galleryId); + return this; + } + + /** + * Get the allowAllImages property: Enables all images in the gallery to be available in the lab for VM creation. + * This will override the EnableState on shared images. + * + * @return the allowAllImages value. + */ + public EnableState allowAllImages() { + return this.innerProperties() == null ? null : this.innerProperties().allowAllImages(); + } + + /** + * Set the allowAllImages property: Enables all images in the gallery to be available in the lab for VM creation. + * This will override the EnableState on shared images. + * + * @param allowAllImages the allowAllImages value to set. + * @return the SharedGalleryInner object itself. + */ + public SharedGalleryInner withAllowAllImages(EnableState allowAllImages) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedGalleryProperties(); + } + this.innerProperties().withAllowAllImages(allowAllImages); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model SharedGalleryInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedGalleryProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedGalleryProperties.java new file mode 100644 index 000000000000..aa8f865b8e04 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedGalleryProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a shared gallery. */ +@Fluent +public final class SharedGalleryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryProperties.class); + + /* + * The shared image gallery resource Id + */ + @JsonProperty(value = "galleryId") + private String galleryId; + + /* + * Enables all images in the gallery to be available in the lab for VM + * creation. This will override the EnableState on shared images + */ + @JsonProperty(value = "allowAllImages") + private EnableState allowAllImages; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the galleryId property: The shared image gallery resource Id. + * + * @return the galleryId value. + */ + public String galleryId() { + return this.galleryId; + } + + /** + * Set the galleryId property: The shared image gallery resource Id. + * + * @param galleryId the galleryId value to set. + * @return the SharedGalleryProperties object itself. + */ + public SharedGalleryProperties withGalleryId(String galleryId) { + this.galleryId = galleryId; + return this; + } + + /** + * Get the allowAllImages property: Enables all images in the gallery to be available in the lab for VM creation. + * This will override the EnableState on shared images. + * + * @return the allowAllImages value. + */ + public EnableState allowAllImages() { + return this.allowAllImages; + } + + /** + * Set the allowAllImages property: Enables all images in the gallery to be available in the lab for VM creation. + * This will override the EnableState on shared images. + * + * @param allowAllImages the allowAllImages value to set. + * @return the SharedGalleryProperties object itself. + */ + public SharedGalleryProperties withAllowAllImages(EnableState allowAllImages) { + this.allowAllImages = allowAllImages; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedImageInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedImageInner.java new file mode 100644 index 000000000000..554bfe8ddd94 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedImageInner.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.azure.resourcemanager.devtestlabs.models.ImageType; +import com.azure.resourcemanager.devtestlabs.models.ImageVersionProperties; +import com.azure.resourcemanager.devtestlabs.models.OsType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties of a shared image. */ +@Fluent +public final class SharedImageInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedImageInner.class); + + /* + * The properties of the resource. + */ + @JsonProperty(value = "properties", required = true) + private SharedImageProperties innerProperties = new SharedImageProperties(); + + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. + */ + private SharedImageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SharedImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SharedImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the definitionName property: Shared Image definition name in shared image gallery. + * + * @return the definitionName value. + */ + public String definitionName() { + return this.innerProperties() == null ? null : this.innerProperties().definitionName(); + } + + /** + * Set the definitionName property: Shared Image definition name in shared image gallery. + * + * @param definitionName the definitionName value to set. + * @return the SharedImageInner object itself. + */ + public SharedImageInner withDefinitionName(String definitionName) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedImageProperties(); + } + this.innerProperties().withDefinitionName(definitionName); + return this; + } + + /** + * Get the osType property: The operating system of the image. + * + * @return the osType value. + */ + public OsType osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The operating system of the image. + * + * @param osType the osType value to set. + * @return the SharedImageInner object itself. + */ + public SharedImageInner withOsType(OsType osType) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedImageProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the imageType property: The type of image in the gallery (generalized or specialized). + * + * @return the imageType value. + */ + public ImageType imageType() { + return this.innerProperties() == null ? null : this.innerProperties().imageType(); + } + + /** + * Set the imageType property: The type of image in the gallery (generalized or specialized). + * + * @param imageType the imageType value to set. + * @return the SharedImageInner object itself. + */ + public SharedImageInner withImageType(ImageType imageType) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedImageProperties(); + } + this.innerProperties().withImageType(imageType); + return this; + } + + /** + * Get the enableState property: Whether or not the image is enabled. + * + * @return the enableState value. + */ + public EnableState enableState() { + return this.innerProperties() == null ? null : this.innerProperties().enableState(); + } + + /** + * Set the enableState property: Whether or not the image is enabled. + * + * @param enableState the enableState value to set. + * @return the SharedImageInner object itself. + */ + public SharedImageInner withEnableState(EnableState enableState) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedImageProperties(); + } + this.innerProperties().withEnableState(enableState); + return this; + } + + /** + * Get the displayName property: Display name of the image. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: Display name of the image. + * + * @param displayName the displayName value to set. + * @return the SharedImageInner object itself. + */ + public SharedImageInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedImageProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the versions property: List of image versions in definition. + * + * @return the versions value. + */ + public List versions() { + return this.innerProperties() == null ? null : this.innerProperties().versions(); + } + + /** + * Set the versions property: List of image versions in definition. + * + * @param versions the versions value to set. + * @return the SharedImageInner object itself. + */ + public SharedImageInner withVersions(List versions) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedImageProperties(); + } + this.innerProperties().withVersions(versions); + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model SharedImageInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedImageProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedImageProperties.java new file mode 100644 index 000000000000..be0b5adbe45c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedImageProperties.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.azure.resourcemanager.devtestlabs.models.ImageType; +import com.azure.resourcemanager.devtestlabs.models.ImageVersionProperties; +import com.azure.resourcemanager.devtestlabs.models.OsType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a shared image. */ +@Fluent +public final class SharedImageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedImageProperties.class); + + /* + * Shared Image definition name in shared image gallery + */ + @JsonProperty(value = "definitionName") + private String definitionName; + + /* + * The operating system of the image + */ + @JsonProperty(value = "osType") + private OsType osType; + + /* + * The type of image in the gallery (generalized or specialized) + */ + @JsonProperty(value = "imageType") + private ImageType imageType; + + /* + * Whether or not the image is enabled. + */ + @JsonProperty(value = "enableState") + private EnableState enableState; + + /* + * Display name of the image + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * List of image versions in definition + */ + @JsonProperty(value = "versions") + private List versions; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the definitionName property: Shared Image definition name in shared image gallery. + * + * @return the definitionName value. + */ + public String definitionName() { + return this.definitionName; + } + + /** + * Set the definitionName property: Shared Image definition name in shared image gallery. + * + * @param definitionName the definitionName value to set. + * @return the SharedImageProperties object itself. + */ + public SharedImageProperties withDefinitionName(String definitionName) { + this.definitionName = definitionName; + return this; + } + + /** + * Get the osType property: The operating system of the image. + * + * @return the osType value. + */ + public OsType osType() { + return this.osType; + } + + /** + * Set the osType property: The operating system of the image. + * + * @param osType the osType value to set. + * @return the SharedImageProperties object itself. + */ + public SharedImageProperties withOsType(OsType osType) { + this.osType = osType; + return this; + } + + /** + * Get the imageType property: The type of image in the gallery (generalized or specialized). + * + * @return the imageType value. + */ + public ImageType imageType() { + return this.imageType; + } + + /** + * Set the imageType property: The type of image in the gallery (generalized or specialized). + * + * @param imageType the imageType value to set. + * @return the SharedImageProperties object itself. + */ + public SharedImageProperties withImageType(ImageType imageType) { + this.imageType = imageType; + return this; + } + + /** + * Get the enableState property: Whether or not the image is enabled. + * + * @return the enableState value. + */ + public EnableState enableState() { + return this.enableState; + } + + /** + * Set the enableState property: Whether or not the image is enabled. + * + * @param enableState the enableState value to set. + * @return the SharedImageProperties object itself. + */ + public SharedImageProperties withEnableState(EnableState enableState) { + this.enableState = enableState; + return this; + } + + /** + * Get the displayName property: Display name of the image. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the image. + * + * @param displayName the displayName value to set. + * @return the SharedImageProperties object itself. + */ + public SharedImageProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the versions property: List of image versions in definition. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * Set the versions property: List of image versions in definition. + * + * @param versions the versions value to set. + * @return the SharedImageProperties object itself. + */ + public SharedImageProperties withVersions(List versions) { + this.versions = versions; + return this; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (versions() != null) { + versions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedPublicIpAddressConfiguration.java similarity index 92% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedPublicIpAddressConfiguration.java index 4214baa898c6..832aa14fadf1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedPublicIpAddressConfiguration.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SharedPublicIpAddressConfiguration.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SubnetSharedPublicIpAddressConfiguration.java similarity index 93% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SubnetSharedPublicIpAddressConfiguration.java index 55ac07024eb5..b9345c65d316 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetSharedPublicIpAddressConfiguration.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/SubnetSharedPublicIpAddressConfiguration.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.Port; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/TargetCostProperties.java similarity index 94% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/TargetCostProperties.java index 36b5422f83cd..d69238011189 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/TargetCostProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/TargetCostProperties.java @@ -2,10 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserIdentity.java similarity index 98% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserIdentity.java index 34a4b9f8f2b6..b1f5ac09fe5d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserIdentity.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserIdentity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java index a502dbe76746..1ca7da7144f6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserInner.java @@ -5,130 +5,252 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.devtestlabs.models.UserIdentity; -import com.azure.resourcemanager.devtestlabs.models.UserSecretStore; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; /** Profile of a lab user. */ -@JsonFlatten @Fluent -public class UserInner extends Resource { +public final class UserInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class); /* - * The identity of the user. + * The properties of the resource. */ - @JsonProperty(value = "properties.identity") - private UserIdentity identity; + @JsonProperty(value = "properties", required = true) + private UserProperties innerProperties = new UserProperties(); /* - * The secret store of the user. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.secretStore") - private UserSecretStore secretStore; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The creation date of the user profile. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private UserProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + public SystemData systemData() { + return this.systemData; + } - /* - * The unique immutable identifier of a resource (Guid). + /** {@inheritDoc} */ + @Override + public UserInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the createdDate property: The creation date of the user profile. + * + * @return the createdDate value. */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + public OffsetDateTime createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } /** - * Get the identity property: The identity of the user. + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). * - * @return the identity value. + * @return the uniqueIdentifier value. */ - public UserIdentity identity() { - return this.identity; + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** - * Set the identity property: The identity of the user. + * Get the principalName property: Set to the principal name / UPN of the client JWT making the request. * - * @param identity the identity value to set. + * @return the principalName value. + */ + public String principalName() { + return this.innerProperties() == null ? null : this.innerProperties().principalName(); + } + + /** + * Set the principalName property: Set to the principal name / UPN of the client JWT making the request. + * + * @param principalName the principalName value to set. * @return the UserInner object itself. */ - public UserInner withIdentity(UserIdentity identity) { - this.identity = identity; + public UserInner withPrincipalName(String principalName) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withPrincipalName(principalName); return this; } /** - * Get the secretStore property: The secret store of the user. + * Get the principalId property: Set to the principal Id of the client JWT making the request. Service principal + * will not have the principal Id. * - * @return the secretStore value. + * @return the principalId value. */ - public UserSecretStore secretStore() { - return this.secretStore; + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); } /** - * Set the secretStore property: The secret store of the user. + * Set the principalId property: Set to the principal Id of the client JWT making the request. Service principal + * will not have the principal Id. * - * @param secretStore the secretStore value to set. + * @param principalId the principalId value to set. * @return the UserInner object itself. */ - public UserInner withSecretStore(UserSecretStore secretStore) { - this.secretStore = secretStore; + public UserInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withPrincipalId(principalId); return this; } /** - * Get the createdDate property: The creation date of the user profile. + * Get the tenantId property: Set to the tenant ID of the client JWT making the request. * - * @return the createdDate value. + * @return the tenantId value. */ - public OffsetDateTime createdDate() { - return this.createdDate; + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); } /** - * Get the provisioningState property: The provisioning status of the resource. + * Set the tenantId property: Set to the tenant ID of the client JWT making the request. * - * @return the provisioningState value. + * @param tenantId the tenantId value to set. + * @return the UserInner object itself. */ - public String provisioningState() { - return this.provisioningState; + public UserInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; } /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Get the objectId property: Set to the object Id of the client JWT making the request. Not all users have object + * Id. For CSP (reseller) scenarios for example, object Id is not available. * - * @return the uniqueIdentifier value. + * @return the objectId value. */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; + public String objectId() { + return this.innerProperties() == null ? null : this.innerProperties().objectId(); } - /** {@inheritDoc} */ - @Override - public UserInner withLocation(String location) { - super.withLocation(location); + /** + * Set the objectId property: Set to the object Id of the client JWT making the request. Not all users have object + * Id. For CSP (reseller) scenarios for example, object Id is not available. + * + * @param objectId the objectId value to set. + * @return the UserInner object itself. + */ + public UserInner withObjectId(String objectId) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withObjectId(objectId); return this; } - /** {@inheritDoc} */ - @Override - public UserInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the appId property: Set to the app Id of the client JWT making the request. + * + * @return the appId value. + */ + public String appId() { + return this.innerProperties() == null ? null : this.innerProperties().appId(); + } + + /** + * Set the appId property: Set to the app Id of the client JWT making the request. + * + * @param appId the appId value to set. + * @return the UserInner object itself. + */ + public UserInner withAppId(String appId) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withAppId(appId); + return this; + } + + /** + * Get the keyVaultUri property: The URI of the user's Key vault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.innerProperties() == null ? null : this.innerProperties().keyVaultUri(); + } + + /** + * Set the keyVaultUri property: The URI of the user's Key vault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the UserInner object itself. + */ + public UserInner withKeyVaultUri(String keyVaultUri) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withKeyVaultUri(keyVaultUri); + return this; + } + + /** + * Get the keyVaultId property: The ID of the user's Key vault. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.innerProperties() == null ? null : this.innerProperties().keyVaultId(); + } + + /** + * Set the keyVaultId property: The ID of the user's Key vault. + * + * @param keyVaultId the keyVaultId value to set. + * @return the UserInner object itself. + */ + public UserInner withKeyVaultId(String keyVaultId) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withKeyVaultId(keyVaultId); return this; } @@ -138,11 +260,12 @@ public UserInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { - identity().validate(); - } - if (secretStore() != null) { - secretStore().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model UserInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java new file mode 100644 index 000000000000..dee4c1cbbe66 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserProperties.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of a lab user profile. */ +@Fluent +public final class UserProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserProperties.class); + + /* + * The identity of the user. + */ + @JsonProperty(value = "identity") + private UserIdentity innerIdentity; + + /* + * The secret store of the user. + */ + @JsonProperty(value = "secretStore") + private UserSecretStore innerSecretStore; + + /* + * The creation date of the user profile. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the innerIdentity property: The identity of the user. + * + * @return the innerIdentity value. + */ + private UserIdentity innerIdentity() { + return this.innerIdentity; + } + + /** + * Get the innerSecretStore property: The secret store of the user. + * + * @return the innerSecretStore value. + */ + private UserSecretStore innerSecretStore() { + return this.innerSecretStore; + } + + /** + * Get the createdDate property: The creation date of the user profile. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Get the principalName property: Set to the principal name / UPN of the client JWT making the request. + * + * @return the principalName value. + */ + public String principalName() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalName(); + } + + /** + * Set the principalName property: Set to the principal name / UPN of the client JWT making the request. + * + * @param principalName the principalName value to set. + * @return the UserProperties object itself. + */ + public UserProperties withPrincipalName(String principalName) { + if (this.innerIdentity() == null) { + this.innerIdentity = new UserIdentity(); + } + this.innerIdentity().withPrincipalName(principalName); + return this; + } + + /** + * Get the principalId property: Set to the principal Id of the client JWT making the request. Service principal + * will not have the principal Id. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerIdentity() == null ? null : this.innerIdentity().principalId(); + } + + /** + * Set the principalId property: Set to the principal Id of the client JWT making the request. Service principal + * will not have the principal Id. + * + * @param principalId the principalId value to set. + * @return the UserProperties object itself. + */ + public UserProperties withPrincipalId(String principalId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new UserIdentity(); + } + this.innerIdentity().withPrincipalId(principalId); + return this; + } + + /** + * Get the tenantId property: Set to the tenant ID of the client JWT making the request. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerIdentity() == null ? null : this.innerIdentity().tenantId(); + } + + /** + * Set the tenantId property: Set to the tenant ID of the client JWT making the request. + * + * @param tenantId the tenantId value to set. + * @return the UserProperties object itself. + */ + public UserProperties withTenantId(String tenantId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new UserIdentity(); + } + this.innerIdentity().withTenantId(tenantId); + return this; + } + + /** + * Get the objectId property: Set to the object Id of the client JWT making the request. Not all users have object + * Id. For CSP (reseller) scenarios for example, object Id is not available. + * + * @return the objectId value. + */ + public String objectId() { + return this.innerIdentity() == null ? null : this.innerIdentity().objectId(); + } + + /** + * Set the objectId property: Set to the object Id of the client JWT making the request. Not all users have object + * Id. For CSP (reseller) scenarios for example, object Id is not available. + * + * @param objectId the objectId value to set. + * @return the UserProperties object itself. + */ + public UserProperties withObjectId(String objectId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new UserIdentity(); + } + this.innerIdentity().withObjectId(objectId); + return this; + } + + /** + * Get the appId property: Set to the app Id of the client JWT making the request. + * + * @return the appId value. + */ + public String appId() { + return this.innerIdentity() == null ? null : this.innerIdentity().appId(); + } + + /** + * Set the appId property: Set to the app Id of the client JWT making the request. + * + * @param appId the appId value to set. + * @return the UserProperties object itself. + */ + public UserProperties withAppId(String appId) { + if (this.innerIdentity() == null) { + this.innerIdentity = new UserIdentity(); + } + this.innerIdentity().withAppId(appId); + return this; + } + + /** + * Get the keyVaultUri property: The URI of the user's Key vault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.innerSecretStore() == null ? null : this.innerSecretStore().keyVaultUri(); + } + + /** + * Set the keyVaultUri property: The URI of the user's Key vault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the UserProperties object itself. + */ + public UserProperties withKeyVaultUri(String keyVaultUri) { + if (this.innerSecretStore() == null) { + this.innerSecretStore = new UserSecretStore(); + } + this.innerSecretStore().withKeyVaultUri(keyVaultUri); + return this; + } + + /** + * Get the keyVaultId property: The ID of the user's Key vault. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.innerSecretStore() == null ? null : this.innerSecretStore().keyVaultId(); + } + + /** + * Set the keyVaultId property: The ID of the user's Key vault. + * + * @param keyVaultId the keyVaultId value to set. + * @return the UserProperties object itself. + */ + public UserProperties withKeyVaultId(String keyVaultId) { + if (this.innerSecretStore() == null) { + this.innerSecretStore = new UserSecretStore(); + } + this.innerSecretStore().withKeyVaultId(keyVaultId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerIdentity() != null) { + innerIdentity().validate(); + } + if (innerSecretStore() != null) { + innerSecretStore().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserSecretStore.java similarity index 97% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserSecretStore.java index 5e1e609b65f6..8df3a0eda7a2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserSecretStore.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/UserSecretStore.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java index 80f7fd88eee8..8abca4d67866 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkInner.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.models.ExternalSubnet; import com.azure.resourcemanager.devtestlabs.models.Subnet; @@ -18,58 +18,53 @@ import java.util.Map; /** A virtual network. */ -@JsonFlatten @Fluent -public class VirtualNetworkInner extends Resource { +public final class VirtualNetworkInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkInner.class); /* - * The allowed subnets of the virtual network. + * The properties of the resource. */ - @JsonProperty(value = "properties.allowedSubnets") - private List allowedSubnets; + @JsonProperty(value = "properties", required = true) + private VirtualNetworkProperties innerProperties = new VirtualNetworkProperties(); /* - * The description of the virtual network. + * The system metadata relating to this resource */ - @JsonProperty(value = "properties.description") - private String description; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * The Microsoft.Network resource identifier of the virtual network. - */ - @JsonProperty(value = "properties.externalProviderResourceId") - private String externalProviderResourceId; - - /* - * The external subnet properties. - */ - @JsonProperty(value = "properties.externalSubnets", access = JsonProperty.Access.WRITE_ONLY) - private List externalSubnets; - - /* - * The subnet overrides of the virtual network. + /** + * Get the innerProperties property: The properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.subnetOverrides") - private List subnetOverrides; + private VirtualNetworkProperties innerProperties() { + return this.innerProperties; + } - /* - * The creation date of the virtual network. + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + public SystemData systemData() { + return this.systemData; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + /** {@inheritDoc} */ + @Override + public VirtualNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public VirtualNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the allowedSubnets property: The allowed subnets of the virtual network. @@ -77,7 +72,7 @@ public class VirtualNetworkInner extends Resource { * @return the allowedSubnets value. */ public List allowedSubnets() { - return this.allowedSubnets; + return this.innerProperties() == null ? null : this.innerProperties().allowedSubnets(); } /** @@ -87,7 +82,10 @@ public List allowedSubnets() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withAllowedSubnets(List allowedSubnets) { - this.allowedSubnets = allowedSubnets; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withAllowedSubnets(allowedSubnets); return this; } @@ -97,7 +95,7 @@ public VirtualNetworkInner withAllowedSubnets(List allowedSubnets) { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -107,7 +105,10 @@ public String description() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -117,7 +118,7 @@ public VirtualNetworkInner withDescription(String description) { * @return the externalProviderResourceId value. */ public String externalProviderResourceId() { - return this.externalProviderResourceId; + return this.innerProperties() == null ? null : this.innerProperties().externalProviderResourceId(); } /** @@ -127,7 +128,10 @@ public String externalProviderResourceId() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withExternalProviderResourceId(String externalProviderResourceId) { - this.externalProviderResourceId = externalProviderResourceId; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withExternalProviderResourceId(externalProviderResourceId); return this; } @@ -137,7 +141,7 @@ public VirtualNetworkInner withExternalProviderResourceId(String externalProvide * @return the externalSubnets value. */ public List externalSubnets() { - return this.externalSubnets; + return this.innerProperties() == null ? null : this.innerProperties().externalSubnets(); } /** @@ -146,7 +150,7 @@ public List externalSubnets() { * @return the subnetOverrides value. */ public List subnetOverrides() { - return this.subnetOverrides; + return this.innerProperties() == null ? null : this.innerProperties().subnetOverrides(); } /** @@ -156,7 +160,10 @@ public List subnetOverrides() { * @return the VirtualNetworkInner object itself. */ public VirtualNetworkInner withSubnetOverrides(List subnetOverrides) { - this.subnetOverrides = subnetOverrides; + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkProperties(); + } + this.innerProperties().withSubnetOverrides(subnetOverrides); return this; } @@ -166,7 +173,7 @@ public VirtualNetworkInner withSubnetOverrides(List subnetOverri * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -175,7 +182,7 @@ public OffsetDateTime createdDate() { * @return the provisioningState value. */ public String provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -184,21 +191,7 @@ public String provisioningState() { * @return the uniqueIdentifier value. */ public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); } /** @@ -207,14 +200,13 @@ public VirtualNetworkInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (allowedSubnets() != null) { - allowedSubnets().forEach(e -> e.validate()); - } - if (externalSubnets() != null) { - externalSubnets().forEach(e -> e.validate()); - } - if (subnetOverrides() != null) { - subnetOverrides().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VirtualNetworkInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java new file mode 100644 index 000000000000..b270d1f2e2c9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/VirtualNetworkProperties.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.ExternalSubnet; +import com.azure.resourcemanager.devtestlabs.models.Subnet; +import com.azure.resourcemanager.devtestlabs.models.SubnetOverride; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of a virtual network. */ +@Fluent +public final class VirtualNetworkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkProperties.class); + + /* + * The allowed subnets of the virtual network. + */ + @JsonProperty(value = "allowedSubnets") + private List allowedSubnets; + + /* + * The description of the virtual network. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The Microsoft.Network resource identifier of the virtual network. + */ + @JsonProperty(value = "externalProviderResourceId") + private String externalProviderResourceId; + + /* + * The external subnet properties. + */ + @JsonProperty(value = "externalSubnets", access = JsonProperty.Access.WRITE_ONLY) + private List externalSubnets; + + /* + * The subnet overrides of the virtual network. + */ + @JsonProperty(value = "subnetOverrides") + private List subnetOverrides; + + /* + * The creation date of the virtual network. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * The provisioning status of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The unique immutable identifier of a resource (Guid). + */ + @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueIdentifier; + + /** + * Get the allowedSubnets property: The allowed subnets of the virtual network. + * + * @return the allowedSubnets value. + */ + public List allowedSubnets() { + return this.allowedSubnets; + } + + /** + * Set the allowedSubnets property: The allowed subnets of the virtual network. + * + * @param allowedSubnets the allowedSubnets value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withAllowedSubnets(List allowedSubnets) { + this.allowedSubnets = allowedSubnets; + return this; + } + + /** + * Get the description property: The description of the virtual network. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the virtual network. + * + * @param description the description value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the externalProviderResourceId property: The Microsoft.Network resource identifier of the virtual network. + * + * @return the externalProviderResourceId value. + */ + public String externalProviderResourceId() { + return this.externalProviderResourceId; + } + + /** + * Set the externalProviderResourceId property: The Microsoft.Network resource identifier of the virtual network. + * + * @param externalProviderResourceId the externalProviderResourceId value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withExternalProviderResourceId(String externalProviderResourceId) { + this.externalProviderResourceId = externalProviderResourceId; + return this; + } + + /** + * Get the externalSubnets property: The external subnet properties. + * + * @return the externalSubnets value. + */ + public List externalSubnets() { + return this.externalSubnets; + } + + /** + * Get the subnetOverrides property: The subnet overrides of the virtual network. + * + * @return the subnetOverrides value. + */ + public List subnetOverrides() { + return this.subnetOverrides; + } + + /** + * Set the subnetOverrides property: The subnet overrides of the virtual network. + * + * @param subnetOverrides the subnetOverrides value to set. + * @return the VirtualNetworkProperties object itself. + */ + public VirtualNetworkProperties withSubnetOverrides(List subnetOverrides) { + this.subnetOverrides = subnetOverrides; + return this; + } + + /** + * Get the createdDate property: The creation date of the virtual network. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allowedSubnets() != null) { + allowedSubnets().forEach(e -> e.validate()); + } + if (externalSubnets() != null) { + externalSubnets().forEach(e -> e.validate()); + } + if (subnetOverrides() != null) { + subnetOverrides().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/WeekDetails.java similarity index 97% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/WeekDetails.java index 9f185eee2ec3..bd70e0f78567 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WeekDetails.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/WeekDetails.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/WindowsOsInfo.java similarity index 92% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/WindowsOsInfo.java index 55fb6f4a1ce3..db526a5b2193 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/WindowsOsInfo.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/WindowsOsInfo.java @@ -2,10 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.devtestlabs.models; +package com.azure.resourcemanager.devtestlabs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.models.WindowsOsState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java index f75cba7df383..99dba7b8fb22 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableScheduleImpl.java @@ -4,11 +4,13 @@ package com.azure.resourcemanager.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; -import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; -import com.azure.resourcemanager.devtestlabs.models.Schedule; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; public final class ApplicableScheduleImpl implements ApplicableSchedule { @@ -22,6 +24,88 @@ public final class ApplicableScheduleImpl implements ApplicableSchedule { this.serviceManager = serviceManager; } + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + public String id() { return this.innerModel().id(); } @@ -38,8 +122,8 @@ public String location() { return this.innerModel().location(); } - public Map tags() { - Map inner = this.innerModel().tags(); + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); if (inner != null) { return Collections.unmodifiableMap(inner); } else { @@ -47,24 +131,6 @@ public Map tags() { } } - public Schedule labVmsShutdown() { - ScheduleInner inner = this.innerModel().labVmsShutdown(); - if (inner != null) { - return new ScheduleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Schedule labVmsStartup() { - ScheduleInner inner = this.innerModel().labVmsStartup(); - if (inner != null) { - return new ScheduleImpl(inner, this.manager()); - } else { - return null; - } - } - public ApplicableScheduleInner innerModel() { return this.innerObject; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java new file mode 100644 index 000000000000..5162deccb924 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ApplicableSchedulePropertiesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableSchedulePropertiesInner; +import com.azure.resourcemanager.devtestlabs.models.ApplicableScheduleProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplicableSchedulePropertiesImpl implements ApplicableScheduleProperties { + private ApplicableSchedulePropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + ApplicableSchedulePropertiesImpl( + ApplicableSchedulePropertiesInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ApplicableSchedulePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java index 64314349669e..00d43a7be6e8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplateImpl.java @@ -4,13 +4,13 @@ package com.azure.resourcemanager.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner; import com.azure.resourcemanager.devtestlabs.models.ArmTemplate; import com.azure.resourcemanager.devtestlabs.models.ParametersValueFileInfo; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; -import java.util.Map; public final class ArmTemplateImpl implements ArmTemplate { private ArmTemplateInner innerObject; @@ -35,17 +35,8 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public String displayName() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java index da3764a72fae..e16574683941 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesClientImpl.java @@ -71,7 +71,6 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -92,7 +91,6 @@ Mono> get( @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -114,21 +112,20 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby) { @@ -166,7 +163,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, artifactSourceName, - expand, filter, top, orderby, @@ -191,22 +187,21 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, @@ -243,7 +238,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, artifactSourceName, - expand, filter, top, orderby, @@ -267,26 +261,24 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -299,16 +291,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -318,30 +309,26 @@ private PagedFlux listAsync(String resourceGroupName, String l * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -354,16 +341,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby)); } /** @@ -372,28 +357,26 @@ public PagedIterable list(String resourceGroupName, String lab * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context)); + listAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby, context)); } /** @@ -403,15 +386,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return azure resource manager template along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String artifactSourceName, String name, String expand) { + String resourceGroupName, String labName, String artifactSourceName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -450,7 +432,6 @@ private Mono> getWithResponseAsync( labName, artifactSourceName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -464,21 +445,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return azure resource manager template along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context) { + String resourceGroupName, String labName, String artifactSourceName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -515,39 +490,11 @@ private Mono> getWithResponseAsync( labName, artifactSourceName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get azure resource manager template. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param artifactSourceName The name of the artifact source. - * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String artifactSourceName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get azure resource manager template. * @@ -558,13 +505,12 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return azure resource manager template on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String labName, String artifactSourceName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -589,8 +535,7 @@ private Mono getAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public ArmTemplateInner get(String resourceGroupName, String labName, String artifactSourceName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, artifactSourceName, name, expand).block(); + return getAsync(resourceGroupName, labName, artifactSourceName, name).block(); } /** @@ -600,22 +545,16 @@ public ArmTemplateInner get(String resourceGroupName, String labName, String art * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return azure resource manager template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context) { - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand, context).block(); + String resourceGroupName, String labName, String artifactSourceName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, context).block(); } /** @@ -625,7 +564,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of armTemplates and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -661,7 +601,8 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java index 16f8a21ed215..d9b9b8b2b9ff 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArmTemplatesImpl.java @@ -38,15 +38,12 @@ public PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, artifactSourceName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ArmTemplateImpl(inner1, this.manager())); } @@ -60,14 +57,9 @@ public ArmTemplate get(String resourceGroupName, String labName, String artifact } public Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context) { + String resourceGroupName, String labName, String artifactSourceName, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, artifactSourceName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java index 83d9a4843e9c..0f8b1cf2ced6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactImpl.java @@ -4,11 +4,10 @@ package com.azure.resourcemanager.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner; import com.azure.resourcemanager.devtestlabs.models.Artifact; import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; public final class ArtifactImpl implements Artifact { private ArtifactInner innerObject; @@ -32,17 +31,8 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public String title() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java index c75b62607770..e28412c67816 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourceImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactSourceInner; import com.azure.resourcemanager.devtestlabs.models.ArtifactSource; @@ -45,6 +46,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } @@ -180,23 +185,21 @@ public ArtifactSource apply(Context context) { } public ArtifactSource refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getArtifactSources() - .getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, name, Context.NONE) .getValue(); return this; } public ArtifactSource refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getArtifactSources() - .getWithResponse(resourceGroupName, labName, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, name, context) .getValue(); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java index 980ba7a0e5d3..b7a5bc3b5574 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesClientImpl.java @@ -75,7 +75,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -95,7 +94,6 @@ Mono> get( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -166,18 +164,18 @@ Mono> listNext( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -207,7 +205,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -231,25 +228,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -277,7 +268,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -300,20 +290,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -325,16 +314,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -343,27 +331,20 @@ private PagedFlux listAsync(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -375,15 +356,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); } /** @@ -391,26 +371,19 @@ public PagedIterable list(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -419,15 +392,14 @@ public PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand) { + String resourceGroupName, String labName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -461,7 +433,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -474,16 +445,15 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -515,7 +485,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); @@ -527,40 +496,14 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get artifact source. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the artifact source. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -584,8 +527,7 @@ private Mono getAsync(String resourceGroupName, String labN */ @ServiceMethod(returns = ReturnType.SINGLE) public ArtifactSourceInner get(String resourceGroupName, String labName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, name, expand).block(); + return getAsync(resourceGroupName, labName, name).block(); } /** @@ -594,17 +536,16 @@ public ArtifactSourceInner get(String resourceGroupName, String labName, String * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); } /** @@ -617,7 +558,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -678,7 +619,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -735,7 +676,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -780,7 +721,7 @@ public ArtifactSourceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -797,7 +738,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { @@ -850,7 +791,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -900,7 +841,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -932,7 +873,7 @@ public void delete(String resourceGroupName, String labName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { @@ -945,11 +886,11 @@ public Response deleteWithResponse(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param artifactSource Allows modifying tags of artifact sources. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1005,12 +946,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param artifactSource Allows modifying tags of artifact sources. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1063,11 +1004,11 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param artifactSource Allows modifying tags of artifact sources. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1089,7 +1030,7 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param artifactSource Allows modifying tags of artifact sources. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1107,12 +1048,12 @@ public ArtifactSourceInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param artifactSource Properties of an artifact source. + * @param artifactSource Allows modifying tags of artifact sources. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of an artifact source. + * @return properties of an artifact source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1127,7 +1068,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1163,7 +1105,8 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java index 74e26b05001f..2092501686d1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactSourcesImpl.java @@ -34,15 +34,9 @@ public PagedIterable list(String resourceGroupName, String labNa } public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ArtifactSourceImpl(inner1, this.manager())); } @@ -56,9 +50,9 @@ public ArtifactSource get(String resourceGroupName, String labName, String name) } public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -102,11 +96,10 @@ public ArtifactSource getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'artifactsources'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -130,7 +123,7 @@ public Response getByIdWithResponse(String id, String expand, Co String .format("The resource ID '%s' is not valid. Missing path segment 'artifactsources'.", id))); } - return this.getWithResponse(resourceGroupName, labName, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, name, context); } public void deleteById(String id) { @@ -157,7 +150,7 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'artifactsources'.", id))); } - this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java index 01411fbb8b05..d2f74802fcbe 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsClientImpl.java @@ -75,7 +75,6 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -96,7 +95,6 @@ Mono> get( @PathParam("labName") String labName, @PathParam("artifactSourceName") String artifactSourceName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -136,21 +134,20 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby) { @@ -188,7 +185,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, artifactSourceName, - expand, filter, top, orderby, @@ -213,22 +209,21 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, @@ -265,7 +260,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, artifactSourceName, - expand, filter, top, orderby, @@ -289,26 +283,24 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -321,16 +313,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String artifactSourceName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -340,30 +331,26 @@ private PagedFlux listAsync(String resourceGroupName, String labN * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -376,16 +363,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String artifactSourceName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby)); } /** @@ -394,28 +379,26 @@ public PagedIterable list(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context)); + listAsync(resourceGroupName, labName, artifactSourceName, filter, top, orderby, context)); } /** @@ -425,15 +408,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return artifact along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String artifactSourceName, String name, String expand) { + String resourceGroupName, String labName, String artifactSourceName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -472,7 +454,6 @@ private Mono> getWithResponseAsync( labName, artifactSourceName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -486,21 +467,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return artifact along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context) { + String resourceGroupName, String labName, String artifactSourceName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -537,39 +512,11 @@ private Mono> getWithResponseAsync( labName, artifactSourceName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get artifact. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param artifactSourceName The name of the artifact source. - * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String artifactSourceName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get artifact. * @@ -580,13 +527,12 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return artifact on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String labName, String artifactSourceName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -611,8 +557,7 @@ private Mono getAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public ArtifactInner get(String resourceGroupName, String labName, String artifactSourceName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, artifactSourceName, name, expand).block(); + return getAsync(resourceGroupName, labName, artifactSourceName, name).block(); } /** @@ -622,22 +567,16 @@ public ArtifactInner get(String resourceGroupName, String labName, String artifa * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return artifact along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context) { - return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, expand, context).block(); + String resourceGroupName, String labName, String artifactSourceName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, artifactSourceName, name, context).block(); } /** @@ -652,7 +591,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a generated ARM template. + * @return information about a generated ARM template along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateArmTemplateWithResponseAsync( @@ -727,7 +667,8 @@ private Mono> generateArmTemplateWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 generated ARM template. + * @return information about a generated ARM template along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateArmTemplateWithResponseAsync( @@ -799,7 +740,7 @@ private Mono> generateArmTemplateWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 generated ARM template. + * @return information about a generated ARM template on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono generateArmTemplateAsync( @@ -859,7 +800,7 @@ public ArmTemplateInfoInner generateArmTemplate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 generated ARM template. + * @return information about a generated ARM template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response generateArmTemplateWithResponse( @@ -881,7 +822,8 @@ public Response generateArmTemplateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -917,7 +859,8 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java index ac03443ada82..c1d002fe693c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ArtifactsImpl.java @@ -40,15 +40,12 @@ public PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, labName, artifactSourceName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, artifactSourceName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ArtifactImpl(inner1, this.manager())); } @@ -62,14 +59,9 @@ public Artifact get(String resourceGroupName, String labName, String artifactSou } public Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context) { + String resourceGroupName, String labName, String artifactSourceName, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, artifactSourceName, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, artifactSourceName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostImpl.java new file mode 100644 index 000000000000..bc2feeea76f2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.BastionHostInner; +import com.azure.resourcemanager.devtestlabs.models.BastionHost; +import com.azure.resourcemanager.devtestlabs.models.BastionHostFragment; +import java.util.Collections; +import java.util.Map; + +public final class BastionHostImpl implements BastionHost, BastionHost.Definition, BastionHost.Update { + private BastionHostInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String externalBastionHostId() { + return this.innerModel().externalBastionHostId(); + } + + public String ipAddressId() { + return this.innerModel().ipAddressId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BastionHostInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String labName; + + private String virtualNetworkName; + + private String name; + + private BastionHostFragment updateBastionHost; + + public BastionHostImpl withExistingVirtualnetwork( + String resourceGroupName, String labName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.labName = labName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + public BastionHost create() { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .createOrUpdate(resourceGroupName, labName, virtualNetworkName, name, this.innerModel(), Context.NONE); + return this; + } + + public BastionHost create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .createOrUpdate(resourceGroupName, labName, virtualNetworkName, name, this.innerModel(), context); + return this; + } + + BastionHostImpl(String name, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = new BastionHostInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public BastionHostImpl update() { + this.updateBastionHost = new BastionHostFragment(); + return this; + } + + public BastionHost apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .updateWithResponse( + resourceGroupName, labName, virtualNetworkName, name, updateBastionHost, Context.NONE) + .getValue(); + return this; + } + + public BastionHost apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .updateWithResponse(resourceGroupName, labName, virtualNetworkName, name, updateBastionHost, context) + .getValue(); + return this; + } + + BastionHostImpl( + BastionHostInner innerObject, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualnetworks"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "bastionhosts"); + } + + public BastionHost refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .getWithResponse(resourceGroupName, labName, virtualNetworkName, name, Context.NONE) + .getValue(); + return this; + } + + public BastionHost refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBastionHosts() + .getWithResponse(resourceGroupName, labName, virtualNetworkName, name, context) + .getValue(); + return this; + } + + public BastionHostImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BastionHostImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BastionHostImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBastionHost.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostsClientImpl.java new file mode 100644 index 000000000000..00006222a6ac --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostsClientImpl.java @@ -0,0 +1,1540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.devtestlabs.fluent.BastionHostsClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.BastionHostInner; +import com.azure.resourcemanager.devtestlabs.models.BastionHostFragment; +import com.azure.resourcemanager.devtestlabs.models.BastionHostList; +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 BastionHostsClient. */ +public final class BastionHostsClientImpl implements BastionHostsClient { + private final ClientLogger logger = new ClientLogger(BastionHostsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BastionHostsService service; + + /** The service client containing this operation class. */ + private final DevTestLabsClientImpl client; + + /** + * Initializes an instance of BastionHostsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BastionHostsClientImpl(DevTestLabsClientImpl client) { + this.service = + RestProxy.create(BastionHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevTestLabsClientBastionHosts to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevTestLabsClientBas") + private interface BastionHostsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BastionHostInner bastionHost, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BastionHostFragment bastionHost, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby, + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, virtualNetworkName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String virtualNetworkName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, virtualNetworkName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, virtualNetworkName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String virtualNetworkName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, labName, virtualNetworkName, filter, top, orderby)); + } + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, labName, virtualNetworkName, filter, top, orderby, context)); + } + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name) { + return getWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner get(String resourceGroupName, String labName, String virtualNetworkName, String name) { + return getAsync(resourceGroupName, labName, virtualNetworkName, name).block(); + } + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name, context).block(); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 profile of a Bastion Host along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (bastionHost == null) { + return Mono.error(new IllegalArgumentException("Parameter bastionHost is required and cannot be null.")); + } else { + bastionHost.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + bastionHost, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 profile of a Bastion Host along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost, + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (bastionHost == null) { + return Mono.error(new IllegalArgumentException("Parameter bastionHost is required and cannot be null.")); + } else { + bastionHost.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + bastionHost, + accept, + context); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BastionHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionHostInner.class, + BastionHostInner.class, + this.client.getContext()); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 {@link PollerFlux} for polling of profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BastionHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BastionHostInner.class, BastionHostInner.class, context); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost) + .getSyncPoller(); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 {@link SyncPoller} for polling of profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, context) + .getSyncPoller(); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 profile of a Bastion Host on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 profile of a Bastion Host on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner createOrUpdate( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost) { + return createOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).block(); + } + + /** + * Create or replace an existing bastionHost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Profile of a Bastion 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 profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner createOrUpdate( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostInner bastionHost, + Context context) { + return createOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, context).block(); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String virtualNetworkName, String name) { + return beginDeleteAsync(resourceGroupName, labName, virtualNetworkName, name).getSyncPoller(); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, labName, virtualNetworkName, name, context).getSyncPoller(); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String labName, String virtualNetworkName, String name) { + return beginDeleteAsync(resourceGroupName, labName, virtualNetworkName, name) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, labName, virtualNetworkName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 labName, String virtualNetworkName, String name) { + deleteAsync(resourceGroupName, labName, virtualNetworkName, name).block(); + } + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 labName, String virtualNetworkName, String name, Context context) { + deleteAsync(resourceGroupName, labName, virtualNetworkName, name, context).block(); + } + + /** + * Allows modifying tags of bastionhosts. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Allows modifying tags of bastionhosts. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostFragment bastionHost) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (bastionHost == null) { + return Mono.error(new IllegalArgumentException("Parameter bastionHost is required and cannot be null.")); + } else { + bastionHost.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + bastionHost, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of bastionhosts. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Allows modifying tags of bastionhosts. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostFragment bastionHost, + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (bastionHost == null) { + return Mono.error(new IllegalArgumentException("Parameter bastionHost is required and cannot be null.")); + } else { + bastionHost.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualNetworkName, + name, + this.client.getApiVersion(), + bastionHost, + accept, + context); + } + + /** + * Allows modifying tags of bastionhosts. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Allows modifying tags of bastionhosts. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostFragment bastionHost) { + return updateWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Allows modifying tags of bastionhosts. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Allows modifying tags of bastionhosts. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner update( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostFragment bastionHost) { + return updateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).block(); + } + + /** + * Allows modifying tags of bastionhosts. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param bastionHost Allows modifying tags of bastionhosts. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return profile of a Bastion Host along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String labName, + String virtualNetworkName, + String name, + BastionHostFragment bastionHost, + Context context) { + return updateWithResponseAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostsImpl.java new file mode 100644 index 000000000000..86cc1fb8e39b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/BastionHostsImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.BastionHostsClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.BastionHostInner; +import com.azure.resourcemanager.devtestlabs.models.BastionHost; +import com.azure.resourcemanager.devtestlabs.models.BastionHosts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BastionHostsImpl implements BastionHosts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostsImpl.class); + + private final BastionHostsClient innerClient; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public BastionHostsImpl( + BastionHostsClient innerClient, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String labName, String virtualNetworkName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, virtualNetworkName); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, virtualNetworkName, filter, top, orderby, context); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public BastionHost get(String resourceGroupName, String labName, String virtualNetworkName, String name) { + BastionHostInner inner = this.serviceClient().get(resourceGroupName, labName, virtualNetworkName, name); + if (inner != null) { + return new BastionHostImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labName, virtualNetworkName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BastionHostImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String labName, String virtualNetworkName, String name) { + this.serviceClient().delete(resourceGroupName, labName, virtualNetworkName, name); + } + + public void delete( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, labName, virtualNetworkName, name, context); + } + + public BastionHost getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bastionhosts"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionhosts'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, virtualNetworkName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bastionhosts"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionhosts'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, virtualNetworkName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bastionhosts"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionhosts'.", id))); + } + this.delete(resourceGroupName, labName, virtualNetworkName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualnetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualnetworks'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bastionhosts"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionhosts'.", id))); + } + this.delete(resourceGroupName, labName, virtualNetworkName, name, context); + } + + private BastionHostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + public BastionHostImpl define(String name) { + return new BastionHostImpl(name, this.manager()); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java index a9ef6f533d92..1115a6f60dc2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsClientImpl.java @@ -18,6 +18,10 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; @@ -26,6 +30,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.fluent.CostsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner; +import com.azure.resourcemanager.devtestlabs.models.LabCostList; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in CostsClient. */ @@ -55,6 +60,25 @@ public final class CostsClientImpl implements CostsClient { @Host("{$host}") @ServiceInterface(name = "DevTestLabsClientCos") private interface CostsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/costs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" @@ -88,6 +112,270 @@ Mono> createOrUpdate( @BodyParam("application/json") LabCostInner labCost, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + expand, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String labName, + String expand, + String filter, + Integer top, + String orderby, + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + expand, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String labName, + String expand, + String filter, + Integer top, + String orderby, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + } + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String labName, + String expand, + String filter, + Integer top, + String orderby, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); } /** @@ -100,7 +388,7 @@ Mono> createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -156,7 +444,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -208,7 +496,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name, String expand) { @@ -232,7 +520,7 @@ private Mono getAsync(String resourceGroupName, String labName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { @@ -276,7 +564,7 @@ public LabCostInner get(String resourceGroupName, String labName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -294,7 +582,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a cost item. + * @return a cost item along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -355,7 +643,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a cost item. + * @return a cost item along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -412,7 +700,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a cost item. + * @return a cost item on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -456,11 +744,84 @@ public LabCostInner createOrUpdate(String resourceGroupName, String labName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a cost item. + * @return a cost item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( String resourceGroupName, String labName, String name, LabCostInner labCost, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, labCost, context).block(); } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java index d0f81cdb7314..a87a32e3d2a1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CostsImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.devtestlabs.implementation; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; @@ -26,6 +27,24 @@ public CostsImpl(CostsClient innerClient, com.azure.resourcemanager.devtestlabs. this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return Utils.mapPage(inner, inner1 -> new LabCostImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String labName, + String expand, + String filter, + Integer top, + String orderby, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + return Utils.mapPage(inner, inner1 -> new LabCostImpl(inner1, this.manager())); + } + public LabCost get(String resourceGroupName, String labName, String name) { LabCostInner inner = this.serviceClient().get(resourceGroupName, labName, name); if (inner != null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java index 47c121927ce2..e7cef7fc23a4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImageImpl.java @@ -5,14 +5,15 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageInner; import com.azure.resourcemanager.devtestlabs.models.CustomImage; import com.azure.resourcemanager.devtestlabs.models.CustomImageFragment; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesCustom; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromPlan; -import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm; +import com.azure.resourcemanager.devtestlabs.models.CustomImageOsType; import com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo; +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import com.azure.resourcemanager.devtestlabs.models.WindowsOsState; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -48,12 +49,8 @@ public Map tags() { } } - public CustomImagePropertiesFromVm vm() { - return this.innerModel().vm(); - } - - public CustomImagePropertiesCustom vhd() { - return this.innerModel().vhd(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String description() { @@ -85,10 +82,6 @@ public List dataDiskStorageInfo() { } } - public CustomImagePropertiesFromPlan customImagePlan() { - return this.innerModel().customImagePlan(); - } - public Boolean isPlanAuthorized() { return this.innerModel().isPlanAuthorized(); } @@ -101,6 +94,42 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } + public String sourceVmId() { + return this.innerModel().sourceVmId(); + } + + public WindowsOsState windowsOsState() { + return this.innerModel().windowsOsState(); + } + + public LinuxOsState linuxOsState() { + return this.innerModel().linuxOsState(); + } + + public String imageName() { + return this.innerModel().imageName(); + } + + public Boolean sysPrep() { + return this.innerModel().sysPrep(); + } + + public CustomImageOsType osType() { + return this.innerModel().osType(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String offer() { + return this.innerModel().offer(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -190,23 +219,21 @@ public CustomImage apply(Context context) { } public CustomImage refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getCustomImages() - .getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, name, Context.NONE) .getValue(); return this; } public CustomImage refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getCustomImages() - .getWithResponse(resourceGroupName, labName, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, name, context) .getValue(); return this; } @@ -231,16 +258,6 @@ public CustomImageImpl withTags(Map tags) { } } - public CustomImageImpl withVm(CustomImagePropertiesFromVm vm) { - this.innerModel().withVm(vm); - return this; - } - - public CustomImageImpl withVhd(CustomImagePropertiesCustom vhd) { - this.innerModel().withVhd(vhd); - return this; - } - public CustomImageImpl withDescription(String description) { this.innerModel().withDescription(description); return this; @@ -266,13 +283,53 @@ public CustomImageImpl withDataDiskStorageInfo(List dat return this; } - public CustomImageImpl withCustomImagePlan(CustomImagePropertiesFromPlan customImagePlan) { - this.innerModel().withCustomImagePlan(customImagePlan); + public CustomImageImpl withIsPlanAuthorized(Boolean isPlanAuthorized) { + this.innerModel().withIsPlanAuthorized(isPlanAuthorized); return this; } - public CustomImageImpl withIsPlanAuthorized(Boolean isPlanAuthorized) { - this.innerModel().withIsPlanAuthorized(isPlanAuthorized); + public CustomImageImpl withSourceVmId(String sourceVmId) { + this.innerModel().withSourceVmId(sourceVmId); + return this; + } + + public CustomImageImpl withWindowsOsState(WindowsOsState windowsOsState) { + this.innerModel().withWindowsOsState(windowsOsState); + return this; + } + + public CustomImageImpl withLinuxOsState(LinuxOsState linuxOsState) { + this.innerModel().withLinuxOsState(linuxOsState); + return this; + } + + public CustomImageImpl withImageName(String imageName) { + this.innerModel().withImageName(imageName); + return this; + } + + public CustomImageImpl withSysPrep(Boolean sysPrep) { + this.innerModel().withSysPrep(sysPrep); + return this; + } + + public CustomImageImpl withOsType(CustomImageOsType osType) { + this.innerModel().withOsType(osType); + return this; + } + + public CustomImageImpl withIdPropertiesId(String idPropertiesId) { + this.innerModel().withIdPropertiesId(idPropertiesId); + return this; + } + + public CustomImageImpl withPublisher(String publisher) { + this.innerModel().withPublisher(publisher); + return this; + } + + public CustomImageImpl withOffer(String offer) { + this.innerModel().withOffer(offer); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java index 99372da0c00e..6f0e54d664b9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesClientImpl.java @@ -80,7 +80,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -100,7 +99,6 @@ Mono> get( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -109,7 +107,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/customimages/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -171,18 +169,18 @@ Mono> listNext( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -212,7 +210,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -236,25 +233,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -282,7 +273,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -305,20 +295,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -330,16 +319,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -348,27 +336,20 @@ private PagedFlux listAsync(String resourceGroupName, String l * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -380,15 +361,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); } /** @@ -396,26 +376,19 @@ public PagedIterable list(String resourceGroupName, String lab * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -424,15 +397,14 @@ public PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. + * @return custom image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand) { + String resourceGroupName, String labName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -466,7 +438,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -479,16 +450,15 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. + * @return custom image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -520,7 +490,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); @@ -532,40 +501,14 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get custom image. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the custom 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 custom image. + * @return custom image on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -589,8 +532,7 @@ private Mono getAsync(String resourceGroupName, String labName */ @ServiceMethod(returns = ReturnType.SINGLE) public CustomImageInner get(String resourceGroupName, String labName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, name, expand).block(); + return getAsync(resourceGroupName, labName, name).block(); } /** @@ -599,17 +541,16 @@ public CustomImageInner get(String resourceGroupName, String labName, String nam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. + * @return custom image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); } /** @@ -622,7 +563,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image. + * @return a custom image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -683,7 +624,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image. + * @return a custom image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -740,9 +681,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image. + * @return the {@link PollerFlux} for polling of a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CustomImageInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, CustomImageInner customImage) { Mono>> mono = @@ -750,7 +691,11 @@ private PollerFlux, CustomImageInner> beginCreateOr return this .client .getLroResult( - mono, this.client.getHttpPipeline(), CustomImageInner.class, CustomImageInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + CustomImageInner.class, + CustomImageInner.class, + this.client.getContext()); } /** @@ -764,9 +709,9 @@ private PollerFlux, CustomImageInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return the {@link PollerFlux} for polling of a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CustomImageInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context) { context = this.client.mergeContext(context); @@ -788,9 +733,9 @@ private PollerFlux, CustomImageInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return the {@link SyncPoller} for polling of a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, customImage).getSyncPoller(); @@ -807,9 +752,9 @@ public SyncPoller, CustomImageInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return the {@link SyncPoller} for polling of a custom image. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomImageInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, CustomImageInner customImage, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, customImage, context).getSyncPoller(); @@ -825,7 +770,7 @@ public SyncPoller, CustomImageInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return a custom image on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -846,7 +791,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom image. + * @return a custom image on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -902,7 +847,7 @@ public CustomImageInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -956,7 +901,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1006,14 +951,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1026,9 +972,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1047,9 +993,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1064,9 +1010,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -1081,7 +1027,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -1098,7 +1044,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { @@ -1144,11 +1090,11 @@ public void delete(String resourceGroupName, String labName, String name, Contex * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param customImage A custom image. + * @param customImage Allows modifying tags of custom images. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return a custom image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1204,12 +1150,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param customImage A custom image. + * @param customImage Allows modifying tags of custom images. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return a custom image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1262,11 +1208,11 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param customImage A custom image. + * @param customImage Allows modifying tags of custom images. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return a custom image on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1288,7 +1234,7 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param customImage A custom image. + * @param customImage Allows modifying tags of custom images. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1306,12 +1252,12 @@ public CustomImageInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param customImage A custom image. + * @param customImage Allows modifying tags of custom images. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 custom image. + * @return a custom image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1326,7 +1272,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1362,7 +1309,8 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java index 397ca97fa4ed..218215453eca 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/CustomImagesImpl.java @@ -34,15 +34,9 @@ public PagedIterable list(String resourceGroupName, String labName) } public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new CustomImageImpl(inner1, this.manager())); } @@ -56,9 +50,9 @@ public CustomImage get(String resourceGroupName, String labName, String name) { } public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -101,11 +95,10 @@ public CustomImage getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'customimages'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -128,7 +121,7 @@ public Response getByIdWithResponse(String id, String expand, Conte new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'customimages'.", id))); } - return this.getWithResponse(resourceGroupName, labName, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, name, context); } public void deleteById(String id) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientImpl.java index db91d517d785..fe5f856f94be 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DevTestLabsClientImpl.java @@ -24,6 +24,7 @@ import com.azure.resourcemanager.devtestlabs.fluent.ArmTemplatesClient; import com.azure.resourcemanager.devtestlabs.fluent.ArtifactSourcesClient; import com.azure.resourcemanager.devtestlabs.fluent.ArtifactsClient; +import com.azure.resourcemanager.devtestlabs.fluent.BastionHostsClient; import com.azure.resourcemanager.devtestlabs.fluent.CostsClient; import com.azure.resourcemanager.devtestlabs.fluent.CustomImagesClient; import com.azure.resourcemanager.devtestlabs.fluent.DevTestLabsClient; @@ -32,6 +33,7 @@ import com.azure.resourcemanager.devtestlabs.fluent.FormulasClient; import com.azure.resourcemanager.devtestlabs.fluent.GalleryImagesClient; import com.azure.resourcemanager.devtestlabs.fluent.GlobalSchedulesClient; +import com.azure.resourcemanager.devtestlabs.fluent.LabSecretsClient; import com.azure.resourcemanager.devtestlabs.fluent.LabsClient; import com.azure.resourcemanager.devtestlabs.fluent.NotificationChannelsClient; import com.azure.resourcemanager.devtestlabs.fluent.OperationsClient; @@ -43,6 +45,8 @@ import com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricSchedulesClient; import com.azure.resourcemanager.devtestlabs.fluent.ServiceFabricsClient; import com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient; +import com.azure.resourcemanager.devtestlabs.fluent.SharedGalleriesClient; +import com.azure.resourcemanager.devtestlabs.fluent.SharedImagesClient; import com.azure.resourcemanager.devtestlabs.fluent.UsersClient; import com.azure.resourcemanager.devtestlabs.fluent.VirtualMachineSchedulesClient; import com.azure.resourcemanager.devtestlabs.fluent.VirtualMachinesClient; @@ -314,6 +318,18 @@ public SchedulesClient getSchedules() { return this.schedules; } + /** The LabSecretsClient object to access its operations. */ + private final LabSecretsClient labSecrets; + + /** + * Gets the LabSecretsClient object to access its operations. + * + * @return the LabSecretsClient object. + */ + public LabSecretsClient getLabSecrets() { + return this.labSecrets; + } + /** The ServiceRunnersClient object to access its operations. */ private final ServiceRunnersClient serviceRunners; @@ -326,6 +342,30 @@ public ServiceRunnersClient getServiceRunners() { return this.serviceRunners; } + /** The SharedGalleriesClient object to access its operations. */ + private final SharedGalleriesClient sharedGalleries; + + /** + * Gets the SharedGalleriesClient object to access its operations. + * + * @return the SharedGalleriesClient object. + */ + public SharedGalleriesClient getSharedGalleries() { + return this.sharedGalleries; + } + + /** The SharedImagesClient object to access its operations. */ + private final SharedImagesClient sharedImages; + + /** + * Gets the SharedImagesClient object to access its operations. + * + * @return the SharedImagesClient object. + */ + public SharedImagesClient getSharedImages() { + return this.sharedImages; + } + /** The UsersClient object to access its operations. */ private final UsersClient users; @@ -434,6 +474,18 @@ public VirtualNetworksClient getVirtualNetworks() { return this.virtualNetworks; } + /** The BastionHostsClient object to access its operations. */ + private final BastionHostsClient bastionHosts; + + /** + * Gets the BastionHostsClient object to access its operations. + * + * @return the BastionHostsClient object. + */ + public BastionHostsClient getBastionHosts() { + return this.bastionHosts; + } + /** * Initializes an instance of DevTestLabsClient client. * @@ -456,7 +508,7 @@ public VirtualNetworksClient getVirtualNetworks() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-09-15"; + this.apiVersion = "2021-09-01"; this.providerOperations = new ProviderOperationsClientImpl(this); this.labs = new LabsClientImpl(this); this.operations = new OperationsClientImpl(this); @@ -472,7 +524,10 @@ public VirtualNetworksClient getVirtualNetworks() { this.policySets = new PolicySetsClientImpl(this); this.policies = new PoliciesClientImpl(this); this.schedules = new SchedulesClientImpl(this); + this.labSecrets = new LabSecretsClientImpl(this); this.serviceRunners = new ServiceRunnersClientImpl(this); + this.sharedGalleries = new SharedGalleriesClientImpl(this); + this.sharedImages = new SharedImagesClientImpl(this); this.users = new UsersClientImpl(this); this.disks = new DisksClientImpl(this); this.environments = new EnvironmentsClientImpl(this); @@ -482,6 +537,7 @@ public VirtualNetworksClient getVirtualNetworks() { this.virtualMachines = new VirtualMachinesClientImpl(this); this.virtualMachineSchedules = new VirtualMachineSchedulesClientImpl(this); this.virtualNetworks = new VirtualNetworksClientImpl(this); + this.bastionHosts = new BastionHostsClientImpl(this); } /** diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java index 6cc7ec9750ae..bce4edbc87bf 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DiskImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner; import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; @@ -46,6 +47,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public StorageType diskType() { return this.innerModel().diskType(); } @@ -182,23 +187,21 @@ public Disk apply(Context context) { } public Disk refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getDisks() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, username, name, Context.NONE) .getValue(); return this; } public Disk refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getDisks() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, username, name, context) .getValue(); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java index bb987f61fa98..6211661f7bb5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksClientImpl.java @@ -83,7 +83,6 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("userName") String username, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -104,7 +103,6 @@ Mono> get( @PathParam("labName") String labName, @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -113,7 +111,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/users/{userName}/disks/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -215,24 +213,18 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of disks and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String username, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String username, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -266,7 +258,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, username, - expand, filter, top, orderby, @@ -291,22 +282,21 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of disks and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -342,7 +332,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, username, - expand, filter, top, orderby, @@ -366,26 +355,19 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String username, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String username, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -398,16 +380,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String username) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -417,28 +398,26 @@ private PagedFlux listAsync(String resourceGroupName, String labName, * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -451,15 +430,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String username) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, username, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, username, filter, top, orderby)); } /** @@ -468,28 +446,25 @@ public PagedIterable list(String resourceGroupName, String labName, S * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, username, filter, top, orderby, context)); } /** @@ -499,15 +474,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return disk along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String username, String name, String expand) { + String resourceGroupName, String labName, String username, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -545,7 +519,6 @@ private Mono> getWithResponseAsync( labName, username, name, - expand, this.client.getApiVersion(), accept, context)) @@ -559,16 +532,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return disk along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { + String resourceGroupName, String labName, String username, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -604,7 +576,6 @@ private Mono> getWithResponseAsync( labName, username, name, - expand, this.client.getApiVersion(), accept, context); @@ -617,42 +588,14 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String username, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get disk. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the 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 disk. + * @return disk on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String username, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) + return getWithResponseAsync(resourceGroupName, labName, username, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -677,8 +620,7 @@ private Mono getAsync(String resourceGroupName, String labName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public DiskInner get(String resourceGroupName, String labName, String username, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, username, name, expand).block(); + return getAsync(resourceGroupName, labName, username, name).block(); } /** @@ -688,17 +630,16 @@ public DiskInner get(String resourceGroupName, String labName, String username, * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand, context).block(); + String resourceGroupName, String labName, String username, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, username, name, context).block(); } /** @@ -712,7 +653,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk. + * @return a Disk along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -778,7 +719,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk. + * @return a Disk along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -840,9 +781,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk. + * @return the {@link PollerFlux} for polling of a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DiskInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, DiskInner disk) { Mono>> mono = @@ -850,7 +791,7 @@ private PollerFlux, DiskInner> beginCreateOrUpdateAsync( return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), DiskInner.class, DiskInner.class, this.client.getContext()); } /** @@ -865,9 +806,9 @@ private PollerFlux, DiskInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link PollerFlux} for polling of a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DiskInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, DiskInner disk, Context context) { context = this.client.mergeContext(context); @@ -890,9 +831,9 @@ private PollerFlux, DiskInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link SyncPoller} for polling of a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk).getSyncPoller(); @@ -910,9 +851,9 @@ public SyncPoller, DiskInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link SyncPoller} for polling of a Disk. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DiskInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DiskInner disk, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, disk, context).getSyncPoller(); @@ -929,7 +870,7 @@ public SyncPoller, DiskInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a Disk on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -951,7 +892,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Disk. + * @return a Disk on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -1010,7 +951,7 @@ public DiskInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1069,7 +1010,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1124,15 +1065,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String username, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1146,9 +1088,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String username, String name, Context context) { context = this.client.mergeContext(context); @@ -1169,9 +1111,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name) { return beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1188,9 +1130,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -1206,7 +1148,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { @@ -1226,7 +1168,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1276,11 +1218,11 @@ public void delete(String resourceGroupName, String labName, String username, St * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param disk A Disk. + * @param disk Allows modifying tags of disks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a Disk along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1341,12 +1283,12 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param disk A Disk. + * @param disk Allows modifying tags of disks. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a Disk along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1404,11 +1346,11 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param disk A Disk. + * @param disk Allows modifying tags of disks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a Disk on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1431,7 +1373,7 @@ private Mono updateAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param disk A Disk. + * @param disk Allows modifying tags of disks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1449,12 +1391,12 @@ public DiskInner update(String resourceGroupName, String labName, String usernam * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param disk A Disk. + * @param disk Allows modifying tags of disks. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a Disk along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1473,7 +1415,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> attachWithResponseAsync( @@ -1544,7 +1486,7 @@ private Mono>> attachWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> attachWithResponseAsync( @@ -1612,9 +1554,9 @@ private Mono>> attachWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAttachAsync( String resourceGroupName, String labName, @@ -1625,7 +1567,8 @@ private PollerFlux, Void> beginAttachAsync( attachWithResponseAsync(resourceGroupName, labName, username, name, attachDiskProperties); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1640,9 +1583,9 @@ private PollerFlux, Void> beginAttachAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAttachAsync( String resourceGroupName, String labName, @@ -1669,9 +1612,9 @@ private PollerFlux, Void> beginAttachAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -1693,9 +1636,9 @@ public SyncPoller, Void> beginAttach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAttach( String resourceGroupName, String labName, @@ -1718,7 +1661,7 @@ public SyncPoller, Void> beginAttach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono attachAsync( @@ -1744,7 +1687,7 @@ private Mono attachAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono attachAsync( @@ -1817,7 +1760,7 @@ public void attach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> detachWithResponseAsync( @@ -1889,7 +1832,7 @@ private Mono>> detachWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> detachWithResponseAsync( @@ -1958,9 +1901,9 @@ private Mono>> detachWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachAsync( String resourceGroupName, String labName, @@ -1971,7 +1914,8 @@ private PollerFlux, Void> beginDetachAsync( detachWithResponseAsync(resourceGroupName, labName, username, name, detachDiskProperties); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1987,9 +1931,9 @@ private PollerFlux, Void> beginDetachAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachAsync( String resourceGroupName, String labName, @@ -2017,9 +1961,9 @@ private PollerFlux, Void> beginDetachAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetach( String resourceGroupName, String labName, @@ -2042,9 +1986,9 @@ public SyncPoller, Void> beginDetach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetach( String resourceGroupName, String labName, @@ -2068,7 +2012,7 @@ public SyncPoller, Void> beginDetach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono detachAsync( @@ -2095,7 +2039,7 @@ private Mono detachAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono detachAsync( @@ -2165,7 +2109,8 @@ public void detach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of disks and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2201,7 +2146,8 @@ private Mono> listNextSinglePageAsync(String nextLink) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of disks and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java index 565a3870f4b4..4e8fd06f9efc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DisksImpl.java @@ -38,13 +38,12 @@ public PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, username, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, username, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new DiskImpl(inner1, this.manager())); } @@ -58,9 +57,9 @@ public Disk get(String resourceGroupName, String labName, String username, Strin } public Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { + String resourceGroupName, String labName, String username, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -148,11 +147,10 @@ public Disk getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, username, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -182,7 +180,7 @@ public Response getByIdWithResponse(String id, String expand, Context cont new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id))); } - return this.getWithResponse(resourceGroupName, labName, username, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, username, name, context); } public void deleteById(String id) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java index bf5c1ce014e2..723c41ac79c1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/DtlEnvironmentImpl.java @@ -5,12 +5,14 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DtlEnvironmentInner; +import com.azure.resourcemanager.devtestlabs.models.ArmTemplateParameterProperties; import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; import com.azure.resourcemanager.devtestlabs.models.DtlEnvironmentFragment; -import com.azure.resourcemanager.devtestlabs.models.EnvironmentDeploymentProperties; import java.util.Collections; +import java.util.List; import java.util.Map; public final class DtlEnvironmentImpl implements DtlEnvironment, DtlEnvironment.Definition, DtlEnvironment.Update { @@ -43,8 +45,8 @@ public Map tags() { } } - public EnvironmentDeploymentProperties deploymentProperties() { - return this.innerModel().deploymentProperties(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String armTemplateDisplayName() { @@ -67,6 +69,19 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } + public String armTemplateId() { + return this.innerModel().armTemplateId(); + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -160,23 +175,21 @@ public DtlEnvironment apply(Context context) { } public DtlEnvironment refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getEnvironments() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, username, name, Context.NONE) .getValue(); return this; } public DtlEnvironment refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getEnvironments() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, username, name, context) .getValue(); return this; } @@ -201,13 +214,18 @@ public DtlEnvironmentImpl withTags(Map tags) { } } - public DtlEnvironmentImpl withDeploymentProperties(EnvironmentDeploymentProperties deploymentProperties) { - this.innerModel().withDeploymentProperties(deploymentProperties); + public DtlEnvironmentImpl withArmTemplateDisplayName(String armTemplateDisplayName) { + this.innerModel().withArmTemplateDisplayName(armTemplateDisplayName); return this; } - public DtlEnvironmentImpl withArmTemplateDisplayName(String armTemplateDisplayName) { - this.innerModel().withArmTemplateDisplayName(armTemplateDisplayName); + public DtlEnvironmentImpl withArmTemplateId(String armTemplateId) { + this.innerModel().withArmTemplateId(armTemplateId); + return this; + } + + public DtlEnvironmentImpl withParameters(List parameters) { + this.innerModel().withParameters(parameters); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java index 4d2a24c43e5a..683f534c1a3c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsClientImpl.java @@ -81,7 +81,6 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("userName") String username, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -102,7 +101,6 @@ Mono> get( @PathParam("labName") String labName, @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -111,7 +109,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/users/{userName}/environments/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -177,24 +175,18 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of environments and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String username, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String username, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -228,7 +220,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, username, - expand, filter, top, orderby, @@ -253,22 +244,21 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of environments and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -304,7 +294,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, username, - expand, filter, top, orderby, @@ -328,26 +317,19 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String username, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String username, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -360,16 +342,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String username) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -379,28 +360,26 @@ private PagedFlux listAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -413,15 +392,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String username) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, username, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, username, filter, top, orderby)); } /** @@ -430,28 +408,25 @@ public PagedIterable list(String resourceGroupName, String * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, username, filter, top, orderby, context)); } /** @@ -461,15 +436,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String username, String name, String expand) { + String resourceGroupName, String labName, String username, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -507,7 +481,6 @@ private Mono> getWithResponseAsync( labName, username, name, - expand, this.client.getApiVersion(), accept, context)) @@ -521,16 +494,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { + String resourceGroupName, String labName, String username, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -566,7 +538,6 @@ private Mono> getWithResponseAsync( labName, username, name, - expand, this.client.getApiVersion(), accept, context); @@ -579,42 +550,14 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String username, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String username, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) + return getWithResponseAsync(resourceGroupName, labName, username, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -639,8 +582,7 @@ private Mono getAsync(String resourceGroupName, String labN */ @ServiceMethod(returns = ReturnType.SINGLE) public DtlEnvironmentInner get(String resourceGroupName, String labName, String username, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, username, name, expand).block(); + return getAsync(resourceGroupName, labName, username, name).block(); } /** @@ -650,17 +592,16 @@ public DtlEnvironmentInner get(String resourceGroupName, String labName, String * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand, context).block(); + String resourceGroupName, String labName, String username, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, username, name, context).block(); } /** @@ -674,7 +615,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -740,7 +682,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -807,9 +750,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment, which is essentially an ARM template deployment. + * @return the {@link PollerFlux} for polling of an environment, which is essentially an ARM template deployment. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DtlEnvironmentInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment) { Mono>> mono = @@ -821,7 +764,7 @@ private PollerFlux, DtlEnvironmentInner> beginCr this.client.getHttpPipeline(), DtlEnvironmentInner.class, DtlEnvironmentInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -836,9 +779,9 @@ private PollerFlux, DtlEnvironmentInner> beginCr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return the {@link PollerFlux} for polling of an environment, which is essentially an ARM template deployment. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DtlEnvironmentInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, @@ -866,9 +809,9 @@ private PollerFlux, DtlEnvironmentInner> beginCr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return the {@link SyncPoller} for polling of an environment, which is essentially an ARM template deployment. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, DtlEnvironmentInner dtlEnvironment) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, dtlEnvironment).getSyncPoller(); @@ -886,9 +829,9 @@ public SyncPoller, DtlEnvironmentInner> beginCre * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return the {@link SyncPoller} for polling of an environment, which is essentially an ARM template deployment. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DtlEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -911,7 +854,7 @@ public SyncPoller, DtlEnvironmentInner> beginCre * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -933,7 +876,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -1002,7 +945,7 @@ public DtlEnvironmentInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1061,7 +1004,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1116,15 +1059,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String username, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1138,9 +1082,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String username, String name, Context context) { context = this.client.mergeContext(context); @@ -1161,9 +1105,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name) { return beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1180,9 +1124,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -1198,7 +1142,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { @@ -1218,7 +1162,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1268,11 +1212,12 @@ public void delete(String resourceGroupName, String labName, String username, St * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param dtlEnvironment Allows modifying tags of environments. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1333,12 +1278,13 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param dtlEnvironment Allows modifying tags of environments. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1401,11 +1347,11 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param dtlEnvironment Allows modifying tags of environments. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1428,7 +1374,7 @@ private Mono updateAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param dtlEnvironment Allows modifying tags of environments. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1447,12 +1393,12 @@ public DtlEnvironmentInner update( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param dtlEnvironment An environment, which is essentially an ARM template deployment. + * @param dtlEnvironment Allows modifying tags of environments. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 environment, which is essentially an ARM template deployment. + * @return an environment, which is essentially an ARM template deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1472,7 +1418,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of environments and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1508,7 +1455,8 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of environments and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java index 398728482f71..49ee1e1d08ee 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/EnvironmentsImpl.java @@ -37,13 +37,12 @@ public PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, username, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, username, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new DtlEnvironmentImpl(inner1, this.manager())); } @@ -57,9 +56,9 @@ public DtlEnvironment get(String resourceGroupName, String labName, String usern } public Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { + String resourceGroupName, String labName, String username, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -109,11 +108,10 @@ public DtlEnvironment getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, username, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -143,7 +141,7 @@ public Response getByIdWithResponse(String id, String expand, Co new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); } - return this.getWithResponse(resourceGroupName, labName, username, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, username, name, context); } public void deleteById(String id) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java index 7dc772b16231..003f70fd4cc6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaImpl.java @@ -5,14 +5,23 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.FormulaInner; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.azure.resourcemanager.devtestlabs.models.Formula; import com.azure.resourcemanager.devtestlabs.models.FormulaFragment; -import com.azure.resourcemanager.devtestlabs.models.FormulaPropertiesFromVm; -import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; public final class FormulaImpl implements Formula, Formula.Definition, Formula.Update { @@ -45,6 +54,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String description() { return this.innerModel().description(); } @@ -61,14 +74,6 @@ public OffsetDateTime creationDate() { return this.innerModel().creationDate(); } - public LabVirtualMachineCreationParameter formulaContent() { - return this.innerModel().formulaContent(); - } - - public FormulaPropertiesFromVm vm() { - return this.innerModel().vm(); - } - public String provisioningState() { return this.innerModel().provisioningState(); } @@ -77,6 +82,379 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String locationPropertiesLocation() { + return this.innerModel().locationPropertiesLocation(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String notes() { + return this.innerModel().notes(); + } + + public String ownerObjectId() { + return this.innerModel().ownerObjectId(); + } + + public String ownerUserPrincipalName() { + return this.innerModel().ownerUserPrincipalName(); + } + + public String createdByUserId() { + return this.innerModel().createdByUserId(); + } + + public String createdByUser() { + return this.innerModel().createdByUser(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String computeId() { + return this.innerModel().computeId(); + } + + public String customImageId() { + return this.innerModel().customImageId(); + } + + public String galleryImageVersionId() { + return this.innerModel().galleryImageVersionId(); + } + + public String sharedImageId() { + return this.innerModel().sharedImageId(); + } + + public String sharedImageVersion() { + return this.innerModel().sharedImageVersion(); + } + + public String osTypeFormulaContentOsType() { + return this.innerModel().osTypeFormulaContentOsType(); + } + + public String size() { + return this.innerModel().size(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public String sshKey() { + return this.innerModel().sshKey(); + } + + public Boolean isAuthenticationWithSshKey() { + return this.innerModel().isAuthenticationWithSshKey(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String labSubnetName() { + return this.innerModel().labSubnetName(); + } + + public String labVirtualNetworkId() { + return this.innerModel().labVirtualNetworkId(); + } + + public Boolean disallowPublicIpAddress() { + return this.innerModel().disallowPublicIpAddress(); + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String planId() { + return this.innerModel().planId(); + } + + public Integer osDiskSizeGb() { + return this.innerModel().osDiskSizeGb(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public Boolean allowClaim() { + return this.innerModel().allowClaim(); + } + + public StorageType storageType() { + return this.innerModel().storageType(); + } + + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerModel().virtualMachineCreationSource(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public List dataDiskParameters() { + List inner = this.innerModel().dataDiskParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scheduleParameters() { + List inner = this.innerModel().scheduleParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String lastKnownPowerState() { + return this.innerModel().lastKnownPowerState(); + } + + public Boolean canApplyArtifacts() { + return this.innerModel().canApplyArtifacts(); + } + + public String provisioningStateFormulaContentProvisioningState() { + return this.innerModel().provisioningStateFormulaContentProvisioningState(); + } + + public String uniqueIdentifierFormulaContentUniqueIdentifier() { + return this.innerModel().uniqueIdentifierFormulaContentUniqueIdentifier(); + } + + public Integer instanceCount() { + return this.innerModel().instanceCount(); + } + + public String deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public Integer artifactsApplied() { + return this.innerModel().artifactsApplied(); + } + + public Integer totalArtifacts() { + return this.innerModel().totalArtifacts(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String osTypeGalleryImageReferenceOsType() { + return this.innerModel().osTypeGalleryImageReferenceOsType(); + } + + public String version() { + return this.innerModel().version(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osTypeComputeVmOsType() { + return this.innerModel().osTypeComputeVmOsType(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String networkInterfaceId() { + return this.innerModel().networkInterfaceId(); + } + + public String osDiskId() { + return this.innerModel().osDiskId(); + } + + public List dataDiskIds() { + List inner = this.innerModel().dataDiskIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dataDisks() { + List inner = this.innerModel().dataDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String virtualNetworkId() { + return this.innerModel().virtualNetworkId(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String publicIpAddressId() { + return this.innerModel().publicIpAddressId(); + } + + public String publicIpAddress() { + return this.innerModel().publicIpAddress(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String rdpAuthority() { + return this.innerModel().rdpAuthority(); + } + + public String sshAuthority() { + return this.innerModel().sshAuthority(); + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerModel().createdDateApplicableScheduleCreatedDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String labVmId() { + return this.innerModel().labVmId(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -165,23 +543,21 @@ public Formula apply(Context context) { } public Formula refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getFormulas() - .getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, name, Context.NONE) .getValue(); return this; } public Formula refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getFormulas() - .getWithResponse(resourceGroupName, labName, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, name, context) .getValue(); return this; } @@ -216,13 +592,223 @@ public FormulaImpl withOsType(String osType) { return this; } - public FormulaImpl withFormulaContent(LabVirtualMachineCreationParameter formulaContent) { - this.innerModel().withFormulaContent(formulaContent); + public FormulaImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; + } + + public FormulaImpl withLocationPropertiesLocation(String locationPropertiesLocation) { + this.innerModel().withLocationPropertiesLocation(locationPropertiesLocation); + return this; + } + + public FormulaImpl withTagsPropertiesTags(Map tagsPropertiesTags) { + this.innerModel().withTagsPropertiesTags(tagsPropertiesTags); + return this; + } + + public FormulaImpl withNotes(String notes) { + this.innerModel().withNotes(notes); + return this; + } + + public FormulaImpl withOwnerObjectId(String ownerObjectId) { + this.innerModel().withOwnerObjectId(ownerObjectId); + return this; + } + + public FormulaImpl withOwnerUserPrincipalName(String ownerUserPrincipalName) { + this.innerModel().withOwnerUserPrincipalName(ownerUserPrincipalName); + return this; + } + + public FormulaImpl withCreatedDate(OffsetDateTime createdDate) { + this.innerModel().withCreatedDate(createdDate); + return this; + } + + public FormulaImpl withCustomImageId(String customImageId) { + this.innerModel().withCustomImageId(customImageId); + return this; + } + + public FormulaImpl withGalleryImageVersionId(String galleryImageVersionId) { + this.innerModel().withGalleryImageVersionId(galleryImageVersionId); + return this; + } + + public FormulaImpl withSharedImageId(String sharedImageId) { + this.innerModel().withSharedImageId(sharedImageId); + return this; + } + + public FormulaImpl withSharedImageVersion(String sharedImageVersion) { + this.innerModel().withSharedImageVersion(sharedImageVersion); + return this; + } + + public FormulaImpl withSize(String size) { + this.innerModel().withSize(size); + return this; + } + + public FormulaImpl withUsername(String username) { + this.innerModel().withUsername(username); + return this; + } + + public FormulaImpl withPassword(String password) { + this.innerModel().withPassword(password); + return this; + } + + public FormulaImpl withSshKey(String sshKey) { + this.innerModel().withSshKey(sshKey); + return this; + } + + public FormulaImpl withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { + this.innerModel().withIsAuthenticationWithSshKey(isAuthenticationWithSshKey); + return this; + } + + public FormulaImpl withLabSubnetName(String labSubnetName) { + this.innerModel().withLabSubnetName(labSubnetName); + return this; + } + + public FormulaImpl withLabVirtualNetworkId(String labVirtualNetworkId) { + this.innerModel().withLabVirtualNetworkId(labVirtualNetworkId); + return this; + } + + public FormulaImpl withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { + this.innerModel().withDisallowPublicIpAddress(disallowPublicIpAddress); + return this; + } + + public FormulaImpl withArtifacts(List artifacts) { + this.innerModel().withArtifacts(artifacts); + return this; + } + + public FormulaImpl withPlanId(String planId) { + this.innerModel().withPlanId(planId); + return this; + } + + public FormulaImpl withOsDiskSizeGb(Integer osDiskSizeGb) { + this.innerModel().withOsDiskSizeGb(osDiskSizeGb); + return this; + } + + public FormulaImpl withExpirationDate(OffsetDateTime expirationDate) { + this.innerModel().withExpirationDate(expirationDate); + return this; + } + + public FormulaImpl withAllowClaim(Boolean allowClaim) { + this.innerModel().withAllowClaim(allowClaim); + return this; + } + + public FormulaImpl withStorageType(StorageType storageType) { + this.innerModel().withStorageType(storageType); + return this; + } + + public FormulaImpl withEnvironmentId(String environmentId) { + this.innerModel().withEnvironmentId(environmentId); + return this; + } + + public FormulaImpl withDataDiskParameters(List dataDiskParameters) { + this.innerModel().withDataDiskParameters(dataDiskParameters); + return this; + } + + public FormulaImpl withScheduleParameters(List scheduleParameters) { + this.innerModel().withScheduleParameters(scheduleParameters); + return this; + } + + public FormulaImpl withInstanceCount(Integer instanceCount) { + this.innerModel().withInstanceCount(instanceCount); + return this; + } + + public FormulaImpl withOffer(String offer) { + this.innerModel().withOffer(offer); + return this; + } + + public FormulaImpl withPublisher(String publisher) { + this.innerModel().withPublisher(publisher); + return this; + } + + public FormulaImpl withSku(String sku) { + this.innerModel().withSku(sku); + return this; + } + + public FormulaImpl withOsTypeGalleryImageReferenceOsType(String osTypeGalleryImageReferenceOsType) { + this.innerModel().withOsTypeGalleryImageReferenceOsType(osTypeGalleryImageReferenceOsType); + return this; + } + + public FormulaImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public FormulaImpl withVirtualNetworkId(String virtualNetworkId) { + this.innerModel().withVirtualNetworkId(virtualNetworkId); + return this; + } + + public FormulaImpl withSubnetId(String subnetId) { + this.innerModel().withSubnetId(subnetId); + return this; + } + + public FormulaImpl withPublicIpAddressId(String publicIpAddressId) { + this.innerModel().withPublicIpAddressId(publicIpAddressId); + return this; + } + + public FormulaImpl withPublicIpAddress(String publicIpAddress) { + this.innerModel().withPublicIpAddress(publicIpAddress); + return this; + } + + public FormulaImpl withPrivateIpAddress(String privateIpAddress) { + this.innerModel().withPrivateIpAddress(privateIpAddress); + return this; + } + + public FormulaImpl withDnsName(String dnsName) { + this.innerModel().withDnsName(dnsName); + return this; + } + + public FormulaImpl withRdpAuthority(String rdpAuthority) { + this.innerModel().withRdpAuthority(rdpAuthority); + return this; + } + + public FormulaImpl withSshAuthority(String sshAuthority) { + this.innerModel().withSshAuthority(sshAuthority); + return this; + } + + public FormulaImpl withInboundNatRules(List inboundNatRules) { + this.innerModel().withInboundNatRules(inboundNatRules); return this; } - public FormulaImpl withVm(FormulaPropertiesFromVm vm) { - this.innerModel().withVm(vm); + public FormulaImpl withLabVmId(String labVmId) { + this.innerModel().withLabVmId(labVmId); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaPropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaPropertiesImpl.java new file mode 100644 index 000000000000..536fd4b7445e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulaPropertiesImpl.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.FormulaPropertiesInner; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.FormulaProperties; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FormulaPropertiesImpl implements FormulaProperties { + private FormulaPropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + FormulaPropertiesImpl( + FormulaPropertiesInner innerObject, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String description() { + return this.innerModel().description(); + } + + public String author() { + return this.innerModel().author(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String notes() { + return this.innerModel().notes(); + } + + public String ownerObjectId() { + return this.innerModel().ownerObjectId(); + } + + public String ownerUserPrincipalName() { + return this.innerModel().ownerUserPrincipalName(); + } + + public String createdByUserId() { + return this.innerModel().createdByUserId(); + } + + public String createdByUser() { + return this.innerModel().createdByUser(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String computeId() { + return this.innerModel().computeId(); + } + + public String customImageId() { + return this.innerModel().customImageId(); + } + + public String galleryImageVersionId() { + return this.innerModel().galleryImageVersionId(); + } + + public String sharedImageId() { + return this.innerModel().sharedImageId(); + } + + public String sharedImageVersion() { + return this.innerModel().sharedImageVersion(); + } + + public String osTypeFormulaContentOsType() { + return this.innerModel().osTypeFormulaContentOsType(); + } + + public String size() { + return this.innerModel().size(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public String sshKey() { + return this.innerModel().sshKey(); + } + + public Boolean isAuthenticationWithSshKey() { + return this.innerModel().isAuthenticationWithSshKey(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String labSubnetName() { + return this.innerModel().labSubnetName(); + } + + public String labVirtualNetworkId() { + return this.innerModel().labVirtualNetworkId(); + } + + public Boolean disallowPublicIpAddress() { + return this.innerModel().disallowPublicIpAddress(); + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String planId() { + return this.innerModel().planId(); + } + + public Integer osDiskSizeGb() { + return this.innerModel().osDiskSizeGb(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public Boolean allowClaim() { + return this.innerModel().allowClaim(); + } + + public StorageType storageType() { + return this.innerModel().storageType(); + } + + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerModel().virtualMachineCreationSource(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public List dataDiskParameters() { + List inner = this.innerModel().dataDiskParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scheduleParameters() { + List inner = this.innerModel().scheduleParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String lastKnownPowerState() { + return this.innerModel().lastKnownPowerState(); + } + + public Boolean canApplyArtifacts() { + return this.innerModel().canApplyArtifacts(); + } + + public String provisioningStateFormulaContentProvisioningState() { + return this.innerModel().provisioningStateFormulaContentProvisioningState(); + } + + public String uniqueIdentifierFormulaContentUniqueIdentifier() { + return this.innerModel().uniqueIdentifierFormulaContentUniqueIdentifier(); + } + + public Integer instanceCount() { + return this.innerModel().instanceCount(); + } + + public String deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public Integer artifactsApplied() { + return this.innerModel().artifactsApplied(); + } + + public Integer totalArtifacts() { + return this.innerModel().totalArtifacts(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String osTypeGalleryImageReferenceOsType() { + return this.innerModel().osTypeGalleryImageReferenceOsType(); + } + + public String version() { + return this.innerModel().version(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osTypeComputeVmOsType() { + return this.innerModel().osTypeComputeVmOsType(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String networkInterfaceId() { + return this.innerModel().networkInterfaceId(); + } + + public String osDiskId() { + return this.innerModel().osDiskId(); + } + + public List dataDiskIds() { + List inner = this.innerModel().dataDiskIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dataDisks() { + List inner = this.innerModel().dataDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String virtualNetworkId() { + return this.innerModel().virtualNetworkId(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String publicIpAddressId() { + return this.innerModel().publicIpAddressId(); + } + + public String publicIpAddress() { + return this.innerModel().publicIpAddress(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String rdpAuthority() { + return this.innerModel().rdpAuthority(); + } + + public String sshAuthority() { + return this.innerModel().sshAuthority(); + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerModel().createdDateApplicableScheduleCreatedDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String id() { + return this.innerModel().id(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String type() { + return this.innerModel().type(); + } + + public String locationPropertiesLocation() { + return this.innerModel().locationPropertiesLocation(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String labVmId() { + return this.innerModel().labVmId(); + } + + public FormulaPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java index e60243fca89b..40d93204dc40 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasClientImpl.java @@ -79,7 +79,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -99,7 +98,6 @@ Mono> get( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -108,7 +106,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/formulas/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -170,18 +168,18 @@ Mono> listNext( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -211,7 +209,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -235,25 +232,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -281,7 +272,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -304,20 +294,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -329,16 +318,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -347,27 +335,20 @@ private PagedFlux listAsync(String resourceGroupName, String labNa * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -379,15 +360,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); } /** @@ -395,26 +375,19 @@ public PagedIterable list(String resourceGroupName, String labName * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -423,15 +396,13 @@ public PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand) { + private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -465,7 +436,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -478,16 +448,15 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -519,37 +488,11 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get formula. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the formula. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get formula. * @@ -559,12 +502,11 @@ private Mono getAsync(String resourceGroupName, String labName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -588,8 +530,7 @@ private Mono getAsync(String resourceGroupName, String labName, St */ @ServiceMethod(returns = ReturnType.SINGLE) public FormulaInner get(String resourceGroupName, String labName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, name, expand).block(); + return getAsync(resourceGroupName, labName, name).block(); } /** @@ -598,21 +539,20 @@ public FormulaInner get(String resourceGroupName, String labName, String name) { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -621,7 +561,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -672,7 +613,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -682,7 +623,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -730,7 +672,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -739,9 +681,10 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters. + * @return the {@link PollerFlux} for polling of a formula for creating a VM, specifying an image base and other + * parameters. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, FormulaInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, FormulaInner formula) { Mono>> mono = @@ -749,11 +692,11 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs return this .client .getLroResult( - mono, this.client.getHttpPipeline(), FormulaInner.class, FormulaInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), FormulaInner.class, FormulaInner.class, this.client.getContext()); } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -763,9 +706,10 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return the {@link PollerFlux} for polling of a formula for creating a VM, specifying an image base and other + * parameters. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, FormulaInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, FormulaInner formula, Context context) { context = this.client.mergeContext(context); @@ -778,7 +722,7 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -787,16 +731,17 @@ private PollerFlux, FormulaInner> beginCreateOrUpdateAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return the {@link SyncPoller} for polling of a formula for creating a VM, specifying an image base and other + * parameters. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, formula).getSyncPoller(); } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -806,16 +751,17 @@ public SyncPoller, FormulaInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return the {@link SyncPoller} for polling of a formula for creating a VM, specifying an image base and other + * parameters. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, FormulaInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, FormulaInner formula, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, formula, context).getSyncPoller(); } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -824,7 +770,8 @@ public SyncPoller, FormulaInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -835,7 +782,7 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -845,7 +792,8 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -856,7 +804,7 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -873,7 +821,7 @@ public FormulaInner createOrUpdate(String resourceGroupName, String labName, Str } /** - * Create or replace an existing formula. This operation can take a while to complete. + * Create or replace an existing Formula. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -900,7 +848,7 @@ public FormulaInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { @@ -953,7 +901,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1003,7 +951,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -1035,7 +983,7 @@ public void delete(String resourceGroupName, String labName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { @@ -1048,11 +996,12 @@ public Response deleteWithResponse(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param formula Allows modifying tags of formulas. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1108,12 +1057,13 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param formula Allows modifying tags of formulas. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1166,11 +1116,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param formula Allows modifying tags of formulas. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1192,7 +1143,7 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param formula Allows modifying tags of formulas. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1209,12 +1160,12 @@ public FormulaInner update(String resourceGroupName, String labName, String name * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param formula A formula for creating a VM, specifying an image base and other parameters. + * @param formula Allows modifying tags of formulas. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 formula for creating a VM, specifying an image base and other parameters. + * @return a formula for creating a VM, specifying an image base and other parameters along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1229,7 +1180,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1265,7 +1217,8 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java index 306392b1b660..63819623f66b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/FormulasImpl.java @@ -34,15 +34,9 @@ public PagedIterable list(String resourceGroupName, String labName) { } public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new FormulaImpl(inner1, this.manager())); } @@ -55,10 +49,8 @@ public Formula get(String resourceGroupName, String labName, String name) { } } - public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); + public Response getWithResponse(String resourceGroupName, String labName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -101,11 +93,10 @@ public Formula getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'formulas'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -128,7 +119,7 @@ public Response getByIdWithResponse(String id, String expand, Context c new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'formulas'.", id))); } - return this.getWithResponse(resourceGroupName, labName, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, name, context); } public void deleteById(String id) { @@ -154,7 +145,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'formulas'.", id))); } - this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java index ae73d33b6b4d..2cbf0ef89829 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImageImpl.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.devtestlabs.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; import com.azure.resourcemanager.devtestlabs.models.GalleryImage; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; public final class GalleryImageImpl implements GalleryImage { private GalleryImageInner innerObject; @@ -34,17 +32,8 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public SystemData systemData() { + return this.innerModel().systemData(); } public String author() { @@ -59,10 +48,6 @@ public String description() { return this.innerModel().description(); } - public GalleryImageReference imageReference() { - return this.innerModel().imageReference(); - } - public String icon() { return this.innerModel().icon(); } @@ -79,6 +64,26 @@ public Boolean isPlanAuthorized() { return this.innerModel().isPlanAuthorized(); } + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String version() { + return this.innerModel().version(); + } + public GalleryImageInner innerModel() { return this.innerObject; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java index 4ae6d24210e0..224634c75814 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesClientImpl.java @@ -70,7 +70,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -78,6 +77,22 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/galleryimages/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -94,18 +109,18 @@ Mono> listNext( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -135,7 +150,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -159,25 +173,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -205,7 +213,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -228,20 +235,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -253,16 +259,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -271,27 +276,20 @@ private PagedFlux listAsync(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -303,15 +301,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); } /** @@ -319,26 +316,181 @@ public PagedIterable list(String resourceGroupName, String la * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); + } + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String labName, String name) { + return getWithResponseAsync(resourceGroupName, labName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryImageInner get(String resourceGroupName, String labName, String name) { + return getAsync(resourceGroupName, labName, name).block(); + } + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); } /** @@ -348,7 +500,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of galleryImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -384,7 +537,8 @@ private Mono> listNextSinglePageAsync(String ne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java index 9edd83a3fa2a..c19798b0f247 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GalleryImagesImpl.java @@ -5,6 +5,8 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.fluent.GalleryImagesClient; @@ -32,18 +34,36 @@ public PagedIterable list(String resourceGroupName, String labName } public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new GalleryImageImpl(inner1, this.manager())); } + public GalleryImage get(String resourceGroupName, String labName, String name) { + GalleryImageInner inner = this.serviceClient().get(resourceGroupName, labName, name); + if (inner != null) { + return new GalleryImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String labName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GalleryImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + private GalleryImagesClient serviceClient() { return this.innerClient; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java index 06eace1f8e65..9eed343ba8db 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesClientImpl.java @@ -78,7 +78,6 @@ private interface GlobalSchedulesService { Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -96,7 +95,6 @@ Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -115,7 +113,6 @@ Mono> getByResourceGroup( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -222,18 +219,17 @@ Mono> listByResourceGroupNext( /** * List schedules in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String expand, String filter, Integer top, String orderby) { + private Mono> listSinglePageAsync(String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -254,7 +250,6 @@ private Mono> listSinglePageAsync( .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - expand, filter, top, orderby, @@ -276,19 +271,19 @@ private Mono> listSinglePageAsync( /** * List schedules in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String expand, String filter, Integer top, String orderby, Context context) { + String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -307,7 +302,6 @@ private Mono> listSinglePageAsync( .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - expand, filter, top, orderby, @@ -328,19 +322,18 @@ private Mono> listSinglePageAsync( /** * List schedules in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby) { + private PagedFlux listAsync(String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby), + () -> listSinglePageAsync(filter, top, orderby), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } @@ -349,37 +342,34 @@ private PagedFlux listAsync(String expand, String filter, Integer * * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby), + () -> listSinglePageAsync(filter, top, orderby), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List schedules in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String expand, String filter, Integer top, String orderby, Context context) { + private PagedFlux listAsync(String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby, context), + () -> listSinglePageAsync(filter, top, orderby, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } @@ -388,52 +378,49 @@ private PagedFlux listAsync( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(filter, top, orderby)); } /** * List schedules in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(expand, filter, top, orderby, context)); + public PagedIterable list(String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(filter, top, orderby, context)); } /** * List schedules in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -459,7 +446,6 @@ private Mono> listByResourceGroupSinglePageAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - expand, filter, top, orderby, @@ -482,19 +468,19 @@ private Mono> listByResourceGroupSinglePageAsync( * List schedules in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { + String resourceGroupName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -518,7 +504,6 @@ private Mono> listByResourceGroupSinglePageAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - expand, filter, top, orderby, @@ -540,20 +525,19 @@ private Mono> listByResourceGroupSinglePageAsync( * List schedules in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, orderby), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } @@ -564,16 +548,15 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, orderby), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } @@ -581,21 +564,20 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNa * List schedules in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { + String resourceGroupName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby, context), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, orderby, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } @@ -606,35 +588,33 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby)); + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, orderby)); } /** * List schedules in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby, context)); + String resourceGroupName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, orderby, context)); } /** @@ -642,15 +622,13 @@ public PagedIterable listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, String expand) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -680,7 +658,6 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -692,16 +669,15 @@ private Mono> getByResourceGroupWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, String expand, Context context) { + String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -729,36 +705,11 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String name, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get schedule. * @@ -767,12 +718,11 @@ private Mono getByResourceGroupAsync(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String name) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand) + return getByResourceGroupWithResponseAsync(resourceGroupName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -795,8 +745,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) public ScheduleInner getByResourceGroup(String resourceGroupName, String name) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, name, expand).block(); + return getByResourceGroupAsync(resourceGroupName, name).block(); } /** @@ -804,17 +753,16 @@ public ScheduleInner getByResourceGroup(String resourceGroupName, String name) { * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand, context).block(); + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); } /** @@ -826,7 +774,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -882,7 +830,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -934,7 +882,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String name, ScheduleInner schedule) { @@ -975,7 +923,7 @@ public ScheduleInner createOrUpdate(String resourceGroupName, String name, Sched * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -991,7 +939,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String name) { @@ -1039,7 +987,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String name, Context context) { @@ -1083,7 +1031,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String name) { @@ -1113,7 +1061,7 @@ public void delete(String resourceGroupName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String name, Context context) { @@ -1125,11 +1073,11 @@ public Response deleteWithResponse(String resourceGroupName, String name, * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1180,12 +1128,12 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1233,11 +1181,11 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String name, ScheduleFragment schedule) { @@ -1257,7 +1205,7 @@ private Mono updateAsync(String resourceGroupName, String name, S * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1273,12 +1221,12 @@ public ScheduleInner update(String resourceGroupName, String name, ScheduleFragm * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1294,7 +1242,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync(String resourceGroupName, String name) { @@ -1342,7 +1290,7 @@ private Mono>> executeWithResponseAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync( @@ -1387,14 +1335,15 @@ private Mono>> executeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync(String resourceGroupName, String name) { Mono>> mono = executeWithResponseAsync(resourceGroupName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1406,9 +1355,9 @@ private PollerFlux, Void> beginExecuteAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String name, Context context) { context = this.client.mergeContext(context); @@ -1426,9 +1375,9 @@ private PollerFlux, Void> beginExecuteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String name) { return beginExecuteAsync(resourceGroupName, name).getSyncPoller(); } @@ -1442,9 +1391,9 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String name, Context context) { return beginExecuteAsync(resourceGroupName, name, context).getSyncPoller(); } @@ -1457,7 +1406,7 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync(String resourceGroupName, String name) { @@ -1473,7 +1422,7 @@ private Mono executeAsync(String resourceGroupName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync(String resourceGroupName, String name, Context context) { @@ -1520,7 +1469,7 @@ public void execute(String resourceGroupName, String name, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> retargetWithResponseAsync( @@ -1579,7 +1528,7 @@ private Mono>> retargetWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> retargetWithResponseAsync( @@ -1634,16 +1583,17 @@ private Mono>> retargetWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRetargetAsync( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties) { Mono>> mono = retargetWithResponseAsync(resourceGroupName, name, retargetScheduleProperties); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1656,9 +1606,9 @@ private PollerFlux, Void> beginRetargetAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRetargetAsync( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context) { context = this.client.mergeContext(context); @@ -1678,9 +1628,9 @@ private PollerFlux, Void> beginRetargetAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties) { return beginRetargetAsync(resourceGroupName, name, retargetScheduleProperties).getSyncPoller(); @@ -1696,9 +1646,9 @@ public SyncPoller, Void> beginRetarget( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRetarget( String resourceGroupName, String name, RetargetScheduleProperties retargetScheduleProperties, Context context) { return beginRetargetAsync(resourceGroupName, name, retargetScheduleProperties, context).getSyncPoller(); @@ -1713,7 +1663,7 @@ public SyncPoller, Void> beginRetarget( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono retargetAsync( @@ -1733,7 +1683,7 @@ private Mono retargetAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono retargetAsync( @@ -1782,7 +1732,8 @@ public void retarget( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1819,7 +1770,8 @@ private Mono> listBySubscriptionNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -1854,7 +1806,8 @@ private Mono> listBySubscriptionNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1891,7 +1844,8 @@ private Mono> listByResourceGroupNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java index a7f5e1579014..8eb77f68f0b3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/GlobalSchedulesImpl.java @@ -34,8 +34,8 @@ public PagedIterable list() { return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } - public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient().list(expand, filter, top, orderby, context); + public PagedIterable list(String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } @@ -45,9 +45,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { } public PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { + String resourceGroupName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, expand, filter, top, orderby, context); + this.serviceClient().listByResourceGroup(resourceGroupName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } @@ -60,10 +60,9 @@ public Schedule getByResourceGroup(String resourceGroupName, String name) { } } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, String expand, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, expand, context); + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -116,11 +115,10 @@ public Schedule getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); } - String localExpand = null; - return this.getByResourceGroupWithResponse(resourceGroupName, name, localExpand, Context.NONE).getValue(); + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -136,7 +134,7 @@ public Response getByIdWithResponse(String id, String expand, Context new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, name, expand, context); + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); } public void deleteById(String id) { @@ -155,7 +153,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); } - this.deleteWithResponse(resourceGroupName, name, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java index f65188b766c9..2b01fbda6f9e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabCostImpl.java @@ -4,18 +4,18 @@ package com.azure.resourcemanager.devtestlabs.implementation; -import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; import com.azure.resourcemanager.devtestlabs.models.LabCost; import com.azure.resourcemanager.devtestlabs.models.LabCostDetailsProperties; -import com.azure.resourcemanager.devtestlabs.models.LabCostSummaryProperties; import com.azure.resourcemanager.devtestlabs.models.LabResourceCostProperties; -import com.azure.resourcemanager.devtestlabs.models.TargetCostProperties; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; -import java.util.Map; public final class LabCostImpl implements LabCost, LabCost.Definition, LabCost.Update { private LabCostInner innerObject; @@ -34,25 +34,8 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public TargetCostProperties targetCost() { - return this.innerModel().targetCost(); - } - - public LabCostSummaryProperties labCostSummary() { - return this.innerModel().labCostSummary(); + public SystemData systemData() { + return this.innerModel().systemData(); } public List labCostDetails() { @@ -97,12 +80,37 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } - public Region region() { - return Region.fromName(this.regionName()); + public TargetCostStatus status() { + return this.innerModel().status(); + } + + public Integer target() { + return this.innerModel().target(); + } + + public List costThresholds() { + List inner = this.innerModel().costThresholds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime cycleStartDateTime() { + return this.innerModel().cycleStartDateTime(); + } + + public OffsetDateTime cycleEndDateTime() { + return this.innerModel().cycleEndDateTime(); + } + + public ReportingCycleType cycleType() { + return this.innerModel().cycleType(); } - public String regionName() { - return this.location(); + public Double estimatedLabCost() { + return this.innerModel().estimatedLabCost(); } public LabCostInner innerModel() { @@ -205,43 +213,53 @@ public LabCost refresh(Context context) { return this; } - public LabCostImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); + public LabCostImpl withCurrencyCode(String currencyCode) { + this.innerModel().withCurrencyCode(currencyCode); return this; } - public LabCostImpl withRegion(String location) { - this.innerModel().withLocation(location); + public LabCostImpl withStartDateTime(OffsetDateTime startDateTime) { + this.innerModel().withStartDateTime(startDateTime); return this; } - public LabCostImpl withTags(Map tags) { - this.innerModel().withTags(tags); + public LabCostImpl withEndDateTime(OffsetDateTime endDateTime) { + this.innerModel().withEndDateTime(endDateTime); return this; } - public LabCostImpl withTargetCost(TargetCostProperties targetCost) { - this.innerModel().withTargetCost(targetCost); + public LabCostImpl withCreatedDate(OffsetDateTime createdDate) { + this.innerModel().withCreatedDate(createdDate); return this; } - public LabCostImpl withCurrencyCode(String currencyCode) { - this.innerModel().withCurrencyCode(currencyCode); + public LabCostImpl withStatus(TargetCostStatus status) { + this.innerModel().withStatus(status); return this; } - public LabCostImpl withStartDateTime(OffsetDateTime startDateTime) { - this.innerModel().withStartDateTime(startDateTime); + public LabCostImpl withTarget(Integer target) { + this.innerModel().withTarget(target); return this; } - public LabCostImpl withEndDateTime(OffsetDateTime endDateTime) { - this.innerModel().withEndDateTime(endDateTime); + public LabCostImpl withCostThresholds(List costThresholds) { + this.innerModel().withCostThresholds(costThresholds); return this; } - public LabCostImpl withCreatedDate(OffsetDateTime createdDate) { - this.innerModel().withCreatedDate(createdDate); + public LabCostImpl withCycleStartDateTime(OffsetDateTime cycleStartDateTime) { + this.innerModel().withCycleStartDateTime(cycleStartDateTime); + return this; + } + + public LabCostImpl withCycleEndDateTime(OffsetDateTime cycleEndDateTime) { + this.innerModel().withCycleEndDateTime(cycleEndDateTime); + return this; + } + + public LabCostImpl withCycleType(ReportingCycleType cycleType) { + this.innerModel().withCycleType(cycleType); return this; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java index c9ea9c3f55b7..1879c63c1792 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabImpl.java @@ -7,19 +7,21 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.EncryptionType; import com.azure.resourcemanager.devtestlabs.models.EnvironmentPermission; import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriResponse; import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; import com.azure.resourcemanager.devtestlabs.models.Lab; -import com.azure.resourcemanager.devtestlabs.models.LabAnnouncementProperties; import com.azure.resourcemanager.devtestlabs.models.LabFragment; -import com.azure.resourcemanager.devtestlabs.models.LabSupportProperties; import com.azure.resourcemanager.devtestlabs.models.LabVhd; -import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; import com.azure.resourcemanager.devtestlabs.models.PremiumDataDisk; import com.azure.resourcemanager.devtestlabs.models.StorageType; import java.time.OffsetDateTime; @@ -57,6 +59,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String defaultStorageAccount() { return this.innerModel().defaultStorageAccount(); } @@ -111,14 +117,6 @@ public EnvironmentPermission environmentPermission() { return this.innerModel().environmentPermission(); } - public LabAnnouncementProperties announcement() { - return this.innerModel().announcement(); - } - - public LabSupportProperties support() { - return this.innerModel().support(); - } - public String vmCreationResourceGroup() { return this.innerModel().vmCreationResourceGroup(); } @@ -144,6 +142,31 @@ public Map extendedProperties() { } } + public EnableStatus browserConnect() { + return this.innerModel().browserConnect(); + } + + public Boolean disableAutoUpgradeCseMinorVersion() { + return this.innerModel().disableAutoUpgradeCseMinorVersion(); + } + + public Map managementIdentities() { + Map inner = this.innerModel().managementIdentities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EnableStatus isolateLabResources() { + return this.innerModel().isolateLabResources(); + } + + public String defaultSecretName() { + return this.innerModel().defaultSecretName(); + } + public String provisioningState() { return this.innerModel().provisioningState(); } @@ -152,6 +175,67 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } + public String title() { + return this.innerModel().title(); + } + + public String markdown() { + return this.innerModel().markdown(); + } + + public EnableStatus enabled() { + return this.innerModel().enabled(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public Boolean expired() { + return this.innerModel().expired(); + } + + public String provisioningStateAnnouncementProvisioningState() { + return this.innerModel().provisioningStateAnnouncementProvisioningState(); + } + + public String uniqueIdentifierAnnouncementUniqueIdentifier() { + return this.innerModel().uniqueIdentifierAnnouncementUniqueIdentifier(); + } + + public String diskEncryptionSetId() { + return this.innerModel().diskEncryptionSetId(); + } + + public EncryptionType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public ManagedIdentityType typeIdentityType() { + return this.innerModel().typeIdentityType(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String clientSecretUrl() { + return this.innerModel().clientSecretUrl(); + } + + public Map userAssignedIdentities() { + Map inner = this.innerModel().userAssignedIdentities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -236,23 +320,21 @@ public Lab apply(Context context) { } public Lab refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getLabs() - .getByResourceGroupWithResponse(resourceGroupName, name, localExpand, Context.NONE) + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) .getValue(); return this; } public Lab refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getLabs() - .getByResourceGroupWithResponse(resourceGroupName, name, localExpand, context) + .getByResourceGroupWithResponse(resourceGroupName, name, context) .getValue(); return this; } @@ -265,15 +347,23 @@ public void claimAnyVm(Context context) { serviceManager.labs().claimAnyVm(resourceGroupName, name, context); } - public void createEnvironment(LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + public void createEnvironment(LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter) { serviceManager.labs().createEnvironment(resourceGroupName, name, labVirtualMachineCreationParameter); } public void createEnvironment( - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context) { + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context) { serviceManager.labs().createEnvironment(resourceGroupName, name, labVirtualMachineCreationParameter, context); } + public void ensureCurrentUserProfile() { + serviceManager.labs().ensureCurrentUserProfile(resourceGroupName, name); + } + + public Response ensureCurrentUserProfileWithResponse(Context context) { + return serviceManager.labs().ensureCurrentUserProfileWithResponse(resourceGroupName, name, context); + } + public void exportResourceUsage(ExportResourceUsageParameters exportResourceUsageParameters) { serviceManager.labs().exportResourceUsage(resourceGroupName, name, exportResourceUsageParameters); } @@ -329,6 +419,11 @@ public LabImpl withTags(Map tags) { } } + public LabImpl withArtifactsStorageAccount(String artifactsStorageAccount) { + this.innerModel().withArtifactsStorageAccount(artifactsStorageAccount); + return this; + } + public LabImpl withLabStorageType(StorageType labStorageType) { this.innerModel().withLabStorageType(labStorageType); return this; @@ -354,18 +449,98 @@ public LabImpl withEnvironmentPermission(EnvironmentPermission environmentPermis return this; } - public LabImpl withAnnouncement(LabAnnouncementProperties announcement) { - this.innerModel().withAnnouncement(announcement); + public LabImpl withVmCreationResourceGroup(String vmCreationResourceGroup) { + this.innerModel().withVmCreationResourceGroup(vmCreationResourceGroup); return this; } - public LabImpl withSupport(LabSupportProperties support) { - this.innerModel().withSupport(support); + public LabImpl withExtendedProperties(Map extendedProperties) { + this.innerModel().withExtendedProperties(extendedProperties); return this; } - public LabImpl withExtendedProperties(Map extendedProperties) { - this.innerModel().withExtendedProperties(extendedProperties); + public LabImpl withBrowserConnect(EnableStatus browserConnect) { + this.innerModel().withBrowserConnect(browserConnect); + return this; + } + + public LabImpl withDisableAutoUpgradeCseMinorVersion(Boolean disableAutoUpgradeCseMinorVersion) { + this.innerModel().withDisableAutoUpgradeCseMinorVersion(disableAutoUpgradeCseMinorVersion); + return this; + } + + public LabImpl withManagementIdentities(Map managementIdentities) { + this.innerModel().withManagementIdentities(managementIdentities); + return this; + } + + public LabImpl withIsolateLabResources(EnableStatus isolateLabResources) { + this.innerModel().withIsolateLabResources(isolateLabResources); + return this; + } + + public LabImpl withDefaultSecretName(String defaultSecretName) { + this.innerModel().withDefaultSecretName(defaultSecretName); + return this; + } + + public LabImpl withTitle(String title) { + this.innerModel().withTitle(title); + return this; + } + + public LabImpl withMarkdown(String markdown) { + this.innerModel().withMarkdown(markdown); + return this; + } + + public LabImpl withEnabled(EnableStatus enabled) { + this.innerModel().withEnabled(enabled); + return this; + } + + public LabImpl withExpirationDate(OffsetDateTime expirationDate) { + this.innerModel().withExpirationDate(expirationDate); + return this; + } + + public LabImpl withExpired(Boolean expired) { + this.innerModel().withExpired(expired); + return this; + } + + public LabImpl withDiskEncryptionSetId(String diskEncryptionSetId) { + this.innerModel().withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + public LabImpl withTypePropertiesType(EncryptionType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public LabImpl withTypeIdentityType(ManagedIdentityType typeIdentityType) { + this.innerModel().withTypeIdentityType(typeIdentityType); + return this; + } + + public LabImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public LabImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public LabImpl withClientSecretUrl(String clientSecretUrl) { + this.innerModel().withClientSecretUrl(clientSecretUrl); + return this; + } + + public LabImpl withUserAssignedIdentities(Map userAssignedIdentities) { + this.innerModel().withUserAssignedIdentities(userAssignedIdentities); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretImpl.java new file mode 100644 index 000000000000..9eb53b8b6d2b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabSecretInner; +import com.azure.resourcemanager.devtestlabs.models.LabSecret; +import com.azure.resourcemanager.devtestlabs.models.SecretFragment; +import java.util.Collections; +import java.util.Map; + +public final class LabSecretImpl implements LabSecret, LabSecret.Definition, LabSecret.Update { + private LabSecretInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String value() { + return this.innerModel().value(); + } + + public String keyVaultEntry() { + return this.innerModel().keyVaultEntry(); + } + + public Boolean enabledForArtifacts() { + return this.innerModel().enabledForArtifacts(); + } + + public Boolean enabledForVmCreation() { + return this.innerModel().enabledForVmCreation(); + } + + public Boolean enabledForArmEnvironments() { + return this.innerModel().enabledForArmEnvironments(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public LabSecretInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String labName; + + private String name; + + private SecretFragment updateSecret; + + public LabSecretImpl withExistingLab(String resourceGroupName, String labName) { + this.resourceGroupName = resourceGroupName; + this.labName = labName; + return this; + } + + public LabSecret create() { + this.innerObject = + serviceManager + .serviceClient() + .getLabSecrets() + .createOrUpdate(resourceGroupName, labName, name, this.innerModel(), Context.NONE); + return this; + } + + public LabSecret create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLabSecrets() + .createOrUpdate(resourceGroupName, labName, name, this.innerModel(), context); + return this; + } + + LabSecretImpl(String name, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = new LabSecretInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LabSecretImpl update() { + this.updateSecret = new SecretFragment(); + return this; + } + + public LabSecret apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLabSecrets() + .updateWithResponse(resourceGroupName, labName, name, updateSecret, Context.NONE) + .getValue(); + return this; + } + + public LabSecret apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLabSecrets() + .updateWithResponse(resourceGroupName, labName, name, updateSecret, context) + .getValue(); + return this; + } + + LabSecretImpl(LabSecretInner innerObject, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "secrets"); + } + + public LabSecret refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLabSecrets() + .getWithResponse(resourceGroupName, labName, name, Context.NONE) + .getValue(); + return this; + } + + public LabSecret refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLabSecrets() + .getWithResponse(resourceGroupName, labName, name, context) + .getValue(); + return this; + } + + public LabSecretImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LabSecretImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LabSecretImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSecret.withTags(tags); + return this; + } + } + + public LabSecretImpl withValue(String value) { + this.innerModel().withValue(value); + return this; + } + + public LabSecretImpl withEnabledForArtifacts(Boolean enabledForArtifacts) { + this.innerModel().withEnabledForArtifacts(enabledForArtifacts); + return this; + } + + public LabSecretImpl withEnabledForVmCreation(Boolean enabledForVmCreation) { + this.innerModel().withEnabledForVmCreation(enabledForVmCreation); + return this; + } + + public LabSecretImpl withEnabledForArmEnvironments(Boolean enabledForArmEnvironments) { + this.innerModel().withEnabledForArmEnvironments(enabledForArmEnvironments); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretsClientImpl.java new file mode 100644 index 000000000000..2393cd1a8b3b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretsClientImpl.java @@ -0,0 +1,1338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.devtestlabs.fluent.LabSecretsClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabSecretInner; +import com.azure.resourcemanager.devtestlabs.models.LabSecretList; +import com.azure.resourcemanager.devtestlabs.models.SecretFragment; +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 LabSecretsClient. */ +public final class LabSecretsClientImpl implements LabSecretsClient { + private final ClientLogger logger = new ClientLogger(LabSecretsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LabSecretsService service; + + /** The service client containing this operation class. */ + private final DevTestLabsClientImpl client; + + /** + * Initializes an instance of LabSecretsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LabSecretsClientImpl(DevTestLabsClientImpl client) { + this.service = + RestProxy.create(LabSecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevTestLabsClientLabSecrets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevTestLabsClientLab") + private interface LabSecretsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/secrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/secrets/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/secrets/{name}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LabSecretInner labSecret, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/secrets/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/secrets/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecretFragment secret, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); + } + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); + } + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String labName, String name) { + return getWithResponseAsync(resourceGroupName, labName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabSecretInner get(String resourceGroupName, String labName, String name) { + return getAsync(resourceGroupName, labName, name).block(); + } + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String name, LabSecretInner labSecret) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (labSecret == null) { + return Mono.error(new IllegalArgumentException("Parameter labSecret is required and cannot be null.")); + } else { + labSecret.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + labSecret, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String name, LabSecretInner labSecret, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (labSecret == null) { + return Mono.error(new IllegalArgumentException("Parameter labSecret is required and cannot be null.")); + } else { + labSecret.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + labSecret, + accept, + context); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabSecretInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, String name, LabSecretInner labSecret) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, name, labSecret); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + LabSecretInner.class, + LabSecretInner.class, + this.client.getContext()); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabSecretInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, String name, LabSecretInner labSecret, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, name, labSecret, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LabSecretInner.class, LabSecretInner.class, context); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabSecretInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, LabSecretInner labSecret) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, labSecret).getSyncPoller(); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabSecretInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, LabSecretInner labSecret, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, labSecret, context).getSyncPoller(); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String name, LabSecretInner labSecret) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, labSecret) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String name, LabSecretInner labSecret, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, labSecret, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabSecretInner createOrUpdate( + String resourceGroupName, String labName, String name, LabSecretInner labSecret) { + return createOrUpdateAsync(resourceGroupName, labName, name, labSecret).block(); + } + + /** + * Create or replace an existing Lab Secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param labSecret A shared secret in a lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabSecretInner createOrUpdate( + String resourceGroupName, String labName, String name, LabSecretInner labSecret, Context context) { + return createOrUpdateAsync(resourceGroupName, labName, name, labSecret, context).block(); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { + return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String labName, String name) { + return beginDeleteAsync(resourceGroupName, labName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, labName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 labName, String name) { + deleteAsync(resourceGroupName, labName, name).block(); + } + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 labName, String name, Context context) { + deleteAsync(resourceGroupName, labName, name, context).block(); + } + + /** + * Allows modifying tags of lab secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param secret Allows modifying tags of lab secrets. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String labName, String name, SecretFragment secret) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (secret == null) { + return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + } else { + secret.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + secret, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of lab secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param secret Allows modifying tags of lab secrets. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String labName, String name, SecretFragment secret, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (secret == null) { + return Mono.error(new IllegalArgumentException("Parameter secret is required and cannot be null.")); + } else { + secret.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + secret, + accept, + context); + } + + /** + * Allows modifying tags of lab secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param secret Allows modifying tags of lab secrets. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String labName, String name, SecretFragment secret) { + return updateWithResponseAsync(resourceGroupName, labName, name, secret) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Allows modifying tags of lab secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param secret Allows modifying tags of lab secrets. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabSecretInner update(String resourceGroupName, String labName, String name, SecretFragment secret) { + return updateAsync(resourceGroupName, labName, name, secret).block(); + } + + /** + * Allows modifying tags of lab secrets. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param secret Allows modifying tags of lab secrets. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 shared secret in a lab along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String labName, String name, SecretFragment secret, Context context) { + return updateWithResponseAsync(resourceGroupName, labName, name, secret, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretsImpl.java new file mode 100644 index 000000000000..52a96a8225d5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabSecretsImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.LabSecretsClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabSecretInner; +import com.azure.resourcemanager.devtestlabs.models.LabSecret; +import com.azure.resourcemanager.devtestlabs.models.LabSecrets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LabSecretsImpl implements LabSecrets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabSecretsImpl.class); + + private final LabSecretsClient innerClient; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public LabSecretsImpl( + LabSecretsClient innerClient, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return Utils.mapPage(inner, inner1 -> new LabSecretImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); + return Utils.mapPage(inner, inner1 -> new LabSecretImpl(inner1, this.manager())); + } + + public LabSecret get(String resourceGroupName, String labName, String name) { + LabSecretInner inner = this.serviceClient().get(resourceGroupName, labName, name); + if (inner != null) { + return new LabSecretImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String labName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LabSecretImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String labName, String name) { + this.serviceClient().delete(resourceGroupName, labName, name); + } + + public void delete(String resourceGroupName, String labName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, labName, name, context); + } + + public LabSecret getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "secrets"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "secrets"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "secrets"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + this.delete(resourceGroupName, labName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "secrets"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + this.delete(resourceGroupName, labName, name, context); + } + + private LabSecretsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + public LabSecretImpl define(String name) { + return new LabSecretImpl(name, this.manager()); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineCreationParameterImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineCreationParameterImpl.java new file mode 100644 index 000000000000..682d26dae9e9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineCreationParameterImpl.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LabVirtualMachineCreationParameterImpl implements LabVirtualMachineCreationParameter { + private LabVirtualMachineCreationParameterInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + LabVirtualMachineCreationParameterImpl( + LabVirtualMachineCreationParameterInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String notes() { + return this.innerModel().notes(); + } + + public String ownerObjectId() { + return this.innerModel().ownerObjectId(); + } + + public String ownerUserPrincipalName() { + return this.innerModel().ownerUserPrincipalName(); + } + + public String createdByUserId() { + return this.innerModel().createdByUserId(); + } + + public String createdByUser() { + return this.innerModel().createdByUser(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String computeId() { + return this.innerModel().computeId(); + } + + public String customImageId() { + return this.innerModel().customImageId(); + } + + public String galleryImageVersionId() { + return this.innerModel().galleryImageVersionId(); + } + + public String sharedImageId() { + return this.innerModel().sharedImageId(); + } + + public String sharedImageVersion() { + return this.innerModel().sharedImageVersion(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String size() { + return this.innerModel().size(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public String sshKey() { + return this.innerModel().sshKey(); + } + + public Boolean isAuthenticationWithSshKey() { + return this.innerModel().isAuthenticationWithSshKey(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String labSubnetName() { + return this.innerModel().labSubnetName(); + } + + public String labVirtualNetworkId() { + return this.innerModel().labVirtualNetworkId(); + } + + public Boolean disallowPublicIpAddress() { + return this.innerModel().disallowPublicIpAddress(); + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String planId() { + return this.innerModel().planId(); + } + + public Integer osDiskSizeGb() { + return this.innerModel().osDiskSizeGb(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public Boolean allowClaim() { + return this.innerModel().allowClaim(); + } + + public StorageType storageType() { + return this.innerModel().storageType(); + } + + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerModel().virtualMachineCreationSource(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public List dataDiskParameters() { + List inner = this.innerModel().dataDiskParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scheduleParameters() { + List inner = this.innerModel().scheduleParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String lastKnownPowerState() { + return this.innerModel().lastKnownPowerState(); + } + + public Boolean canApplyArtifacts() { + return this.innerModel().canApplyArtifacts(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public Integer instanceCount() { + return this.innerModel().instanceCount(); + } + + public String deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public Integer artifactsApplied() { + return this.innerModel().artifactsApplied(); + } + + public Integer totalArtifacts() { + return this.innerModel().totalArtifacts(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String osTypeGalleryImageReferenceOsType() { + return this.innerModel().osTypeGalleryImageReferenceOsType(); + } + + public String version() { + return this.innerModel().version(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osTypeComputeVmOsType() { + return this.innerModel().osTypeComputeVmOsType(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String networkInterfaceId() { + return this.innerModel().networkInterfaceId(); + } + + public String osDiskId() { + return this.innerModel().osDiskId(); + } + + public List dataDiskIds() { + List inner = this.innerModel().dataDiskIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dataDisks() { + List inner = this.innerModel().dataDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String virtualNetworkId() { + return this.innerModel().virtualNetworkId(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String publicIpAddressId() { + return this.innerModel().publicIpAddressId(); + } + + public String publicIpAddress() { + return this.innerModel().publicIpAddress(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String rdpAuthority() { + return this.innerModel().rdpAuthority(); + } + + public String sshAuthority() { + return this.innerModel().sshAuthority(); + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerModel().createdDateApplicableScheduleCreatedDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String id() { + return this.innerModel().id(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String type() { + return this.innerModel().type(); + } + + public String locationPropertiesLocation() { + return this.innerModel().locationPropertiesLocation(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LabVirtualMachineCreationParameterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineCreationParameterPropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineCreationParameterPropertiesImpl.java new file mode 100644 index 000000000000..3c0b91497c5e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineCreationParameterPropertiesImpl.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterPropertiesInner; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameterProperties; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LabVirtualMachineCreationParameterPropertiesImpl + implements LabVirtualMachineCreationParameterProperties { + private LabVirtualMachineCreationParameterPropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + LabVirtualMachineCreationParameterPropertiesImpl( + LabVirtualMachineCreationParameterPropertiesInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String notes() { + return this.innerModel().notes(); + } + + public String ownerObjectId() { + return this.innerModel().ownerObjectId(); + } + + public String ownerUserPrincipalName() { + return this.innerModel().ownerUserPrincipalName(); + } + + public String createdByUserId() { + return this.innerModel().createdByUserId(); + } + + public String createdByUser() { + return this.innerModel().createdByUser(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String computeId() { + return this.innerModel().computeId(); + } + + public String customImageId() { + return this.innerModel().customImageId(); + } + + public String galleryImageVersionId() { + return this.innerModel().galleryImageVersionId(); + } + + public String sharedImageId() { + return this.innerModel().sharedImageId(); + } + + public String sharedImageVersion() { + return this.innerModel().sharedImageVersion(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String size() { + return this.innerModel().size(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public String sshKey() { + return this.innerModel().sshKey(); + } + + public Boolean isAuthenticationWithSshKey() { + return this.innerModel().isAuthenticationWithSshKey(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String labSubnetName() { + return this.innerModel().labSubnetName(); + } + + public String labVirtualNetworkId() { + return this.innerModel().labVirtualNetworkId(); + } + + public Boolean disallowPublicIpAddress() { + return this.innerModel().disallowPublicIpAddress(); + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String planId() { + return this.innerModel().planId(); + } + + public Integer osDiskSizeGb() { + return this.innerModel().osDiskSizeGb(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public Boolean allowClaim() { + return this.innerModel().allowClaim(); + } + + public StorageType storageType() { + return this.innerModel().storageType(); + } + + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerModel().virtualMachineCreationSource(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public List dataDiskParameters() { + List inner = this.innerModel().dataDiskParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scheduleParameters() { + List inner = this.innerModel().scheduleParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String lastKnownPowerState() { + return this.innerModel().lastKnownPowerState(); + } + + public Boolean canApplyArtifacts() { + return this.innerModel().canApplyArtifacts(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public Integer instanceCount() { + return this.innerModel().instanceCount(); + } + + public String deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public Integer artifactsApplied() { + return this.innerModel().artifactsApplied(); + } + + public Integer totalArtifacts() { + return this.innerModel().totalArtifacts(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String osTypeGalleryImageReferenceOsType() { + return this.innerModel().osTypeGalleryImageReferenceOsType(); + } + + public String version() { + return this.innerModel().version(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osTypeComputeVmOsType() { + return this.innerModel().osTypeComputeVmOsType(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String networkInterfaceId() { + return this.innerModel().networkInterfaceId(); + } + + public String osDiskId() { + return this.innerModel().osDiskId(); + } + + public List dataDiskIds() { + List inner = this.innerModel().dataDiskIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dataDisks() { + List inner = this.innerModel().dataDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String virtualNetworkId() { + return this.innerModel().virtualNetworkId(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String publicIpAddressId() { + return this.innerModel().publicIpAddressId(); + } + + public String publicIpAddress() { + return this.innerModel().publicIpAddress(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String rdpAuthority() { + return this.innerModel().rdpAuthority(); + } + + public String sshAuthority() { + return this.innerModel().sshAuthority(); + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerModel().createdDateApplicableScheduleCreatedDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LabVirtualMachineCreationParameterPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java index 2bb09ebbe269..a9a2baa952be 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachineImpl.java @@ -6,23 +6,24 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineInner; import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; import com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest; -import com.azure.resourcemanager.devtestlabs.models.ArtifactDeploymentStatusProperties; import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; -import com.azure.resourcemanager.devtestlabs.models.ComputeVmProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; -import com.azure.resourcemanager.devtestlabs.models.GalleryImageReference; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachine; import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineFragment; -import com.azure.resourcemanager.devtestlabs.models.NetworkInterfaceProperties; import com.azure.resourcemanager.devtestlabs.models.RdpConnection; import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties; import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageTypes; import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; import java.time.OffsetDateTime; import java.util.Collections; @@ -60,6 +61,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String notes() { return this.innerModel().notes(); } @@ -92,6 +97,18 @@ public String customImageId() { return this.innerModel().customImageId(); } + public String galleryImageVersionId() { + return this.innerModel().galleryImageVersionId(); + } + + public String sharedImageId() { + return this.innerModel().sharedImageId(); + } + + public String sharedImageVersion() { + return this.innerModel().sharedImageVersion(); + } + public String osType() { return this.innerModel().osType(); } @@ -141,33 +158,12 @@ public List artifacts() { } } - public ArtifactDeploymentStatusProperties artifactDeploymentStatus() { - return this.innerModel().artifactDeploymentStatus(); - } - - public GalleryImageReference galleryImageReference() { - return this.innerModel().galleryImageReference(); - } - public String planId() { return this.innerModel().planId(); } - public ComputeVmProperties computeVm() { - return this.innerModel().computeVm(); - } - - public NetworkInterfaceProperties networkInterface() { - return this.innerModel().networkInterface(); - } - - public ApplicableSchedule applicableSchedule() { - ApplicableScheduleInner inner = this.innerModel().applicableSchedule(); - if (inner != null) { - return new ApplicableScheduleImpl(inner, this.manager()); - } else { - return null; - } + public Integer osDiskSizeGb() { + return this.innerModel().osDiskSizeGb(); } public OffsetDateTime expirationDate() { @@ -178,7 +174,7 @@ public Boolean allowClaim() { return this.innerModel().allowClaim(); } - public String storageType() { + public StorageTypes storageType() { return this.innerModel().storageType(); } @@ -212,6 +208,10 @@ public String lastKnownPowerState() { return this.innerModel().lastKnownPowerState(); } + public Boolean canApplyArtifacts() { + return this.innerModel().canApplyArtifacts(); + } + public String provisioningState() { return this.innerModel().provisioningState(); } @@ -220,6 +220,216 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } + public String deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public Integer artifactsApplied() { + return this.innerModel().artifactsApplied(); + } + + public Integer totalArtifacts() { + return this.innerModel().totalArtifacts(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String osTypeGalleryImageReferenceOsType() { + return this.innerModel().osTypeGalleryImageReferenceOsType(); + } + + public String version() { + return this.innerModel().version(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osTypeComputeVmOsType() { + return this.innerModel().osTypeComputeVmOsType(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String networkInterfaceId() { + return this.innerModel().networkInterfaceId(); + } + + public String osDiskId() { + return this.innerModel().osDiskId(); + } + + public List dataDiskIds() { + List inner = this.innerModel().dataDiskIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dataDisks() { + List inner = this.innerModel().dataDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String virtualNetworkId() { + return this.innerModel().virtualNetworkId(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String publicIpAddressId() { + return this.innerModel().publicIpAddressId(); + } + + public String publicIpAddress() { + return this.innerModel().publicIpAddress(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String rdpAuthority() { + return this.innerModel().rdpAuthority(); + } + + public String sshAuthority() { + return this.innerModel().sshAuthority(); + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerModel().createdDateApplicableScheduleCreatedDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String locationPropertiesLocation() { + return this.innerModel().locationPropertiesLocation(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -356,6 +566,16 @@ public void claim(Context context) { serviceManager.virtualMachines().claim(resourceGroupName, labName, name, context); } + public void clearArtifactResults() { + serviceManager.virtualMachines().clearArtifactResults(resourceGroupName, labName, name); + } + + public Response clearArtifactResultsWithResponse(Context context) { + return serviceManager + .virtualMachines() + .clearArtifactResultsWithResponse(resourceGroupName, labName, name, context); + } + public void detachDataDisk(DetachDataDiskProperties detachDataDiskProperties) { serviceManager.virtualMachines().detachDataDisk(resourceGroupName, labName, name, detachDataDiskProperties); } @@ -489,6 +709,21 @@ public LabVirtualMachineImpl withCustomImageId(String customImageId) { return this; } + public LabVirtualMachineImpl withGalleryImageVersionId(String galleryImageVersionId) { + this.innerModel().withGalleryImageVersionId(galleryImageVersionId); + return this; + } + + public LabVirtualMachineImpl withSharedImageId(String sharedImageId) { + this.innerModel().withSharedImageId(sharedImageId); + return this; + } + + public LabVirtualMachineImpl withSharedImageVersion(String sharedImageVersion) { + this.innerModel().withSharedImageVersion(sharedImageVersion); + return this; + } + public LabVirtualMachineImpl withSize(String size) { this.innerModel().withSize(size); return this; @@ -534,18 +769,13 @@ public LabVirtualMachineImpl withArtifacts(List artif return this; } - public LabVirtualMachineImpl withGalleryImageReference(GalleryImageReference galleryImageReference) { - this.innerModel().withGalleryImageReference(galleryImageReference); - return this; - } - public LabVirtualMachineImpl withPlanId(String planId) { this.innerModel().withPlanId(planId); return this; } - public LabVirtualMachineImpl withNetworkInterface(NetworkInterfaceProperties networkInterface) { - this.innerModel().withNetworkInterface(networkInterface); + public LabVirtualMachineImpl withOsDiskSizeGb(Integer osDiskSizeGb) { + this.innerModel().withOsDiskSizeGb(osDiskSizeGb); return this; } @@ -559,7 +789,7 @@ public LabVirtualMachineImpl withAllowClaim(Boolean allowClaim) { return this; } - public LabVirtualMachineImpl withStorageType(String storageType) { + public LabVirtualMachineImpl withStorageType(StorageTypes storageType) { this.innerModel().withStorageType(storageType); return this; } @@ -579,6 +809,76 @@ public LabVirtualMachineImpl withScheduleParameters(List inboundNatRules) { + this.innerModel().withInboundNatRules(inboundNatRules); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java new file mode 100644 index 000000000000..2fdb86120925 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabVirtualMachinePropertiesImpl.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachinePropertiesInner; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.ComputeDataDisk; +import com.azure.resourcemanager.devtestlabs.models.ComputeVmInstanceViewStatus; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineProperties; +import com.azure.resourcemanager.devtestlabs.models.ScheduleCreationParameter; +import com.azure.resourcemanager.devtestlabs.models.StorageTypes; +import com.azure.resourcemanager.devtestlabs.models.VirtualMachineCreationSource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LabVirtualMachinePropertiesImpl implements LabVirtualMachineProperties { + private LabVirtualMachinePropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + LabVirtualMachinePropertiesImpl( + LabVirtualMachinePropertiesInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String notes() { + return this.innerModel().notes(); + } + + public String ownerObjectId() { + return this.innerModel().ownerObjectId(); + } + + public String ownerUserPrincipalName() { + return this.innerModel().ownerUserPrincipalName(); + } + + public String createdByUserId() { + return this.innerModel().createdByUserId(); + } + + public String createdByUser() { + return this.innerModel().createdByUser(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String computeId() { + return this.innerModel().computeId(); + } + + public String customImageId() { + return this.innerModel().customImageId(); + } + + public String galleryImageVersionId() { + return this.innerModel().galleryImageVersionId(); + } + + public String sharedImageId() { + return this.innerModel().sharedImageId(); + } + + public String sharedImageVersion() { + return this.innerModel().sharedImageVersion(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String size() { + return this.innerModel().size(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public String sshKey() { + return this.innerModel().sshKey(); + } + + public Boolean isAuthenticationWithSshKey() { + return this.innerModel().isAuthenticationWithSshKey(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String labSubnetName() { + return this.innerModel().labSubnetName(); + } + + public String labVirtualNetworkId() { + return this.innerModel().labVirtualNetworkId(); + } + + public Boolean disallowPublicIpAddress() { + return this.innerModel().disallowPublicIpAddress(); + } + + public List artifacts() { + List inner = this.innerModel().artifacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String planId() { + return this.innerModel().planId(); + } + + public Integer osDiskSizeGb() { + return this.innerModel().osDiskSizeGb(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public Boolean allowClaim() { + return this.innerModel().allowClaim(); + } + + public StorageTypes storageType() { + return this.innerModel().storageType(); + } + + public VirtualMachineCreationSource virtualMachineCreationSource() { + return this.innerModel().virtualMachineCreationSource(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public List dataDiskParameters() { + List inner = this.innerModel().dataDiskParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scheduleParameters() { + List inner = this.innerModel().scheduleParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String lastKnownPowerState() { + return this.innerModel().lastKnownPowerState(); + } + + public Boolean canApplyArtifacts() { + return this.innerModel().canApplyArtifacts(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public String deploymentStatus() { + return this.innerModel().deploymentStatus(); + } + + public Integer artifactsApplied() { + return this.innerModel().artifactsApplied(); + } + + public Integer totalArtifacts() { + return this.innerModel().totalArtifacts(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String osTypeGalleryImageReferenceOsType() { + return this.innerModel().osTypeGalleryImageReferenceOsType(); + } + + public String version() { + return this.innerModel().version(); + } + + public List statuses() { + List inner = this.innerModel().statuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osTypeComputeVmOsType() { + return this.innerModel().osTypeComputeVmOsType(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String networkInterfaceId() { + return this.innerModel().networkInterfaceId(); + } + + public String osDiskId() { + return this.innerModel().osDiskId(); + } + + public List dataDiskIds() { + List inner = this.innerModel().dataDiskIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dataDisks() { + List inner = this.innerModel().dataDisks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String virtualNetworkId() { + return this.innerModel().virtualNetworkId(); + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String publicIpAddressId() { + return this.innerModel().publicIpAddressId(); + } + + public String publicIpAddress() { + return this.innerModel().publicIpAddress(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String rdpAuthority() { + return this.innerModel().rdpAuthority(); + } + + public String sshAuthority() { + return this.innerModel().sshAuthority(); + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDateApplicableScheduleCreatedDate() { + return this.innerModel().createdDateApplicableScheduleCreatedDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LabVirtualMachinePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java index 9bb8b8514d2f..42dd48adcb6e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsClientImpl.java @@ -38,13 +38,13 @@ import com.azure.resourcemanager.devtestlabs.fluent.models.GenerateUploadUriResponseInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabVhdInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; import com.azure.resourcemanager.devtestlabs.models.LabFragment; import com.azure.resourcemanager.devtestlabs.models.LabList; import com.azure.resourcemanager.devtestlabs.models.LabVhdList; -import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -83,7 +83,6 @@ private interface LabsService { Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -99,7 +98,6 @@ Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -118,7 +116,6 @@ Mono> getByResourceGroup( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -127,7 +124,7 @@ Mono> getByResourceGroup( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -197,7 +194,22 @@ Mono>> createEnvironment( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + @BodyParam("application/json") LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{name}/ensureCurrentUserProfile") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> ensureCurrentUserProfile( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -298,18 +310,17 @@ Mono> listVhdsNext( /** * List labs in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String expand, String filter, Integer top, String orderby) { + private Mono> listSinglePageAsync(String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -330,7 +341,6 @@ private Mono> listSinglePageAsync( .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - expand, filter, top, orderby, @@ -352,19 +362,19 @@ private Mono> listSinglePageAsync( /** * List labs in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String expand, String filter, Integer top, String orderby, Context context) { + String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -383,7 +393,6 @@ private Mono> listSinglePageAsync( .list( this.client.getEndpoint(), this.client.getSubscriptionId(), - expand, filter, top, orderby, @@ -404,19 +413,18 @@ private Mono> listSinglePageAsync( /** * List labs in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby) { + private PagedFlux listAsync(String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby), + () -> listSinglePageAsync(filter, top, orderby), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } @@ -425,36 +433,34 @@ private PagedFlux listAsync(String expand, String filter, Integer top, * * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby), + () -> listSinglePageAsync(filter, top, orderby), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List labs in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby, Context context) { + private PagedFlux listAsync(String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby, context), + () -> listSinglePageAsync(filter, top, orderby, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } @@ -463,51 +469,49 @@ private PagedFlux listAsync(String expand, String filter, Integer top, * * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(filter, top, orderby)); } /** * List labs in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listAsync(expand, filter, top, orderby, context)); + public PagedIterable list(String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(filter, top, orderby, context)); } /** * List labs in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -533,7 +537,6 @@ private Mono> listByResourceGroupSinglePageAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - expand, filter, top, orderby, @@ -556,19 +559,19 @@ private Mono> listByResourceGroupSinglePageAsync( * List labs in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { + String resourceGroupName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -592,7 +595,6 @@ private Mono> listByResourceGroupSinglePageAsync( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - expand, filter, top, orderby, @@ -614,20 +616,19 @@ private Mono> listByResourceGroupSinglePageAsync( * List labs in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, orderby), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } @@ -638,16 +639,15 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, orderby), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } @@ -655,21 +655,20 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName) { * List labs in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { + String resourceGroupName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby, context), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, orderby, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } @@ -680,35 +679,33 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby)); + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, orderby)); } /** * List labs in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, filter, top, orderby, context)); + String resourceGroupName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, orderby, context)); } /** @@ -716,15 +713,13 @@ public PagedIterable listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, String expand) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -754,7 +749,6 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -766,16 +760,15 @@ private Mono> getByResourceGroupWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, String expand, Context context) { + String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -803,36 +796,11 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get lab. - * - * @param resourceGroupName The name of the resource group. - * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String name, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get lab. * @@ -841,12 +809,11 @@ private Mono getByResourceGroupAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String name) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand) + return getByResourceGroupWithResponseAsync(resourceGroupName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -869,8 +836,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public LabInner getByResourceGroup(String resourceGroupName, String name) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, name, expand).block(); + return getByResourceGroupAsync(resourceGroupName, name).block(); } /** @@ -878,17 +844,15 @@ public LabInner getByResourceGroup(String resourceGroupName, String name) { * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, expand, context).block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); } /** @@ -900,7 +864,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return a lab along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -956,7 +920,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return a lab along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -1008,16 +972,16 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return the {@link PollerFlux} for polling of a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, LabInner lab) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, lab); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, this.client.getContext()); } /** @@ -1030,9 +994,9 @@ private PollerFlux, LabInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return the {@link PollerFlux} for polling of a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, LabInner lab, Context context) { context = this.client.mergeContext(context); @@ -1052,9 +1016,9 @@ private PollerFlux, LabInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return the {@link SyncPoller} for polling of a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabInner> beginCreateOrUpdate( String resourceGroupName, String name, LabInner lab) { return beginCreateOrUpdateAsync(resourceGroupName, name, lab).getSyncPoller(); @@ -1070,9 +1034,9 @@ public SyncPoller, LabInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return the {@link SyncPoller} for polling of a lab. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabInner> beginCreateOrUpdate( String resourceGroupName, String name, LabInner lab, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, name, lab, context).getSyncPoller(); @@ -1087,7 +1051,7 @@ public SyncPoller, LabInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return a lab on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String name, LabInner lab) { @@ -1106,7 +1070,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String name * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a lab. + * @return a lab on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String name, LabInner lab, Context context) { @@ -1156,7 +1120,7 @@ public LabInner createOrUpdate(String resourceGroupName, String name, LabInner l * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { @@ -1204,7 +1168,7 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1249,14 +1213,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1268,9 +1233,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String name, Context context) { context = this.client.mergeContext(context); @@ -1288,9 +1253,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); } @@ -1304,9 +1269,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); } @@ -1319,7 +1284,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String name) { @@ -1335,7 +1300,7 @@ private Mono deleteAsync(String resourceGroupName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String name, Context context) { @@ -1376,11 +1341,11 @@ public void delete(String resourceGroupName, String name, Context context) { * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param lab A lab. + * @param lab Allows modifying tags of labs. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return a lab along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String name, LabFragment lab) { @@ -1430,12 +1395,12 @@ private Mono> updateWithResponseAsync(String resourceGroupNam * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param lab A lab. + * @param lab Allows modifying tags of labs. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return a lab along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1483,11 +1448,11 @@ private Mono> updateWithResponseAsync( * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param lab A lab. + * @param lab Allows modifying tags of labs. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return a lab on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String name, LabFragment lab) { @@ -1507,7 +1472,7 @@ private Mono updateAsync(String resourceGroupName, String name, LabFra * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param lab A lab. + * @param lab Allows modifying tags of labs. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1523,12 +1488,12 @@ public LabInner update(String resourceGroupName, String name, LabFragment lab) { * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param lab A lab. + * @param lab Allows modifying tags of labs. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lab. + * @return a lab along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1544,7 +1509,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> claimAnyVmWithResponseAsync(String resourceGroupName, String name) { @@ -1592,7 +1557,7 @@ private Mono>> claimAnyVmWithResponseAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> claimAnyVmWithResponseAsync( @@ -1637,14 +1602,15 @@ private Mono>> claimAnyVmWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAnyVmAsync(String resourceGroupName, String name) { Mono>> mono = claimAnyVmWithResponseAsync(resourceGroupName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1656,9 +1622,9 @@ private PollerFlux, Void> beginClaimAnyVmAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAnyVmAsync( String resourceGroupName, String name, Context context) { context = this.client.mergeContext(context); @@ -1676,9 +1642,9 @@ private PollerFlux, Void> beginClaimAnyVmAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name) { return beginClaimAnyVmAsync(resourceGroupName, name).getSyncPoller(); } @@ -1692,9 +1658,9 @@ public SyncPoller, Void> beginClaimAnyVm(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaimAnyVm(String resourceGroupName, String name, Context context) { return beginClaimAnyVmAsync(resourceGroupName, name, context).getSyncPoller(); } @@ -1707,7 +1673,7 @@ public SyncPoller, Void> beginClaimAnyVm(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono claimAnyVmAsync(String resourceGroupName, String name) { @@ -1723,7 +1689,7 @@ private Mono claimAnyVmAsync(String resourceGroupName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono claimAnyVmAsync(String resourceGroupName, String name, Context context) { @@ -1770,11 +1736,13 @@ public void claimAnyVm(String resourceGroupName, String name, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createEnvironmentWithResponseAsync( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1829,13 +1797,13 @@ private Mono>> createEnvironmentWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createEnvironmentWithResponseAsync( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1887,16 +1855,19 @@ private Mono>> createEnvironmentWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCreateEnvironmentAsync( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter) { Mono>> mono = createEnvironmentWithResponseAsync(resourceGroupName, name, labVirtualMachineCreationParameter); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1909,13 +1880,13 @@ private PollerFlux, Void> beginCreateEnvironmentAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCreateEnvironmentAsync( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context) { context = this.client.mergeContext(context); Mono>> mono = @@ -1934,11 +1905,13 @@ private PollerFlux, Void> beginCreateEnvironmentAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreateEnvironment( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter) { return beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter).getSyncPoller(); } @@ -1952,13 +1925,13 @@ public SyncPoller, Void> beginCreateEnvironment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCreateEnvironment( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context) { return beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter, context) .getSyncPoller(); @@ -1973,11 +1946,13 @@ public SyncPoller, Void> beginCreateEnvironment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createEnvironmentAsync( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter) { return beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -1993,13 +1968,13 @@ private Mono createEnvironmentAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createEnvironmentAsync( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context) { return beginCreateEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter, context) .last() @@ -2018,7 +1993,9 @@ private Mono createEnvironmentAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public void createEnvironment( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter) { createEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter).block(); } @@ -2037,11 +2014,150 @@ public void createEnvironment( public void createEnvironment( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context) { createEnvironmentAsync(resourceGroupName, name, labVirtualMachineCreationParameter, context).block(); } + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> ensureCurrentUserProfileWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .ensureCurrentUserProfile( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> ensureCurrentUserProfileWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .ensureCurrentUserProfile( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono ensureCurrentUserProfileAsync(String resourceGroupName, String name) { + return ensureCurrentUserProfileWithResponseAsync(resourceGroupName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ensureCurrentUserProfile(String resourceGroupName, String name) { + ensureCurrentUserProfileAsync(resourceGroupName, name).block(); + } + + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response ensureCurrentUserProfileWithResponse(String resourceGroupName, String name, Context context) { + return ensureCurrentUserProfileWithResponseAsync(resourceGroupName, name, context).block(); + } + /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * @@ -2051,7 +2167,7 @@ public void createEnvironment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> exportResourceUsageWithResponseAsync( @@ -2110,7 +2226,7 @@ private Mono>> exportResourceUsageWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> exportResourceUsageWithResponseAsync( @@ -2168,16 +2284,17 @@ private Mono>> exportResourceUsageWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportResourceUsageAsync( String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { Mono>> mono = exportResourceUsageWithResponseAsync(resourceGroupName, name, exportResourceUsageParameters); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2190,9 +2307,9 @@ private PollerFlux, Void> beginExportResourceUsageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportResourceUsageAsync( String resourceGroupName, String name, @@ -2215,9 +2332,9 @@ private PollerFlux, Void> beginExportResourceUsageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { return beginExportResourceUsageAsync(resourceGroupName, name, exportResourceUsageParameters).getSyncPoller(); @@ -2233,9 +2350,9 @@ public SyncPoller, Void> beginExportResourceUsage( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExportResourceUsage( String resourceGroupName, String name, @@ -2254,7 +2371,7 @@ public SyncPoller, Void> beginExportResourceUsage( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono exportResourceUsageAsync( @@ -2274,7 +2391,7 @@ private Mono exportResourceUsageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono exportResourceUsageAsync( @@ -2332,7 +2449,8 @@ public void exportResourceUsage( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for generating an upload URI. + * @return response body for generating an upload URI along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateUploadUriWithResponseAsync( @@ -2391,7 +2509,8 @@ private Mono> generateUploadUriWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for generating an upload URI. + * @return response body for generating an upload URI along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateUploadUriWithResponseAsync( @@ -2446,7 +2565,7 @@ private Mono> generateUploadUriWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for generating an upload URI. + * @return response body for generating an upload URI on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono generateUploadUriAsync( @@ -2489,7 +2608,7 @@ public GenerateUploadUriResponseInner generateUploadUri( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for generating an upload URI. + * @return response body for generating an upload URI along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response generateUploadUriWithResponse( @@ -2507,7 +2626,7 @@ public Response generateUploadUriWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> importVirtualMachineWithResponseAsync( @@ -2567,7 +2686,7 @@ private Mono>> importVirtualMachineWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> importVirtualMachineWithResponseAsync( @@ -2626,16 +2745,17 @@ private Mono>> importVirtualMachineWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportVirtualMachineAsync( String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { Mono>> mono = importVirtualMachineWithResponseAsync(resourceGroupName, name, importLabVirtualMachineRequest); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2649,9 +2769,9 @@ private PollerFlux, Void> beginImportVirtualMachineAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportVirtualMachineAsync( String resourceGroupName, String name, @@ -2675,9 +2795,9 @@ private PollerFlux, Void> beginImportVirtualMachineAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, ImportLabVirtualMachineRequest importLabVirtualMachineRequest) { return beginImportVirtualMachineAsync(resourceGroupName, name, importLabVirtualMachineRequest).getSyncPoller(); @@ -2694,9 +2814,9 @@ public SyncPoller, Void> beginImportVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportVirtualMachine( String resourceGroupName, String name, @@ -2716,7 +2836,7 @@ public SyncPoller, Void> beginImportVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono importVirtualMachineAsync( @@ -2737,7 +2857,7 @@ private Mono importVirtualMachineAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono importVirtualMachineAsync( @@ -2796,7 +2916,8 @@ public void importVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVhdsSinglePageAsync(String resourceGroupName, String name) { @@ -2853,7 +2974,8 @@ private Mono> listVhdsSinglePageAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of Lab Vhd and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVhdsSinglePageAsync( @@ -2907,7 +3029,7 @@ private Mono> listVhdsSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listVhdsAsync(String resourceGroupName, String name) { @@ -2924,7 +3046,7 @@ private PagedFlux listVhdsAsync(String resourceGroupName, String na * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listVhdsAsync(String resourceGroupName, String name, Context context) { @@ -2941,7 +3063,7 @@ private PagedFlux listVhdsAsync(String resourceGroupName, String na * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVhds(String resourceGroupName, String name) { @@ -2957,7 +3079,7 @@ public PagedIterable listVhds(String resourceGroupName, String name * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVhds(String resourceGroupName, String name, Context context) { @@ -2971,7 +3093,8 @@ public PagedIterable listVhds(String resourceGroupName, String name * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -3008,7 +3131,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -3043,7 +3167,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -3080,7 +3205,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of labs and their properties along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -3115,7 +3241,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of Lab Vhd and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVhdsNextSinglePageAsync(String nextLink) { @@ -3151,7 +3278,8 @@ private Mono> listVhdsNextSinglePageAsync(String next * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVhdsNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java index 4ab00b44e03b..49b74d3d4eb0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/LabsImpl.java @@ -13,13 +13,13 @@ import com.azure.resourcemanager.devtestlabs.fluent.models.GenerateUploadUriResponseInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; import com.azure.resourcemanager.devtestlabs.fluent.models.LabVhdInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriResponse; import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; import com.azure.resourcemanager.devtestlabs.models.Lab; import com.azure.resourcemanager.devtestlabs.models.LabVhd; -import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter; import com.azure.resourcemanager.devtestlabs.models.Labs; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -40,8 +40,8 @@ public PagedIterable list() { return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); } - public PagedIterable list(String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = this.serviceClient().list(expand, filter, top, orderby, context); + public PagedIterable list(String filter, Integer top, String orderby, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); } @@ -51,9 +51,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { } public PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { + String resourceGroupName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, expand, filter, top, orderby, context); + this.serviceClient().listByResourceGroup(resourceGroupName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); } @@ -66,10 +66,9 @@ public Lab getByResourceGroup(String resourceGroupName, String name) { } } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, String expand, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, expand, context); + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -98,18 +97,28 @@ public void claimAnyVm(String resourceGroupName, String name, Context context) { } public void createEnvironment( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter) { + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter) { this.serviceClient().createEnvironment(resourceGroupName, name, labVirtualMachineCreationParameter); } public void createEnvironment( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context) { this.serviceClient().createEnvironment(resourceGroupName, name, labVirtualMachineCreationParameter, context); } + public void ensureCurrentUserProfile(String resourceGroupName, String name) { + this.serviceClient().ensureCurrentUserProfile(resourceGroupName, name); + } + + public Response ensureCurrentUserProfileWithResponse(String resourceGroupName, String name, Context context) { + return this.serviceClient().ensureCurrentUserProfileWithResponse(resourceGroupName, name, context); + } + public void exportResourceUsage( String resourceGroupName, String name, ExportResourceUsageParameters exportResourceUsageParameters) { this.serviceClient().exportResourceUsage(resourceGroupName, name, exportResourceUsageParameters); @@ -190,11 +199,10 @@ public Lab getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - String localExpand = null; - return this.getByResourceGroupWithResponse(resourceGroupName, name, localExpand, Context.NONE).getValue(); + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -210,7 +218,7 @@ public Response getByIdWithResponse(String id, String expand, Context conte new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, name, expand, context); + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); } public void deleteById(String id) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java index b6d0a0dd4cd3..3c9eb9d9d5f4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelImpl.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelInner; import com.azure.resourcemanager.devtestlabs.models.Event; @@ -48,6 +49,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String webhookUrl() { return this.innerModel().webhookUrl(); } @@ -176,23 +181,21 @@ public NotificationChannel apply(Context context) { } public NotificationChannel refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getNotificationChannels() - .getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, name, Context.NONE) .getValue(); return this; } public NotificationChannel refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getNotificationChannels() - .getWithResponse(resourceGroupName, labName, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, name, context) .getValue(); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java index a87fbf7dbe25..3b9d4f149952 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsClientImpl.java @@ -78,7 +78,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -98,7 +97,6 @@ Mono> get( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -186,18 +184,18 @@ Mono> listNext( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -227,7 +225,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -251,25 +248,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -297,7 +288,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -320,20 +310,20 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -345,16 +335,16 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -363,27 +353,21 @@ private PagedFlux listAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -395,15 +379,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); } /** @@ -411,26 +395,20 @@ public PagedIterable list(String resourceGroupName, St * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -439,15 +417,14 @@ public PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand) { + String resourceGroupName, String labName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -481,7 +458,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -494,16 +470,15 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -535,38 +510,11 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get notification channel. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get notification channel. * @@ -576,12 +524,11 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -605,8 +552,7 @@ private Mono getAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public NotificationChannelInner get(String resourceGroupName, String labName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, name, expand).block(); + return getAsync(resourceGroupName, labName, name).block(); } /** @@ -615,21 +561,20 @@ public NotificationChannelInner get(String resourceGroupName, String labName, St * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); } /** - * Create or replace an existing notification channel. + * Create or replace an existing Notification Channel. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -638,7 +583,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification. + * @return a notification along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -690,7 +635,7 @@ private Mono> createOrUpdateWithResponseAsync } /** - * Create or replace an existing notification channel. + * Create or replace an existing Notification Channel. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -700,7 +645,7 @@ private Mono> createOrUpdateWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification. + * @return a notification along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -753,7 +698,7 @@ private Mono> createOrUpdateWithResponseAsync } /** - * Create or replace an existing notification channel. + * Create or replace an existing Notification Channel. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -762,7 +707,7 @@ private Mono> createOrUpdateWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification. + * @return a notification on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -779,7 +724,7 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing notification channel. + * Create or replace an existing Notification Channel. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -797,7 +742,7 @@ public NotificationChannelInner createOrUpdate( } /** - * Create or replace an existing notification channel. + * Create or replace an existing Notification Channel. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -807,7 +752,7 @@ public NotificationChannelInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a notification. + * @return a notification along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -828,7 +773,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { @@ -881,7 +826,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -931,7 +876,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -963,7 +908,7 @@ public void delete(String resourceGroupName, String labName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { @@ -976,11 +921,11 @@ public Response deleteWithResponse(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param notificationChannel Allows modifying tags of notification channels. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 notification. + * @return a notification along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1037,12 +982,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param notificationChannel Allows modifying tags of notification channels. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 notification. + * @return a notification along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1100,11 +1045,11 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param notificationChannel Allows modifying tags of notification channels. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 notification. + * @return a notification on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1126,7 +1071,7 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param notificationChannel Allows modifying tags of notification channels. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1144,12 +1089,12 @@ public NotificationChannelInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param notificationChannel A notification. + * @param notificationChannel Allows modifying tags of notification channels. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 notification. + * @return a notification along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1171,7 +1116,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> notifyWithResponseAsync( @@ -1233,7 +1178,7 @@ private Mono> notifyWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> notifyWithResponseAsync( @@ -1291,7 +1236,7 @@ private Mono> notifyWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono notifyAsync( @@ -1327,7 +1272,7 @@ public void notify(String resourceGroupName, String labName, String name, Notify * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response notifyWithResponse( @@ -1342,7 +1287,8 @@ public Response notifyWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1378,7 +1324,8 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java index a9bd1f8dc8e7..3d192857e537 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/NotificationChannelsImpl.java @@ -36,15 +36,9 @@ public PagedIterable list(String resourceGroupName, String } public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new NotificationChannelImpl(inner1, this.manager())); } @@ -58,9 +52,9 @@ public NotificationChannel get(String resourceGroupName, String labName, String } public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -115,11 +109,10 @@ public NotificationChannel getById(String id) { "The resource ID '%s' is not valid. Missing path segment 'notificationchannels'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -145,7 +138,7 @@ public Response getByIdWithResponse(String id, String expan "The resource ID '%s' is not valid. Missing path segment 'notificationchannels'.", id))); } - return this.getWithResponse(resourceGroupName, labName, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, name, context); } public void deleteById(String id) { @@ -174,7 +167,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'notificationchannels'.", id))); } - this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java index 221adb955a34..c90aad8c24b2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationResultImpl.java @@ -6,7 +6,6 @@ import com.azure.resourcemanager.devtestlabs.fluent.models.OperationResultInner; import com.azure.resourcemanager.devtestlabs.models.HttpStatusCode; -import com.azure.resourcemanager.devtestlabs.models.OperationError; import com.azure.resourcemanager.devtestlabs.models.OperationResult; public final class OperationResultImpl implements OperationResult { @@ -28,8 +27,12 @@ public HttpStatusCode statusCode() { return this.innerModel().statusCode(); } - public OperationError error() { - return this.innerModel().error(); + public String code() { + return this.innerModel().code(); + } + + public String message() { + return this.innerModel().message(); } public OperationResultInner innerModel() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java index e7f0a8158bd4..5a4f7406317d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/OperationsClientImpl.java @@ -57,7 +57,7 @@ private interface OperationsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/locations/{locationName}/operations/{name}") - @ExpectedResponses({200, 202}) + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @@ -77,7 +77,7 @@ Mono> get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return operation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String locationName, String name) { @@ -124,7 +124,7 @@ private Mono> getWithResponseAsync(String locatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return operation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -168,7 +168,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String locationName, String name) { @@ -207,7 +207,7 @@ public OperationResultInner get(String locationName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String locationName, String name, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java index e67c849af13f..04d724159fc2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesClientImpl.java @@ -75,7 +75,6 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("policySetName") String policySetName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -96,7 +95,6 @@ Mono> get( @PathParam("labName") String labName, @PathParam("policySetName") String policySetName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -171,24 +169,18 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of policies and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String policySetName, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String policySetName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -222,7 +214,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, policySetName, - expand, filter, top, orderby, @@ -247,22 +238,21 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of policies and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, @@ -298,7 +288,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, policySetName, - expand, filter, top, orderby, @@ -322,26 +311,19 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String policySetName, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String policySetName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, policySetName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -354,16 +336,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String policySetName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, policySetName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -373,28 +354,26 @@ private PagedFlux listAsync(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, policySetName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -407,15 +386,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String policySetName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, policySetName, filter, top, orderby)); } /** @@ -424,28 +402,25 @@ public PagedIterable list(String resourceGroupName, String labName, * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, policySetName, expand, filter, top, orderby, context)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, policySetName, filter, top, orderby, context)); } /** @@ -455,15 +430,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String policySetName, String name, String expand) { + String resourceGroupName, String labName, String policySetName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -501,7 +475,6 @@ private Mono> getWithResponseAsync( labName, policySetName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -515,16 +488,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String policySetName, String name, String expand, Context context) { + String resourceGroupName, String labName, String policySetName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -560,7 +532,6 @@ private Mono> getWithResponseAsync( labName, policySetName, name, - expand, this.client.getApiVersion(), accept, context); @@ -573,42 +544,14 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String policySetName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, policySetName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get policy. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param policySetName The name of the policy set. - * @param name The name of the policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String policySetName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, policySetName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, policySetName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -633,8 +576,7 @@ private Mono getAsync(String resourceGroupName, String labName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public PolicyInner get(String resourceGroupName, String labName, String policySetName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, policySetName, name, expand).block(); + return getAsync(resourceGroupName, labName, policySetName, name).block(); } /** @@ -644,17 +586,16 @@ public PolicyInner get(String resourceGroupName, String labName, String policySe * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String policySetName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, policySetName, name, expand, context).block(); + String resourceGroupName, String labName, String policySetName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, policySetName, name, context).block(); } /** @@ -668,7 +609,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy. + * @return a Policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -734,7 +675,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy. + * @return a Policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -801,7 +742,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy. + * @return a Policy on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -848,7 +789,7 @@ public PolicyInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Policy. + * @return a Policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -872,7 +813,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -931,7 +872,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -986,7 +927,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String policySetName, String name) { @@ -1021,7 +962,7 @@ public void delete(String resourceGroupName, String labName, String policySetNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -1036,11 +977,11 @@ public Response deleteWithResponse( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param policy A Policy. + * @param policy Allows modifying tags of policies. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Policy. + * @return a Policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1101,12 +1042,12 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param policy A Policy. + * @param policy Allows modifying tags of policies. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Policy. + * @return a Policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1169,11 +1110,11 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param policy A Policy. + * @param policy Allows modifying tags of policies. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Policy. + * @return a Policy on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1196,7 +1137,7 @@ private Mono updateAsync( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param policy A Policy. + * @param policy Allows modifying tags of policies. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1215,12 +1156,12 @@ public PolicyInner update( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param policy A Policy. + * @param policy Allows modifying tags of policies. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Policy. + * @return a Policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1240,7 +1181,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of policies and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1276,7 +1218,8 @@ private Mono> listNextSinglePageAsync(String nextLink * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of policies and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java index d0c7d95fa529..fdc9aa4d5f12 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PoliciesImpl.java @@ -37,13 +37,12 @@ public PagedIterable list( String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, policySetName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, policySetName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new PolicyImpl(inner1, this.manager())); } @@ -57,9 +56,9 @@ public Policy get(String resourceGroupName, String labName, String policySetName } public Response getWithResponse( - String resourceGroupName, String labName, String policySetName, String name, String expand, Context context) { + String resourceGroupName, String labName, String policySetName, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, policySetName, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, policySetName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -110,13 +109,10 @@ public Policy getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'policies'.", id))); } - String localExpand = null; - return this - .getWithResponse(resourceGroupName, labName, policySetName, name, localExpand, Context.NONE) - .getValue(); + return this.getWithResponse(resourceGroupName, labName, policySetName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -146,7 +142,7 @@ public Response getByIdWithResponse(String id, String expand, Context co new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'policies'.", id))); } - return this.getWithResponse(resourceGroupName, labName, policySetName, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, policySetName, name, context); } public void deleteById(String id) { @@ -179,7 +175,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'policies'.", id))); } - this.deleteWithResponse(resourceGroupName, labName, policySetName, name, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, labName, policySetName, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java index 7712d7c5a2fa..bac94522339b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicyImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.PolicyInner; import com.azure.resourcemanager.devtestlabs.models.Policy; @@ -46,6 +47,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String description() { return this.innerModel().description(); } @@ -177,23 +182,21 @@ public Policy apply(Context context) { } public Policy refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getPolicies() - .getWithResponse(resourceGroupName, labName, policySetName, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, policySetName, name, Context.NONE) .getValue(); return this; } public Policy refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getPolicies() - .getWithResponse(resourceGroupName, labName, policySetName, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, policySetName, name, context) .getValue(); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetImpl.java new file mode 100644 index 000000000000..611c7cd070a4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.PolicySetInner; +import com.azure.resourcemanager.devtestlabs.models.PolicySet; + +public final class PolicySetImpl implements PolicySet { + private PolicySetInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + PolicySetImpl(PolicySetInner innerObject, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public PolicySetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java index 958f5b6d7f04..5cac40593795 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; @@ -17,6 +18,10 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; @@ -25,7 +30,9 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.fluent.PolicySetsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.EvaluatePoliciesResponseInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.PolicySetInner; import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; +import com.azure.resourcemanager.devtestlabs.models.PolicySetList; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in PolicySetsClient. */ @@ -56,6 +63,24 @@ public final class PolicySetsClientImpl implements PolicySetsClient { @Host("{$host}") @ServiceInterface(name = "DevTestLabsClientPol") private interface PolicySetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/policysets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" @@ -72,6 +97,243 @@ Mono> evaluatePolicies( @BodyParam("application/json") EvaluatePoliciesRequest evaluatePoliciesRequest, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); + } + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -84,7 +346,8 @@ Mono> evaluatePolicies( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for evaluating a policy set. + * @return response body for evaluating a policy set along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> evaluatePoliciesWithResponseAsync( @@ -147,7 +410,8 @@ private Mono> evaluatePoliciesWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for evaluating a policy set. + * @return response body for evaluating a policy set along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> evaluatePoliciesWithResponseAsync( @@ -210,7 +474,7 @@ private Mono> evaluatePoliciesWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for evaluating a policy set. + * @return response body for evaluating a policy set on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono evaluatePoliciesAsync( @@ -255,7 +519,7 @@ public EvaluatePoliciesResponseInner evaluatePolicies( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body for evaluating a policy set. + * @return response body for evaluating a policy set along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response evaluatePoliciesWithResponse( @@ -267,4 +531,77 @@ public Response evaluatePoliciesWithResponse( return evaluatePoliciesWithResponseAsync(resourceGroupName, labName, name, evaluatePoliciesRequest, context) .block(); } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java index 79fe57a17cee..ca4e79a8f60d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsImpl.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.devtestlabs.implementation; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.devtestlabs.fluent.PolicySetsClient; import com.azure.resourcemanager.devtestlabs.fluent.models.EvaluatePoliciesResponseInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.PolicySetInner; import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesResponse; +import com.azure.resourcemanager.devtestlabs.models.PolicySet; import com.azure.resourcemanager.devtestlabs.models.PolicySets; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -28,6 +31,18 @@ public PolicySetsImpl( this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return Utils.mapPage(inner, inner1 -> new PolicySetImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); + return Utils.mapPage(inner, inner1 -> new PolicySetImpl(inner1, this.manager())); + } + public EvaluatePoliciesResponse evaluatePolicies( String resourceGroupName, String labName, String name, EvaluatePoliciesRequest evaluatePoliciesRequest) { EvaluatePoliciesResponseInner inner = diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java index 109514e30e74..7629f43ea53c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ProviderOperationsClientImpl.java @@ -85,7 +85,8 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +119,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +150,7 @@ private Mono> listSinglePageAsync(Context * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +164,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +177,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +191,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +205,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +242,8 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java index 4cabe5c6c429..fa3dd50bf832 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ScheduleImpl.java @@ -5,18 +5,16 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; -import com.azure.resourcemanager.devtestlabs.models.DayDetails; import com.azure.resourcemanager.devtestlabs.models.EnableStatus; -import com.azure.resourcemanager.devtestlabs.models.HourDetails; -import com.azure.resourcemanager.devtestlabs.models.NotificationSettings; import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; import com.azure.resourcemanager.devtestlabs.models.Schedule; import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; -import com.azure.resourcemanager.devtestlabs.models.WeekDetails; import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; public final class ScheduleImpl implements Schedule, Schedule.Definition, Schedule.Update { @@ -49,6 +47,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public EnableStatus status() { return this.innerModel().status(); } @@ -57,26 +59,10 @@ public String taskType() { return this.innerModel().taskType(); } - public WeekDetails weeklyRecurrence() { - return this.innerModel().weeklyRecurrence(); - } - - public DayDetails dailyRecurrence() { - return this.innerModel().dailyRecurrence(); - } - - public HourDetails hourlyRecurrence() { - return this.innerModel().hourlyRecurrence(); - } - public String timeZoneId() { return this.innerModel().timeZoneId(); } - public NotificationSettings notificationSettings() { - return this.innerModel().notificationSettings(); - } - public OffsetDateTime createdDate() { return this.innerModel().createdDate(); } @@ -93,6 +79,43 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -179,23 +202,21 @@ public Schedule apply(Context context) { } public Schedule refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getGlobalSchedules() - .getByResourceGroupWithResponse(resourceGroupName, name, localExpand, Context.NONE) + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) .getValue(); return this; } public Schedule refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getGlobalSchedules() - .getByResourceGroupWithResponse(resourceGroupName, name, localExpand, context) + .getByResourceGroupWithResponse(resourceGroupName, name, context) .getValue(); return this; } @@ -246,33 +267,53 @@ public ScheduleImpl withTaskType(String taskType) { return this; } - public ScheduleImpl withWeeklyRecurrence(WeekDetails weeklyRecurrence) { - this.innerModel().withWeeklyRecurrence(weeklyRecurrence); + public ScheduleImpl withTimeZoneId(String timeZoneId) { + this.innerModel().withTimeZoneId(timeZoneId); return this; } - public ScheduleImpl withDailyRecurrence(DayDetails dailyRecurrence) { - this.innerModel().withDailyRecurrence(dailyRecurrence); + public ScheduleImpl withTargetResourceId(String targetResourceId) { + this.innerModel().withTargetResourceId(targetResourceId); return this; } - public ScheduleImpl withHourlyRecurrence(HourDetails hourlyRecurrence) { - this.innerModel().withHourlyRecurrence(hourlyRecurrence); + public ScheduleImpl withWeekdays(List weekdays) { + this.innerModel().withWeekdays(weekdays); return this; } - public ScheduleImpl withTimeZoneId(String timeZoneId) { - this.innerModel().withTimeZoneId(timeZoneId); + public ScheduleImpl withTime(String time) { + this.innerModel().withTime(time); return this; } - public ScheduleImpl withNotificationSettings(NotificationSettings notificationSettings) { - this.innerModel().withNotificationSettings(notificationSettings); + public ScheduleImpl withMinute(Integer minute) { + this.innerModel().withMinute(minute); return this; } - public ScheduleImpl withTargetResourceId(String targetResourceId) { - this.innerModel().withTargetResourceId(targetResourceId); + public ScheduleImpl withStatusNotificationSettingsStatus(EnableStatus statusNotificationSettingsStatus) { + this.innerModel().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); + return this; + } + + public ScheduleImpl withTimeInMinutes(Integer timeInMinutes) { + this.innerModel().withTimeInMinutes(timeInMinutes); + return this; + } + + public ScheduleImpl withWebhookUrl(String webhookUrl) { + this.innerModel().withWebhookUrl(webhookUrl); + return this; + } + + public ScheduleImpl withEmailRecipient(String emailRecipient) { + this.innerModel().withEmailRecipient(emailRecipient); + return this; + } + + public ScheduleImpl withNotificationLocale(String notificationLocale) { + this.innerModel().withNotificationLocale(notificationLocale); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java index a06ac0f58a08..c1ce7cc3df53 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesClientImpl.java @@ -81,7 +81,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -101,7 +100,6 @@ Mono> get( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -214,18 +212,18 @@ Mono> listApplicableNext( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -255,7 +253,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -279,25 +276,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -325,7 +316,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -348,20 +338,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -373,16 +362,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -391,27 +379,20 @@ private PagedFlux listAsync(String resourceGroupName, String labN * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -423,15 +404,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); } /** @@ -439,26 +419,19 @@ public PagedIterable list(String resourceGroupName, String labNam * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -467,15 +440,13 @@ public PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand) { + private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -509,7 +480,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -522,16 +492,15 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -563,37 +532,11 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get schedule. * @@ -603,12 +546,11 @@ private Mono getAsync(String resourceGroupName, String labName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -632,8 +574,7 @@ private Mono getAsync(String resourceGroupName, String labName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public ScheduleInner get(String resourceGroupName, String labName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, name, expand).block(); + return getAsync(resourceGroupName, labName, name).block(); } /** @@ -642,17 +583,16 @@ public ScheduleInner get(String resourceGroupName, String labName, String name) * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); } /** @@ -665,7 +605,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -726,7 +666,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -783,7 +723,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -827,7 +767,7 @@ public ScheduleInner createOrUpdate(String resourceGroupName, String labName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -844,7 +784,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { @@ -897,7 +837,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -947,7 +887,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -979,7 +919,7 @@ public void delete(String resourceGroupName, String labName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { @@ -992,11 +932,11 @@ public Response deleteWithResponse(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1052,12 +992,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1110,11 +1050,11 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1136,7 +1076,7 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1153,12 +1093,12 @@ public ScheduleInner update(String resourceGroupName, String labName, String nam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1175,7 +1115,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync( @@ -1229,7 +1169,7 @@ private Mono>> executeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync( @@ -1279,15 +1219,16 @@ private Mono>> executeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String name) { Mono>> mono = executeWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1300,9 +1241,9 @@ private PollerFlux, Void> beginExecuteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1321,9 +1262,9 @@ private PollerFlux, Void> beginExecuteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute(String resourceGroupName, String labName, String name) { return beginExecuteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1338,9 +1279,9 @@ public SyncPoller, Void> beginExecute(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String name, Context context) { return beginExecuteAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -1355,7 +1296,7 @@ public SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync(String resourceGroupName, String labName, String name) { @@ -1374,7 +1315,7 @@ private Mono executeAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync(String resourceGroupName, String labName, String name, Context context) { @@ -1423,7 +1364,8 @@ public void execute(String resourceGroupName, String labName, String name, Conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSinglePageAsync( @@ -1486,7 +1428,8 @@ private Mono> listApplicableSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSinglePageAsync( @@ -1545,7 +1488,7 @@ private Mono> listApplicableSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listApplicableAsync(String resourceGroupName, String labName, String name) { @@ -1564,7 +1507,7 @@ private PagedFlux listApplicableAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listApplicableAsync( @@ -1583,7 +1526,7 @@ private PagedFlux listApplicableAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listApplicable(String resourceGroupName, String labName, String name) { @@ -1600,7 +1543,7 @@ public PagedIterable listApplicable(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listApplicable( @@ -1615,7 +1558,8 @@ public PagedIterable listApplicable( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1651,7 +1595,8 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1686,7 +1631,8 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableNextSinglePageAsync(String nextLink) { @@ -1722,7 +1668,8 @@ private Mono> listApplicableNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java index b25644ac0d5f..84563f8484ba 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SchedulesImpl.java @@ -35,15 +35,9 @@ public PagedIterable list(String resourceGroupName, String labName) { } public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } @@ -56,10 +50,8 @@ public Schedule get(String resourceGroupName, String labName, String name) { } } - public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); + public Response getWithResponse(String resourceGroupName, String labName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java index 7b49d471fda4..bcdcac652ede 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.SecretInner; import com.azure.resourcemanager.devtestlabs.models.Secret; @@ -42,6 +43,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String value() { return this.innerModel().value(); } @@ -146,23 +151,21 @@ public Secret apply(Context context) { } public Secret refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getSecrets() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, username, name, Context.NONE) .getValue(); return this; } public Secret refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getSecrets() - .getWithResponse(resourceGroupName, labName, username, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, username, name, context) .getValue(); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java index 0627f5e5dfdb..52d2cd81dd80 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsClientImpl.java @@ -80,7 +80,6 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("userName") String username, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -101,7 +100,6 @@ Mono> get( @PathParam("labName") String labName, @PathParam("userName") String username, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -110,7 +108,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/users/{userName}/secrets/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -176,24 +174,18 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String username, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String username, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -227,7 +219,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, username, - expand, filter, top, orderby, @@ -252,22 +243,21 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -303,7 +293,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, username, - expand, filter, top, orderby, @@ -327,26 +316,19 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String username, - String expand, - String filter, - Integer top, - String orderby) { + String resourceGroupName, String labName, String username, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -359,16 +341,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String username) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -378,28 +359,26 @@ private PagedFlux listAsync(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, username, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -412,15 +391,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String username) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, username, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, username, filter, top, orderby)); } /** @@ -429,28 +407,25 @@ public PagedIterable list(String resourceGroupName, String labName, * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, expand, filter, top, orderby, context)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, username, filter, top, orderby, context)); } /** @@ -460,15 +435,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String username, String name, String expand) { + String resourceGroupName, String labName, String username, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -506,7 +480,6 @@ private Mono> getWithResponseAsync( labName, username, name, - expand, this.client.getApiVersion(), accept, context)) @@ -520,16 +493,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { + String resourceGroupName, String labName, String username, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -565,7 +537,6 @@ private Mono> getWithResponseAsync( labName, username, name, - expand, this.client.getApiVersion(), accept, context); @@ -578,42 +549,14 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String username, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get secret. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param name The name of the secret. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String username, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, name, expand) + return getWithResponseAsync(resourceGroupName, labName, username, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -638,8 +581,7 @@ private Mono getAsync(String resourceGroupName, String labName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public SecretInner get(String resourceGroupName, String labName, String username, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, username, name, expand).block(); + return getAsync(resourceGroupName, labName, username, name).block(); } /** @@ -649,17 +591,16 @@ public SecretInner get(String resourceGroupName, String labName, String username * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, name, expand, context).block(); + String resourceGroupName, String labName, String username, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, username, name, context).block(); } /** @@ -673,7 +614,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. + * @return a secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -739,7 +680,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. + * @return a secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -801,9 +742,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. + * @return the {@link PollerFlux} for polling of a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SecretInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, SecretInner secret) { Mono>> mono = @@ -811,7 +752,7 @@ private PollerFlux, SecretInner> beginCreateOrUpdateAsyn return this .client .getLroResult( - mono, this.client.getHttpPipeline(), SecretInner.class, SecretInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), SecretInner.class, SecretInner.class, this.client.getContext()); } /** @@ -826,9 +767,9 @@ private PollerFlux, SecretInner> beginCreateOrUpdateAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return the {@link PollerFlux} for polling of a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SecretInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, SecretInner secret, Context context) { context = this.client.mergeContext(context); @@ -851,9 +792,9 @@ private PollerFlux, SecretInner> beginCreateOrUpdateAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return the {@link SyncPoller} for polling of a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret).getSyncPoller(); @@ -871,9 +812,9 @@ public SyncPoller, SecretInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return the {@link SyncPoller} for polling of a secret. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SecretInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, SecretInner secret, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, secret, context).getSyncPoller(); @@ -890,7 +831,7 @@ public SyncPoller, SecretInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return a secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -912,7 +853,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a secret. + * @return a secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -971,7 +912,7 @@ public SecretInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1030,7 +971,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1085,7 +1026,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { @@ -1120,7 +1061,7 @@ public void delete(String resourceGroupName, String labName, String username, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -1135,11 +1076,11 @@ public Response deleteWithResponse( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param secret A secret. + * @param secret Allows modifying tags of secrets. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return a secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1200,12 +1141,12 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param secret A secret. + * @param secret Allows modifying tags of secrets. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return a secret along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1268,11 +1209,11 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param secret A secret. + * @param secret Allows modifying tags of secrets. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return a secret on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1295,7 +1236,7 @@ private Mono updateAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param secret A secret. + * @param secret Allows modifying tags of secrets. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1314,12 +1255,12 @@ public SecretInner update( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param secret A secret. + * @param secret Allows modifying tags of secrets. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 secret. + * @return a secret along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1339,7 +1280,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1375,7 +1317,8 @@ private Mono> listNextSinglePageAsync(String nextLink * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java index 21f9a5350bc2..2b7147b3466a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SecretsImpl.java @@ -37,13 +37,12 @@ public PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, username, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, username, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); } @@ -57,9 +56,9 @@ public Secret get(String resourceGroupName, String labName, String username, Str } public Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context) { + String resourceGroupName, String labName, String username, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, username, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -110,11 +109,10 @@ public Secret getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, username, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, username, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -144,7 +142,7 @@ public Response getByIdWithResponse(String id, String expand, Context co new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); } - return this.getWithResponse(resourceGroupName, labName, username, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, username, name, context); } public void deleteById(String id) { @@ -177,7 +175,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); } - this.deleteWithResponse(resourceGroupName, labName, username, name, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, labName, username, name, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java index 596e8b5278d6..a6ae7c221eb0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricImpl.java @@ -6,13 +6,16 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricInner; import com.azure.resourcemanager.devtestlabs.models.ApplicableSchedule; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; import com.azure.resourcemanager.devtestlabs.models.ServiceFabricFragment; +import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; public final class ServiceFabricImpl implements ServiceFabric, ServiceFabric.Definition, ServiceFabric.Update { @@ -45,6 +48,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String externalServiceFabricId() { return this.innerModel().externalServiceFabricId(); } @@ -53,21 +60,106 @@ public String environmentId() { return this.innerModel().environmentId(); } - public ApplicableSchedule applicableSchedule() { - ApplicableScheduleInner inner = this.innerModel().applicableSchedule(); + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); if (inner != null) { - return new ApplicableScheduleImpl(inner, this.manager()); + return Collections.unmodifiableList(inner); } else { - return null; + return Collections.emptyList(); } } - public String provisioningState() { - return this.innerModel().provisioningState(); + public String time() { + return this.innerModel().time(); } - public String uniqueIdentifier() { - return this.innerModel().uniqueIdentifier(); + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String locationPropertiesLocation() { + return this.innerModel().locationPropertiesLocation(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public Region region() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java new file mode 100644 index 000000000000..c95014c1c130 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricPropertiesImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricPropertiesInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.ServiceFabricProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ServiceFabricPropertiesImpl implements ServiceFabricProperties { + private ServiceFabricPropertiesInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + ServiceFabricPropertiesImpl( + ServiceFabricPropertiesInner innerObject, + com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String externalServiceFabricId() { + return this.innerModel().externalServiceFabricId(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SystemData systemDataPropertiesSystemData() { + return this.innerModel().systemDataPropertiesSystemData(); + } + + public EnableStatus status() { + return this.innerModel().status(); + } + + public String taskType() { + return this.innerModel().taskType(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String provisioningStateApplicableScheduleProvisioningState() { + return this.innerModel().provisioningStateApplicableScheduleProvisioningState(); + } + + public String uniqueIdentifierApplicableScheduleUniqueIdentifier() { + return this.innerModel().uniqueIdentifierApplicableScheduleUniqueIdentifier(); + } + + public List weekdays() { + List inner = this.innerModel().weekdays(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String time() { + return this.innerModel().time(); + } + + public Integer minute() { + return this.innerModel().minute(); + } + + public EnableStatus statusNotificationSettingsStatus() { + return this.innerModel().statusNotificationSettingsStatus(); + } + + public Integer timeInMinutes() { + return this.innerModel().timeInMinutes(); + } + + public String webhookUrl() { + return this.innerModel().webhookUrl(); + } + + public String emailRecipient() { + return this.innerModel().emailRecipient(); + } + + public String notificationLocale() { + return this.innerModel().notificationLocale(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tagsPropertiesTags() { + Map inner = this.innerModel().tagsPropertiesTags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ServiceFabricPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java index b7d38893ec42..3c151c2df97f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesClientImpl.java @@ -84,7 +84,6 @@ Mono> list( @PathParam("labName") String labName, @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -106,7 +105,6 @@ Mono> get( @PathParam("userName") String username, @PathParam("serviceFabricName") String serviceFabricName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -203,14 +201,14 @@ Mono> listNext( * @param labName The name of the lab. * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -218,7 +216,6 @@ private Mono> listSinglePageAsync( String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby) { @@ -260,7 +257,6 @@ private Mono> listSinglePageAsync( labName, username, serviceFabricName, - expand, filter, top, orderby, @@ -286,15 +282,15 @@ private Mono> listSinglePageAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -302,7 +298,6 @@ private Mono> listSinglePageAsync( String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby, @@ -343,7 +338,6 @@ private Mono> listSinglePageAsync( labName, username, serviceFabricName, - expand, filter, top, orderby, @@ -368,14 +362,13 @@ private Mono> listSinglePageAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -383,14 +376,11 @@ private PagedFlux listAsync( String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, serviceFabricName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -404,19 +394,16 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String username, String serviceFabricName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, username, serviceFabricName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -427,15 +414,14 @@ private PagedFlux listAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -443,7 +429,6 @@ private PagedFlux listAsync( String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby, @@ -451,7 +436,7 @@ private PagedFlux listAsync( return new PagedFlux<>( () -> listSinglePageAsync( - resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby, context), + resourceGroupName, labName, username, serviceFabricName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -465,17 +450,16 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String username, String serviceFabricName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby)); + listAsync(resourceGroupName, labName, username, serviceFabricName, filter, top, orderby)); } /** @@ -485,15 +469,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -501,13 +484,12 @@ public PagedIterable list( String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby, context)); + listAsync(resourceGroupName, labName, username, serviceFabricName, filter, top, orderby, context)); } /** @@ -518,20 +500,14 @@ public PagedIterable list( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, - String labName, - String username, - String serviceFabricName, - String name, - String expand) { + String resourceGroupName, String labName, String username, String serviceFabricName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -574,7 +550,6 @@ private Mono> getWithResponseAsync( username, serviceFabricName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -589,12 +564,11 @@ private Mono> getWithResponseAsync( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -603,7 +577,6 @@ private Mono> getWithResponseAsync( String username, String serviceFabricName, String name, - String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -645,45 +618,11 @@ private Mono> getWithResponseAsync( username, serviceFabricName, name, - expand, this.client.getApiVersion(), accept, context); } - /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param username The name of the user profile. - * @param serviceFabricName The name of the service fabric. - * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String labName, - String username, - String serviceFabricName, - String name, - String expand) { - return getWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Get schedule. * @@ -695,13 +634,12 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String labName, String username, String serviceFabricName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -728,8 +666,7 @@ private Mono getAsync( @ServiceMethod(returns = ReturnType.SINGLE) public ScheduleInner get( String resourceGroupName, String labName, String username, String serviceFabricName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, username, serviceFabricName, name, expand).block(); + return getAsync(resourceGroupName, labName, username, serviceFabricName, name).block(); } /** @@ -740,12 +677,11 @@ public ScheduleInner get( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -754,10 +690,8 @@ public Response getWithResponse( String username, String serviceFabricName, String name, - String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, expand, context) - .block(); + return getWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name, context).block(); } /** @@ -772,7 +706,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -849,7 +783,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -923,7 +857,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -982,7 +916,7 @@ public ScheduleInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -1009,7 +943,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1074,7 +1008,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1140,7 +1074,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1179,7 +1113,7 @@ public void delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -1200,11 +1134,11 @@ public Response deleteWithResponse( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1276,12 +1210,12 @@ private Mono> updateWithResponseAsync( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1351,11 +1285,11 @@ private Mono> updateWithResponseAsync( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1384,7 +1318,7 @@ private Mono updateAsync( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1409,12 +1343,12 @@ public ScheduleInner update( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1440,7 +1374,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync( @@ -1505,7 +1439,7 @@ private Mono>> executeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync( @@ -1571,16 +1505,17 @@ private Mono>> executeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String username, String serviceFabricName, String name) { Mono>> mono = executeWithResponseAsync(resourceGroupName, labName, username, serviceFabricName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1595,9 +1530,9 @@ private PollerFlux, Void> beginExecuteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, @@ -1624,9 +1559,9 @@ private PollerFlux, Void> beginExecuteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String username, String serviceFabricName, String name) { return beginExecuteAsync(resourceGroupName, labName, username, serviceFabricName, name).getSyncPoller(); @@ -1644,9 +1579,9 @@ public SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, @@ -1669,7 +1604,7 @@ public SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync( @@ -1691,7 +1626,7 @@ private Mono executeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync( @@ -1755,7 +1690,8 @@ public void execute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1791,7 +1727,8 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java index 4dbc34089f87..1d7f4c87f045 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricSchedulesImpl.java @@ -42,7 +42,6 @@ public PagedIterable list( String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby, @@ -50,7 +49,7 @@ public PagedIterable list( PagedIterable inner = this .serviceClient() - .list(resourceGroupName, labName, username, serviceFabricName, expand, filter, top, orderby, context); + .list(resourceGroupName, labName, username, serviceFabricName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } @@ -70,12 +69,11 @@ public Response getWithResponse( String username, String serviceFabricName, String name, - String expand, Context context) { Response inner = this .serviceClient() - .getWithResponse(resourceGroupName, labName, username, serviceFabricName, name, expand, context); + .getWithResponse(resourceGroupName, labName, username, serviceFabricName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java index 43f01fd55391..a252f8662c0c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceFabricsClientImpl.java @@ -113,7 +113,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/users/{userName}/servicefabrics/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -231,13 +231,14 @@ Mono> listNext( * @param labName The name of the lab. * @param username The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -307,14 +308,15 @@ private Mono> listSinglePageAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -382,13 +384,13 @@ private Mono> listSinglePageAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -413,7 +415,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String username) { @@ -433,14 +435,14 @@ private PagedFlux listAsync(String resourceGroupName, String * @param labName The name of the lab. * @param username The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -466,7 +468,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String username) { @@ -484,14 +486,14 @@ public PagedIterable list(String resourceGroupName, String l * @param labName The name of the lab. * @param username The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -518,7 +520,7 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -579,7 +581,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -636,7 +638,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -662,7 +664,7 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String username, String name) { @@ -708,7 +710,7 @@ public ServiceFabricInner get(String resourceGroupName, String labName, String u * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -717,7 +719,7 @@ public Response getWithResponse( } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -727,7 +729,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric. + * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -782,7 +784,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -793,7 +795,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric. + * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -850,7 +852,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -860,9 +862,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric. + * @return the {@link PollerFlux} for polling of a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceFabricInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric) { Mono>> mono = @@ -870,11 +872,15 @@ private PollerFlux, ServiceFabricInner> beginCrea return this .client .getLroResult( - mono, this.client.getHttpPipeline(), ServiceFabricInner.class, ServiceFabricInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + ServiceFabricInner.class, + ServiceFabricInner.class, + this.client.getContext()); } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -885,9 +891,9 @@ private PollerFlux, ServiceFabricInner> beginCrea * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return the {@link PollerFlux} for polling of a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ServiceFabricInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, @@ -905,7 +911,7 @@ private PollerFlux, ServiceFabricInner> beginCrea } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -915,16 +921,16 @@ private PollerFlux, ServiceFabricInner> beginCrea * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return the {@link SyncPoller} for polling of a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, String username, String name, ServiceFabricInner serviceFabric) { return beginCreateOrUpdateAsync(resourceGroupName, labName, username, name, serviceFabric).getSyncPoller(); } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -935,9 +941,9 @@ public SyncPoller, ServiceFabricInner> beginCreat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return the {@link SyncPoller} for polling of a Service Fabric. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ServiceFabricInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -950,7 +956,7 @@ public SyncPoller, ServiceFabricInner> beginCreat } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -960,7 +966,7 @@ public SyncPoller, ServiceFabricInner> beginCreat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return a Service Fabric on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -971,7 +977,7 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -982,7 +988,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Service Fabric. + * @return a Service Fabric on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -998,7 +1004,7 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1017,7 +1023,7 @@ public ServiceFabricInner createOrUpdate( } /** - * Create or replace an existing service fabric. This operation can take a while to complete. + * Create or replace an existing Service Fabric. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1051,7 +1057,7 @@ public ServiceFabricInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1110,7 +1116,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1165,15 +1171,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String username, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1187,9 +1194,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String username, String name, Context context) { context = this.client.mergeContext(context); @@ -1210,9 +1217,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name) { return beginDeleteAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1229,9 +1236,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String username, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -1247,7 +1254,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String username, String name) { @@ -1267,7 +1274,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1317,11 +1324,11 @@ public void delete(String resourceGroupName, String labName, String username, St * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param serviceFabric Allows modifying tags of service fabrics. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1382,12 +1389,12 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param serviceFabric Allows modifying tags of service fabrics. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return a Service Fabric along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1450,11 +1457,11 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param serviceFabric Allows modifying tags of service fabrics. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return a Service Fabric on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1477,7 +1484,7 @@ private Mono updateAsync( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param serviceFabric Allows modifying tags of service fabrics. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1496,12 +1503,12 @@ public ServiceFabricInner update( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the service fabric. - * @param serviceFabric A Service Fabric. + * @param serviceFabric Allows modifying tags of service fabrics. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Service Fabric. + * @return a Service Fabric along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1524,7 +1531,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSchedulesWithResponseAsync( @@ -1583,7 +1591,8 @@ private Mono> listApplicableSchedulesWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSchedulesWithResponseAsync( @@ -1638,7 +1647,7 @@ private Mono> listApplicableSchedulesWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listApplicableSchedulesAsync( @@ -1683,7 +1692,7 @@ public ApplicableScheduleInner listApplicableSchedules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listApplicableSchedulesWithResponse( @@ -1701,7 +1710,7 @@ public Response listApplicableSchedulesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync( @@ -1760,7 +1769,7 @@ private Mono>> startWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync( @@ -1815,15 +1824,16 @@ private Mono>> startWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync( String resourceGroupName, String labName, String username, String name) { Mono>> mono = startWithResponseAsync(resourceGroupName, labName, username, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1837,9 +1847,9 @@ private PollerFlux, Void> beginStartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync( String resourceGroupName, String labName, String username, String name, Context context) { context = this.client.mergeContext(context); @@ -1860,9 +1870,9 @@ private PollerFlux, Void> beginStartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name) { return beginStartAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -1879,9 +1889,9 @@ public SyncPoller, Void> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart( String resourceGroupName, String labName, String username, String name, Context context) { return beginStartAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -1897,7 +1907,7 @@ public SyncPoller, Void> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String resourceGroupName, String labName, String username, String name) { @@ -1917,7 +1927,7 @@ private Mono startAsync(String resourceGroupName, String labName, String u * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync( @@ -1970,7 +1980,7 @@ public void start(String resourceGroupName, String labName, String username, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync( @@ -2029,7 +2039,7 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync( @@ -2084,15 +2094,16 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync( String resourceGroupName, String labName, String username, String name) { Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, username, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2106,9 +2117,9 @@ private PollerFlux, Void> beginStopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync( String resourceGroupName, String labName, String username, String name, Context context) { context = this.client.mergeContext(context); @@ -2129,9 +2140,9 @@ private PollerFlux, Void> beginStopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop( String resourceGroupName, String labName, String username, String name) { return beginStopAsync(resourceGroupName, labName, username, name).getSyncPoller(); @@ -2148,9 +2159,9 @@ public SyncPoller, Void> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop( String resourceGroupName, String labName, String username, String name, Context context) { return beginStopAsync(resourceGroupName, labName, username, name, context).getSyncPoller(); @@ -2166,7 +2177,7 @@ public SyncPoller, Void> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String resourceGroupName, String labName, String username, String name) { @@ -2186,7 +2197,7 @@ private Mono stopAsync(String resourceGroupName, String labName, String us * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync( @@ -2236,7 +2247,8 @@ public void stop(String resourceGroupName, String labName, String username, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2272,7 +2284,8 @@ private Mono> listNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java index 0d21a4ce2ba0..51f1efc2cafe 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnerImpl.java @@ -5,9 +5,10 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner; -import com.azure.resourcemanager.devtestlabs.models.IdentityProperties; +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; import com.azure.resourcemanager.devtestlabs.models.ServiceRunner; import java.util.Collections; import java.util.Map; @@ -42,8 +43,45 @@ public Map tags() { } } - public IdentityProperties identity() { - return this.innerModel().identity(); + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String identityUsageType() { + return this.innerModel().identityUsageType(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public ManagedIdentityType typeIdentityType() { + return this.innerModel().typeIdentityType(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String clientSecretUrl() { + return this.innerModel().clientSecretUrl(); + } + + public Map userAssignedIdentities() { + Map inner = this.innerModel().userAssignedIdentities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public Region region() { @@ -79,8 +117,7 @@ public ServiceRunner create() { serviceManager .serviceClient() .getServiceRunners() - .createOrUpdateWithResponse(resourceGroupName, labName, name, this.innerModel(), Context.NONE) - .getValue(); + .createOrUpdate(resourceGroupName, labName, name, this.innerModel(), Context.NONE); return this; } @@ -89,8 +126,7 @@ public ServiceRunner create(Context context) { serviceManager .serviceClient() .getServiceRunners() - .createOrUpdateWithResponse(resourceGroupName, labName, name, this.innerModel(), context) - .getValue(); + .createOrUpdate(resourceGroupName, labName, name, this.innerModel(), context); return this; } @@ -109,8 +145,7 @@ public ServiceRunner apply() { serviceManager .serviceClient() .getServiceRunners() - .createOrUpdateWithResponse(resourceGroupName, labName, name, this.innerModel(), Context.NONE) - .getValue(); + .createOrUpdate(resourceGroupName, labName, name, this.innerModel(), Context.NONE); return this; } @@ -119,8 +154,7 @@ public ServiceRunner apply(Context context) { serviceManager .serviceClient() .getServiceRunners() - .createOrUpdateWithResponse(resourceGroupName, labName, name, this.innerModel(), context) - .getValue(); + .createOrUpdate(resourceGroupName, labName, name, this.innerModel(), context); return this; } @@ -168,8 +202,33 @@ public ServiceRunnerImpl withTags(Map tags) { return this; } - public ServiceRunnerImpl withIdentity(IdentityProperties identity) { - this.innerModel().withIdentity(identity); + public ServiceRunnerImpl withIdentityUsageType(String identityUsageType) { + this.innerModel().withIdentityUsageType(identityUsageType); + return this; + } + + public ServiceRunnerImpl withTypeIdentityType(ManagedIdentityType typeIdentityType) { + this.innerModel().withTypeIdentityType(typeIdentityType); + return this; + } + + public ServiceRunnerImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public ServiceRunnerImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public ServiceRunnerImpl withClientSecretUrl(String clientSecretUrl) { + this.innerModel().withClientSecretUrl(clientSecretUrl); + return this; + } + + public ServiceRunnerImpl withUserAssignedIdentities(Map userAssignedIdentities) { + this.innerModel().withUserAssignedIdentities(userAssignedIdentities); return this; } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java index 45d23bcaffae..80958577453d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersClientImpl.java @@ -19,14 +19,24 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.devtestlabs.fluent.ServiceRunnersClient; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner; +import com.azure.resourcemanager.devtestlabs.models.ServiceRunnerList; +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 ServiceRunnersClient. */ @@ -57,6 +67,24 @@ public final class ServiceRunnersClientImpl implements ServiceRunnersClient { @Host("{$host}") @ServiceInterface(name = "DevTestLabsClientSer") private interface ServiceRunnersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/servicerunners") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" @@ -77,9 +105,9 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/servicerunners/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -94,9 +122,9 @@ Mono> createOrUpdate( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/servicerunners/{name}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -105,6 +133,243 @@ Mono> delete( @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); + } + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -116,7 +381,7 @@ Mono> delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -170,7 +435,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -220,7 +485,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { @@ -261,7 +526,7 @@ public ServiceRunnerInner get(String resourceGroupName, String labName, String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -270,7 +535,7 @@ public Response getWithResponse( } /** - * Create or replace an existing service runner. + * Create or replace an existing Service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -279,10 +544,11 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a container for a managed identity to execute DevTest lab services. + * @return a container for a managed identity to execute DevTest lab services along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( + private Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner) { if (this.client.getEndpoint() == null) { return Mono @@ -330,7 +596,7 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing service runner. + * Create or replace an existing Service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -340,10 +606,11 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a container for a managed identity to execute DevTest lab services. + * @return a container for a managed identity to execute DevTest lab services along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( + private Mono>> createOrUpdateWithResponseAsync( String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -388,7 +655,7 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing service runner. + * Create or replace an existing Service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -397,24 +664,130 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a container for a managed identity to execute DevTest lab services. + * @return the {@link PollerFlux} for polling of a container for a managed identity to execute DevTest lab services. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceRunnerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, name, serviceRunner); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceRunnerInner.class, + ServiceRunnerInner.class, + this.client.getContext()); + } + + /** + * Create or replace an existing Service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param serviceRunner A container for a managed identity to execute DevTest lab services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a container for a managed identity to execute DevTest lab services. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceRunnerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, name, serviceRunner, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServiceRunnerInner.class, ServiceRunnerInner.class, context); + } + + /** + * Create or replace an existing Service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param serviceRunner A container for a managed identity to execute DevTest lab services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container for a managed identity to execute DevTest lab services. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceRunnerInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, serviceRunner).getSyncPoller(); + } + + /** + * Create or replace an existing Service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param serviceRunner A container for a managed identity to execute DevTest lab services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a container for a managed identity to execute DevTest lab services. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceRunnerInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, serviceRunner, context).getSyncPoller(); + } + + /** + * Create or replace an existing Service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param serviceRunner A container for a managed identity to execute DevTest lab services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 container for a managed identity to execute DevTest lab services on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, serviceRunner) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, serviceRunner) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or replace an existing service runner. + * Create or replace an existing Service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param serviceRunner A container for a managed identity to execute DevTest lab services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 container for a managed identity to execute DevTest lab services on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, name, serviceRunner, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace an existing Service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -432,7 +805,7 @@ public ServiceRunnerInner createOrUpdate( } /** - * Create or replace an existing service runner. + * Create or replace an existing Service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -445,13 +818,13 @@ public ServiceRunnerInner createOrUpdate( * @return a container for a managed identity to execute DevTest lab services. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( + public ServiceRunnerInner createOrUpdate( String resourceGroupName, String labName, String name, ServiceRunnerInner serviceRunner, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, serviceRunner, context).block(); + return createOrUpdateAsync(resourceGroupName, labName, name, serviceRunner, context).block(); } /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -459,10 +832,11 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -503,7 +877,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -512,10 +886,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( + private Mono>> deleteWithResponseAsync( String resourceGroupName, String labName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -554,23 +928,118 @@ private Mono> deleteWithResponseAsync( } /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { + return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); + } + + /** + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the service runner. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); + } + + /** + * Delete service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { - return deleteWithResponseAsync(resourceGroupName, labName, name).flatMap((Response res) -> Mono.empty()); + return beginDeleteAsync(resourceGroupName, labName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete service runner. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the service runner. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, labName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -585,7 +1054,7 @@ public void delete(String resourceGroupName, String labName, String name) { } /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -594,10 +1063,82 @@ public void delete(String resourceGroupName, String labName, String name) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, labName, name, context).block(); + public void delete(String resourceGroupName, String labName, String name, Context context) { + deleteAsync(resourceGroupName, labName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java index f3e1ec6938dd..9678464b45e8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/ServiceRunnersImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.devtestlabs.implementation; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; @@ -27,6 +28,18 @@ public ServiceRunnersImpl( this.serviceManager = serviceManager; } + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return Utils.mapPage(inner, inner1 -> new ServiceRunnerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); + return Utils.mapPage(inner, inner1 -> new ServiceRunnerImpl(inner1, this.manager())); + } + public ServiceRunner get(String resourceGroupName, String labName, String name) { ServiceRunnerInner inner = this.serviceClient().get(resourceGroupName, labName, name); if (inner != null) { @@ -55,8 +68,8 @@ public void delete(String resourceGroupName, String labName, String name) { this.serviceClient().delete(resourceGroupName, labName, name); } - public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, labName, name, context); + public void delete(String resourceGroupName, String labName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, labName, name, context); } public ServiceRunner getById(String id) { @@ -137,10 +150,10 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'servicerunners'.", id))); } - this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); + this.delete(resourceGroupName, labName, name, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -164,7 +177,7 @@ public Response deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'servicerunners'.", id))); } - return this.deleteWithResponse(resourceGroupName, labName, name, context); + this.delete(resourceGroupName, labName, name, context); } private ServiceRunnersClient serviceClient() { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleriesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleriesClientImpl.java new file mode 100644 index 000000000000..bc9b6c8e7362 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleriesClientImpl.java @@ -0,0 +1,1136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.SharedGalleriesClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.devtestlabs.models.SharedGalleryFragment; +import com.azure.resourcemanager.devtestlabs.models.SharedGalleryList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SharedGalleriesClient. */ +public final class SharedGalleriesClientImpl implements SharedGalleriesClient { + private final ClientLogger logger = new ClientLogger(SharedGalleriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SharedGalleriesService service; + + /** The service client containing this operation class. */ + private final DevTestLabsClientImpl client; + + /** + * Initializes an instance of SharedGalleriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SharedGalleriesClientImpl(DevTestLabsClientImpl client) { + this.service = + RestProxy.create(SharedGalleriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevTestLabsClientSharedGalleries to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevTestLabsClientSha") + private interface SharedGalleriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SharedGalleryInner sharedGallery, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SharedGalleryFragment sharedGallery, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); + } + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); + } + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String labName, String name) { + return getWithResponseAsync(resourceGroupName, labName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedGalleryInner get(String resourceGroupName, String labName, String name) { + return getAsync(resourceGroupName, labName, name).block(); + } + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); + } + + /** + * Create or replace an existing Shared Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Properties of a shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String name, SharedGalleryInner sharedGallery) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedGallery == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedGallery is required and cannot be null.")); + } else { + sharedGallery.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + sharedGallery, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace an existing Shared Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Properties of a shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String name, SharedGalleryInner sharedGallery, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedGallery == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedGallery is required and cannot be null.")); + } else { + sharedGallery.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + sharedGallery, + accept, + context); + } + + /** + * Create or replace an existing Shared Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Properties of a shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String name, SharedGalleryInner sharedGallery) { + return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, sharedGallery) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or replace an existing Shared Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Properties of a shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedGalleryInner createOrUpdate( + String resourceGroupName, String labName, String name, SharedGalleryInner sharedGallery) { + return createOrUpdateAsync(resourceGroupName, labName, name, sharedGallery).block(); + } + + /** + * Create or replace an existing Shared Gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Properties of a shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String labName, String name, SharedGalleryInner sharedGallery, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, labName, name, sharedGallery, context).block(); + } + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String labName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String labName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String labName, String name) { + return deleteWithResponseAsync(resourceGroupName, labName, name).flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 labName, String name) { + deleteAsync(resourceGroupName, labName, name).block(); + } + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, labName, name, context).block(); + } + + /** + * Allows modifying tags of shared galleries. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Allows modifying tags of shared galleries. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String labName, String name, SharedGalleryFragment sharedGallery) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedGallery == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedGallery is required and cannot be null.")); + } else { + sharedGallery.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + sharedGallery, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of shared galleries. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Allows modifying tags of shared galleries. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String labName, String name, SharedGalleryFragment sharedGallery, 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedGallery == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedGallery is required and cannot be null.")); + } else { + sharedGallery.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + sharedGallery, + accept, + context); + } + + /** + * Allows modifying tags of shared galleries. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Allows modifying tags of shared galleries. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String labName, String name, SharedGalleryFragment sharedGallery) { + return updateWithResponseAsync(resourceGroupName, labName, name, sharedGallery) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Allows modifying tags of shared galleries. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Allows modifying tags of shared galleries. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedGalleryInner update( + String resourceGroupName, String labName, String name, SharedGalleryFragment sharedGallery) { + return updateAsync(resourceGroupName, labName, name, sharedGallery).block(); + } + + /** + * Allows modifying tags of shared galleries. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param sharedGallery Allows modifying tags of shared galleries. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared gallery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String labName, String name, SharedGalleryFragment sharedGallery, Context context) { + return updateWithResponseAsync(resourceGroupName, labName, name, sharedGallery, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleriesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleriesImpl.java new file mode 100644 index 000000000000..d416c4d0f1b6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleriesImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.SharedGalleriesClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.devtestlabs.models.SharedGalleries; +import com.azure.resourcemanager.devtestlabs.models.SharedGallery; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SharedGalleriesImpl implements SharedGalleries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleriesImpl.class); + + private final SharedGalleriesClient innerClient; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public SharedGalleriesImpl( + SharedGalleriesClient innerClient, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, labName); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); + return Utils.mapPage(inner, inner1 -> new SharedGalleryImpl(inner1, this.manager())); + } + + public SharedGallery get(String resourceGroupName, String labName, String name) { + SharedGalleryInner inner = this.serviceClient().get(resourceGroupName, labName, name); + if (inner != null) { + return new SharedGalleryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String labName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SharedGalleryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String labName, String name) { + this.serviceClient().delete(resourceGroupName, labName, name); + } + + public Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, labName, name, context); + } + + public SharedGallery getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + this.deleteWithResponse(resourceGroupName, labName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + return this.deleteWithResponse(resourceGroupName, labName, name, context); + } + + private SharedGalleriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + public SharedGalleryImpl define(String name) { + return new SharedGalleryImpl(name, this.manager()); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleryImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleryImpl.java new file mode 100644 index 000000000000..439a1d03a7ac --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedGalleryImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedGalleryInner; +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.azure.resourcemanager.devtestlabs.models.SharedGallery; +import com.azure.resourcemanager.devtestlabs.models.SharedGalleryFragment; +import java.util.Collections; +import java.util.Map; + +public final class SharedGalleryImpl implements SharedGallery, SharedGallery.Definition, SharedGallery.Update { + private SharedGalleryInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String galleryId() { + return this.innerModel().galleryId(); + } + + public EnableState allowAllImages() { + return this.innerModel().allowAllImages(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SharedGalleryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String labName; + + private String name; + + private SharedGalleryFragment updateSharedGallery; + + public SharedGalleryImpl withExistingLab(String resourceGroupName, String labName) { + this.resourceGroupName = resourceGroupName; + this.labName = labName; + return this; + } + + public SharedGallery create() { + this.innerObject = + serviceManager + .serviceClient() + .getSharedGalleries() + .createOrUpdateWithResponse(resourceGroupName, labName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SharedGallery create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSharedGalleries() + .createOrUpdateWithResponse(resourceGroupName, labName, name, this.innerModel(), context) + .getValue(); + return this; + } + + SharedGalleryImpl(String name, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = new SharedGalleryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SharedGalleryImpl update() { + this.updateSharedGallery = new SharedGalleryFragment(); + return this; + } + + public SharedGallery apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSharedGalleries() + .updateWithResponse(resourceGroupName, labName, name, updateSharedGallery, Context.NONE) + .getValue(); + return this; + } + + public SharedGallery apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSharedGalleries() + .updateWithResponse(resourceGroupName, labName, name, updateSharedGallery, context) + .getValue(); + return this; + } + + SharedGalleryImpl( + SharedGalleryInner innerObject, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "sharedgalleries"); + } + + public SharedGallery refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSharedGalleries() + .getWithResponse(resourceGroupName, labName, name, Context.NONE) + .getValue(); + return this; + } + + public SharedGallery refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSharedGalleries() + .getWithResponse(resourceGroupName, labName, name, context) + .getValue(); + return this; + } + + public SharedGalleryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SharedGalleryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SharedGalleryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSharedGallery.withTags(tags); + return this; + } + } + + public SharedGalleryImpl withGalleryId(String galleryId) { + this.innerModel().withGalleryId(galleryId); + return this; + } + + public SharedGalleryImpl withAllowAllImages(EnableState allowAllImages) { + this.innerModel().withAllowAllImages(allowAllImages); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImageImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImageImpl.java new file mode 100644 index 000000000000..7a6ee9278051 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImageImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedImageInner; +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.azure.resourcemanager.devtestlabs.models.ImageType; +import com.azure.resourcemanager.devtestlabs.models.ImageVersionProperties; +import com.azure.resourcemanager.devtestlabs.models.OsType; +import com.azure.resourcemanager.devtestlabs.models.SharedImage; +import com.azure.resourcemanager.devtestlabs.models.SharedImageFragment; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SharedImageImpl implements SharedImage, SharedImage.Definition, SharedImage.Update { + private SharedImageInner innerObject; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String definitionName() { + return this.innerModel().definitionName(); + } + + public OsType osType() { + return this.innerModel().osType(); + } + + public ImageType imageType() { + return this.innerModel().imageType(); + } + + public EnableState enableState() { + return this.innerModel().enableState(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List versions() { + List inner = this.innerModel().versions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uniqueIdentifier() { + return this.innerModel().uniqueIdentifier(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SharedImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String labName; + + private String sharedGalleryName; + + private String name; + + private SharedImageFragment updateSharedImage; + + public SharedImageImpl withExistingSharedgallery( + String resourceGroupName, String labName, String sharedGalleryName) { + this.resourceGroupName = resourceGroupName; + this.labName = labName; + this.sharedGalleryName = sharedGalleryName; + return this; + } + + public SharedImage create() { + this.innerObject = + serviceManager + .serviceClient() + .getSharedImages() + .createOrUpdateWithResponse( + resourceGroupName, labName, sharedGalleryName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SharedImage create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSharedImages() + .createOrUpdateWithResponse( + resourceGroupName, labName, sharedGalleryName, name, this.innerModel(), context) + .getValue(); + return this; + } + + SharedImageImpl(String name, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = new SharedImageInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SharedImageImpl update() { + this.updateSharedImage = new SharedImageFragment(); + return this; + } + + public SharedImage apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSharedImages() + .updateWithResponse( + resourceGroupName, labName, sharedGalleryName, name, updateSharedImage, Context.NONE) + .getValue(); + return this; + } + + public SharedImage apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSharedImages() + .updateWithResponse(resourceGroupName, labName, sharedGalleryName, name, updateSharedImage, context) + .getValue(); + return this; + } + + SharedImageImpl( + SharedImageInner innerObject, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); + this.sharedGalleryName = Utils.getValueFromIdByName(innerObject.id(), "sharedgalleries"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "sharedimages"); + } + + public SharedImage refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSharedImages() + .getWithResponse(resourceGroupName, labName, sharedGalleryName, name, localExpand, Context.NONE) + .getValue(); + return this; + } + + public SharedImage refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSharedImages() + .getWithResponse(resourceGroupName, labName, sharedGalleryName, name, localExpand, context) + .getValue(); + return this; + } + + public SharedImageImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SharedImageImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SharedImageImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSharedImage.withTags(tags); + return this; + } + } + + public SharedImageImpl withDefinitionName(String definitionName) { + this.innerModel().withDefinitionName(definitionName); + return this; + } + + public SharedImageImpl withOsType(OsType osType) { + this.innerModel().withOsType(osType); + return this; + } + + public SharedImageImpl withImageType(ImageType imageType) { + this.innerModel().withImageType(imageType); + return this; + } + + public SharedImageImpl withEnableState(EnableState enableState) { + this.innerModel().withEnableState(enableState); + return this; + } + + public SharedImageImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public SharedImageImpl withVersions(List versions) { + this.innerModel().withVersions(versions); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImagesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImagesClientImpl.java new file mode 100644 index 000000000000..7f932b7fc72a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImagesClientImpl.java @@ -0,0 +1,1349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.SharedImagesClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedImageInner; +import com.azure.resourcemanager.devtestlabs.models.SharedImageFragment; +import com.azure.resourcemanager.devtestlabs.models.SharedImageList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SharedImagesClient. */ +public final class SharedImagesClientImpl implements SharedImagesClient { + private final ClientLogger logger = new ClientLogger(SharedImagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SharedImagesService service; + + /** The service client containing this operation class. */ + private final DevTestLabsClientImpl client; + + /** + * Initializes an instance of SharedImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SharedImagesClientImpl(DevTestLabsClientImpl client) { + this.service = + RestProxy.create(SharedImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DevTestLabsClientSharedImages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DevTestLabsClientSha") + private interface SharedImagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("sharedGalleryName") String sharedGalleryName, + @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("sharedGalleryName") String sharedGalleryName, + @PathParam("name") String name, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("sharedGalleryName") String sharedGalleryName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SharedImageInner sharedImage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("sharedGalleryName") String sharedGalleryName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/sharedgalleries/{sharedGalleryName}/sharedimages/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("sharedGalleryName") String sharedGalleryName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SharedImageFragment sharedImage, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + expand, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby, + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + expand, + filter, + top, + orderby, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, sharedGalleryName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String labName, String sharedGalleryName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, labName, sharedGalleryName, expand, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, labName, sharedGalleryName, expand, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String labName, String sharedGalleryName) { + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>( + listAsync(resourceGroupName, labName, sharedGalleryName, expand, filter, top, orderby)); + } + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, labName, sharedGalleryName, expand, filter, top, orderby, context)); + } + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String sharedGalleryName, String name, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + expand, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + expand, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String labName, String sharedGalleryName, String name, String expand) { + return getWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared 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 shared image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String labName, String sharedGalleryName, String name) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared 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 shared image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedImageInner get(String resourceGroupName, String labName, String sharedGalleryName, String name) { + final String expand = null; + return getAsync(resourceGroupName, labName, sharedGalleryName, name, expand).block(); + } + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + String expand, + Context context) { + return getWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name, expand, context).block(); + } + + /** + * Create or replace an existing Shared Image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Properties of a shared 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 properties of a shared image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String sharedGalleryName, String name, SharedImageInner sharedImage) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedImage == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedImage is required and cannot be null.")); + } else { + sharedImage.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + this.client.getApiVersion(), + sharedImage, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace an existing Shared Image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Properties of a shared 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 properties of a shared image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageInner sharedImage, + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedImage == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedImage is required and cannot be null.")); + } else { + sharedImage.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + this.client.getApiVersion(), + sharedImage, + accept, + context); + } + + /** + * Create or replace an existing Shared Image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Properties of a shared 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 properties of a shared image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String sharedGalleryName, String name, SharedImageInner sharedImage) { + return createOrUpdateWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or replace an existing Shared Image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Properties of a shared 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 properties of a shared image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedImageInner createOrUpdate( + String resourceGroupName, String labName, String sharedGalleryName, String name, SharedImageInner sharedImage) { + return createOrUpdateAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage).block(); + } + + /** + * Create or replace an existing Shared Image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Properties of a shared 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 properties of a shared image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageInner sharedImage, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, labName, sharedGalleryName, name, sharedImage, context) + .block(); + } + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String labName, String sharedGalleryName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String labName, String sharedGalleryName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String labName, String sharedGalleryName, String name) { + return deleteWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String labName, String sharedGalleryName, String name) { + deleteAsync(resourceGroupName, labName, sharedGalleryName, name).block(); + } + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String labName, String sharedGalleryName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name, context).block(); + } + + /** + * Allows modifying tags of shared images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Allows modifying tags of shared images. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageFragment sharedImage) { + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedImage == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedImage is required and cannot be null.")); + } else { + sharedImage.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + this.client.getApiVersion(), + sharedImage, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Allows modifying tags of shared images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Allows modifying tags of shared images. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageFragment sharedImage, + 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 (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (sharedGalleryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sharedGalleryName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sharedImage == null) { + return Mono.error(new IllegalArgumentException("Parameter sharedImage is required and cannot be null.")); + } else { + sharedImage.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + sharedGalleryName, + name, + this.client.getApiVersion(), + sharedImage, + accept, + context); + } + + /** + * Allows modifying tags of shared images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Allows modifying tags of shared images. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageFragment sharedImage) { + return updateWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Allows modifying tags of shared images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Allows modifying tags of shared images. All other properties will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SharedImageInner update( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageFragment sharedImage) { + return updateAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage).block(); + } + + /** + * Allows modifying tags of shared images. All other properties will be ignored. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param sharedImage Allows modifying tags of shared images. All other properties will be ignored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a shared image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + SharedImageFragment sharedImage, + Context context) { + return updateWithResponseAsync(resourceGroupName, labName, sharedGalleryName, name, sharedImage, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImagesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImagesImpl.java new file mode 100644 index 000000000000..e1c92e409a64 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/SharedImagesImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.SharedImagesClient; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedImageInner; +import com.azure.resourcemanager.devtestlabs.models.SharedImage; +import com.azure.resourcemanager.devtestlabs.models.SharedImages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SharedImagesImpl implements SharedImages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedImagesImpl.class); + + private final SharedImagesClient innerClient; + + private final com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager; + + public SharedImagesImpl( + SharedImagesClient innerClient, com.azure.resourcemanager.devtestlabs.DevTestLabsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String labName, String sharedGalleryName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, labName, sharedGalleryName); + return Utils.mapPage(inner, inner1 -> new SharedImageImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, labName, sharedGalleryName, expand, filter, top, orderby, context); + return Utils.mapPage(inner, inner1 -> new SharedImageImpl(inner1, this.manager())); + } + + public SharedImage get(String resourceGroupName, String labName, String sharedGalleryName, String name) { + SharedImageInner inner = this.serviceClient().get(resourceGroupName, labName, sharedGalleryName, name); + if (inner != null) { + return new SharedImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + String expand, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labName, sharedGalleryName, name, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SharedImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String labName, String sharedGalleryName, String name) { + this.serviceClient().delete(resourceGroupName, labName, sharedGalleryName, name); + } + + public Response deleteWithResponse( + String resourceGroupName, String labName, String sharedGalleryName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, labName, sharedGalleryName, name, context); + } + + public SharedImage getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String sharedGalleryName = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (sharedGalleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedimages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sharedimages'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, labName, sharedGalleryName, name, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String sharedGalleryName = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (sharedGalleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedimages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sharedimages'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, sharedGalleryName, name, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String sharedGalleryName = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (sharedGalleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedimages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sharedimages'.", id))); + } + this.deleteWithResponse(resourceGroupName, labName, sharedGalleryName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String labName = Utils.getValueFromIdByName(id, "labs"); + if (labName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); + } + String sharedGalleryName = Utils.getValueFromIdByName(id, "sharedgalleries"); + if (sharedGalleryName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedgalleries'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sharedimages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sharedimages'.", id))); + } + return this.deleteWithResponse(resourceGroupName, labName, sharedGalleryName, name, context); + } + + private SharedImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager() { + return this.serviceManager; + } + + public SharedImageImpl define(String name) { + return new SharedImageImpl(name, this.manager()); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java index 13aca3cc5174..02196d3df380 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UserImpl.java @@ -5,12 +5,11 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.UserInner; import com.azure.resourcemanager.devtestlabs.models.User; import com.azure.resourcemanager.devtestlabs.models.UserFragment; -import com.azure.resourcemanager.devtestlabs.models.UserIdentity; -import com.azure.resourcemanager.devtestlabs.models.UserSecretStore; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -45,12 +44,8 @@ public Map tags() { } } - public UserIdentity identity() { - return this.innerModel().identity(); - } - - public UserSecretStore secretStore() { - return this.innerModel().secretStore(); + public SystemData systemData() { + return this.innerModel().systemData(); } public OffsetDateTime createdDate() { @@ -65,6 +60,34 @@ public String uniqueIdentifier() { return this.innerModel().uniqueIdentifier(); } + public String principalName() { + return this.innerModel().principalName(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String objectId() { + return this.innerModel().objectId(); + } + + public String appId() { + return this.innerModel().appId(); + } + + public String keyVaultUri() { + return this.innerModel().keyVaultUri(); + } + + public String keyVaultId() { + return this.innerModel().keyVaultId(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -153,23 +176,21 @@ public User apply(Context context) { } public User refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getUsers() - .getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, name, Context.NONE) .getValue(); return this; } public User refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getUsers() - .getWithResponse(resourceGroupName, labName, name, localExpand, context) + .getWithResponse(resourceGroupName, labName, name, context) .getValue(); return this; } @@ -194,13 +215,38 @@ public UserImpl withTags(Map tags) { } } - public UserImpl withIdentity(UserIdentity identity) { - this.innerModel().withIdentity(identity); + public UserImpl withPrincipalName(String principalName) { + this.innerModel().withPrincipalName(principalName); + return this; + } + + public UserImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public UserImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public UserImpl withObjectId(String objectId) { + this.innerModel().withObjectId(objectId); + return this; + } + + public UserImpl withAppId(String appId) { + this.innerModel().withAppId(appId); + return this; + } + + public UserImpl withKeyVaultUri(String keyVaultUri) { + this.innerModel().withKeyVaultUri(keyVaultUri); return this; } - public UserImpl withSecretStore(UserSecretStore secretStore) { - this.innerModel().withSecretStore(secretStore); + public UserImpl withKeyVaultId(String keyVaultId) { + this.innerModel().withKeyVaultId(keyVaultId); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java index c02c18145d71..ec144c9f5830 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersClientImpl.java @@ -79,7 +79,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -99,7 +98,6 @@ Mono> get( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -108,7 +106,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/users/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -170,18 +168,18 @@ Mono> listNext( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of users and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -211,7 +209,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -235,25 +232,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of users and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -281,7 +272,6 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, labName, - expand, filter, top, orderby, @@ -304,20 +294,19 @@ private Mono> listSinglePageAsync( * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, String labName, String expand, String filter, Integer top, String orderby) { + String resourceGroupName, String labName, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -329,16 +318,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -347,27 +335,20 @@ private PagedFlux listAsync(String resourceGroupName, String labName) * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -379,15 +360,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby)); } /** @@ -395,26 +375,19 @@ public PagedIterable list(String resourceGroupName, String labName) { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labName, expand, filter, top, orderby, context)); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, labName, filter, top, orderby, context)); } /** @@ -423,15 +396,13 @@ public PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand) { + private Mono> getWithResponseAsync(String resourceGroupName, String labName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -465,7 +436,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -478,16 +448,15 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String name, String expand, Context context) { + String resourceGroupName, String labName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -519,7 +488,6 @@ private Mono> getWithResponseAsync( resourceGroupName, labName, name, - expand, this.client.getApiVersion(), accept, context); @@ -531,40 +499,14 @@ private Mono> getWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get user profile. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param name The name of the user profile. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -588,8 +530,7 @@ private Mono getAsync(String resourceGroupName, String labName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public UserInner get(String resourceGroupName, String labName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, name, expand).block(); + return getAsync(resourceGroupName, labName, name).block(); } /** @@ -598,17 +539,15 @@ public UserInner get(String resourceGroupName, String labName, String name) { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labName, name, expand, context).block(); + public Response getWithResponse(String resourceGroupName, String labName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, name, context).block(); } /** @@ -621,7 +560,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -682,7 +621,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -739,16 +678,16 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the {@link PollerFlux} for polling of profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UserInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, UserInner user) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, labName, name, user); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, this.client.getContext()); } /** @@ -762,9 +701,9 @@ private PollerFlux, UserInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the {@link PollerFlux} for polling of profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UserInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, UserInner user, Context context) { context = this.client.mergeContext(context); @@ -786,9 +725,9 @@ private PollerFlux, UserInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the {@link SyncPoller} for polling of profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, user).getSyncPoller(); @@ -805,9 +744,9 @@ public SyncPoller, UserInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return the {@link SyncPoller} for polling of profile of a lab user. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UserInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, UserInner user, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, user, context).getSyncPoller(); @@ -823,7 +762,7 @@ public SyncPoller, UserInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String labName, String name, UserInner user) { @@ -843,7 +782,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String lab * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -898,7 +837,7 @@ public UserInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -952,7 +891,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1002,14 +941,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1022,9 +962,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1043,9 +983,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1060,9 +1000,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -1077,7 +1017,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -1094,7 +1034,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { @@ -1140,11 +1080,11 @@ public void delete(String resourceGroupName, String labName, String name, Contex * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param user Allows modifying tags of user profiles. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1200,12 +1140,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param user Allows modifying tags of user profiles. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1258,11 +1198,11 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param user Allows modifying tags of user profiles. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String labName, String name, UserFragment user) { @@ -1283,7 +1223,7 @@ private Mono updateAsync(String resourceGroupName, String labName, St * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param user Allows modifying tags of user profiles. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1300,12 +1240,12 @@ public UserInner update(String resourceGroupName, String labName, String name, U * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param user Profile of a lab user. + * @param user Allows modifying tags of user profiles. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return profile of a lab user. + * @return profile of a lab user along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1320,7 +1260,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of users and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1356,7 +1297,8 @@ private Mono> listNextSinglePageAsync(String nextLink) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of users and their properties along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java index 2b84a68e2c6e..6c0d988e10c0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/UsersImpl.java @@ -33,15 +33,9 @@ public PagedIterable list(String resourceGroupName, String labName) { } public PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this.serviceClient().list(resourceGroupName, labName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); } @@ -54,10 +48,8 @@ public User get(String resourceGroupName, String labName, String name) { } } - public Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, name, expand, context); + public Response getWithResponse(String resourceGroupName, String labName, String name, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -100,11 +92,10 @@ public User getById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } - String localExpand = null; - return this.getWithResponse(resourceGroupName, labName, name, localExpand, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, labName, name, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, String expand, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -127,7 +118,7 @@ public Response getByIdWithResponse(String id, String expand, Context cont new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } - return this.getWithResponse(resourceGroupName, labName, name, expand, context); + return this.getWithResponse(resourceGroupName, labName, name, context); } public void deleteById(String id) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java index f48ffd17e939..f0f493e2f601 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesClientImpl.java @@ -83,7 +83,6 @@ Mono> list( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("labName") String labName, @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @QueryParam("$orderby") String orderby, @@ -104,7 +103,6 @@ Mono> get( @PathParam("labName") String labName, @PathParam("virtualMachineName") String virtualMachineName, @PathParam("name") String name, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -196,21 +194,20 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby) { @@ -248,7 +245,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, virtualMachineName, - expand, filter, top, orderby, @@ -273,22 +269,21 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, @@ -325,7 +320,6 @@ private Mono> listSinglePageAsync( resourceGroupName, labName, virtualMachineName, - expand, filter, top, orderby, @@ -349,26 +343,24 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -381,16 +373,15 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName, String virtualMachineName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby), + () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, filter, top, orderby), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -400,30 +391,26 @@ private PagedFlux listAsync(String resourceGroupName, String labN * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, context), + () -> listSinglePageAsync(resourceGroupName, labName, virtualMachineName, filter, top, orderby, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -436,16 +423,14 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName, String virtualMachineName) { - final String expand = null; final String filter = null; final Integer top = null; final String orderby = null; - return new PagedIterable<>( - listAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(resourceGroupName, labName, virtualMachineName, filter, top, orderby)); } /** @@ -454,28 +439,26 @@ public PagedIterable list(String resourceGroupName, String labNam * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, context)); + listAsync(resourceGroupName, labName, virtualMachineName, filter, top, orderby, context)); } /** @@ -485,15 +468,14 @@ public PagedIterable list( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, String labName, String virtualMachineName, String name, String expand) { + String resourceGroupName, String labName, String virtualMachineName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -532,7 +514,6 @@ private Mono> getWithResponseAsync( labName, virtualMachineName, name, - expand, this.client.getApiVersion(), accept, context)) @@ -546,21 +527,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, - String labName, - String virtualMachineName, - String name, - String expand, - Context context) { + String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -597,7 +572,6 @@ private Mono> getWithResponseAsync( labName, virtualMachineName, name, - expand, this.client.getApiVersion(), accept, context); @@ -610,43 +584,15 @@ private Mono> getWithResponseAsync( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labName, String virtualMachineName, String name, String expand) { - return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get schedule. - * - * @param resourceGroupName The name of the resource group. - * @param labName The name of the lab. - * @param virtualMachineName The name of the virtual machine. - * @param name The name of the schedule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String labName, String virtualMachineName, String name) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, expand) + return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, name) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -671,8 +617,7 @@ private Mono getAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public ScheduleInner get(String resourceGroupName, String labName, String virtualMachineName, String name) { - final String expand = null; - return getAsync(resourceGroupName, labName, virtualMachineName, name, expand).block(); + return getAsync(resourceGroupName, labName, virtualMachineName, name).block(); } /** @@ -682,22 +627,16 @@ public ScheduleInner get(String resourceGroupName, String labName, String virtua * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String resourceGroupName, - String labName, - String virtualMachineName, - String name, - String expand, - Context context) { - return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, expand, context).block(); + String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, name, context).block(); } /** @@ -711,7 +650,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -778,7 +717,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -846,7 +785,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -893,7 +832,7 @@ public ScheduleInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -917,7 +856,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -977,7 +916,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1033,7 +972,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String virtualMachineName, String name) { @@ -1068,7 +1007,7 @@ public void delete(String resourceGroupName, String labName, String virtualMachi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -1083,11 +1022,11 @@ public Response deleteWithResponse( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1149,12 +1088,12 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1218,11 +1157,11 @@ private Mono> updateWithResponseAsync( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1245,7 +1184,7 @@ private Mono updateAsync( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1264,12 +1203,12 @@ public ScheduleInner update( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 schedule. + * @return a schedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1292,7 +1231,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync( @@ -1352,7 +1291,7 @@ private Mono>> executeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> executeWithResponseAsync( @@ -1408,16 +1347,17 @@ private Mono>> executeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String virtualMachineName, String name) { Mono>> mono = executeWithResponseAsync(resourceGroupName, labName, virtualMachineName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1431,9 +1371,9 @@ private PollerFlux, Void> beginExecuteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExecuteAsync( String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { context = this.client.mergeContext(context); @@ -1454,9 +1394,9 @@ private PollerFlux, Void> beginExecuteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name) { return beginExecuteAsync(resourceGroupName, labName, virtualMachineName, name).getSyncPoller(); @@ -1473,9 +1413,9 @@ public SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExecute( String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { return beginExecuteAsync(resourceGroupName, labName, virtualMachineName, name, context).getSyncPoller(); @@ -1491,7 +1431,7 @@ public SyncPoller, Void> beginExecute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync(String resourceGroupName, String labName, String virtualMachineName, String name) { @@ -1511,7 +1451,7 @@ private Mono executeAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync( @@ -1562,7 +1502,8 @@ public void execute( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1598,7 +1539,8 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java index 0a4edb1a7ef1..1614b1f6b4ed 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachineSchedulesImpl.java @@ -39,15 +39,12 @@ public PagedIterable list( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, Context context) { PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, labName, virtualMachineName, expand, filter, top, orderby, context); + this.serviceClient().list(resourceGroupName, labName, virtualMachineName, filter, top, orderby, context); return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); } @@ -61,14 +58,9 @@ public Schedule get(String resourceGroupName, String labName, String virtualMach } public Response getWithResponse( - String resourceGroupName, - String labName, - String virtualMachineName, - String name, - String expand, - Context context) { + String resourceGroupName, String labName, String virtualMachineName, String name, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labName, virtualMachineName, name, expand, context); + this.serviceClient().getWithResponse(resourceGroupName, labName, virtualMachineName, name, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java index 6b29a2bf4d84..ef98991f4633 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesClientImpl.java @@ -116,7 +116,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/virtualmachines/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -212,6 +212,22 @@ Mono>> claim( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + + "/{labName}/virtualmachines/{name}/clearArtifactResults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> clearArtifactResults( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" @@ -392,13 +408,14 @@ Mono> listNext( * @param labName The name of the lab. * @param expand Specify the $expand query. Example: * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -458,14 +475,15 @@ private Mono> listSinglePageAsync( * @param labName The name of the lab. * @param expand Specify the $expand query. Example: * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -528,13 +546,13 @@ private Mono> listSinglePageAsync( * @param labName The name of the lab. * @param expand Specify the $expand query. Example: * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -552,7 +570,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { @@ -572,14 +590,14 @@ private PagedFlux listAsync(String resourceGroupName, St * @param labName The name of the lab. * @param expand Specify the $expand query. Example: * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -603,7 +621,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { @@ -621,14 +639,14 @@ public PagedIterable list(String resourceGroupName, Stri * @param labName The name of the lab. * @param expand Specify the $expand query. Example: * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -653,7 +671,7 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -710,7 +728,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -763,7 +781,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -788,7 +806,7 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { @@ -833,7 +851,7 @@ public LabVirtualMachineInner get(String resourceGroupName, String labName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -842,7 +860,7 @@ public Response getWithResponse( } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -851,7 +869,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine. + * @return a virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -903,7 +921,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -913,7 +931,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine. + * @return a virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -966,7 +984,7 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -975,9 +993,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine. + * @return the {@link PollerFlux} for polling of a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabVirtualMachineInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { Mono>> mono = @@ -989,11 +1007,11 @@ private PollerFlux, LabVirtualMachineInner> b this.client.getHttpPipeline(), LabVirtualMachineInner.class, LabVirtualMachineInner.class, - Context.NONE); + this.client.getContext()); } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1003,9 +1021,9 @@ private PollerFlux, LabVirtualMachineInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link PollerFlux} for polling of a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LabVirtualMachineInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, @@ -1026,7 +1044,7 @@ private PollerFlux, LabVirtualMachineInner> b } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1035,16 +1053,16 @@ private PollerFlux, LabVirtualMachineInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link SyncPoller} for polling of a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, LabVirtualMachineInner labVirtualMachine) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, labVirtualMachine).getSyncPoller(); } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1054,9 +1072,9 @@ public SyncPoller, LabVirtualMachineInner> be * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the {@link SyncPoller} for polling of a virtual machine. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LabVirtualMachineInner> beginCreateOrUpdate( String resourceGroupName, String labName, @@ -1067,7 +1085,7 @@ public SyncPoller, LabVirtualMachineInner> be } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1076,7 +1094,7 @@ public SyncPoller, LabVirtualMachineInner> be * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -1087,7 +1105,7 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1097,7 +1115,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual machine. + * @return a virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -1112,7 +1130,7 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1130,7 +1148,7 @@ public LabVirtualMachineInner createOrUpdate( } /** - * Create or replace an existing virtual machine. This operation can take a while to complete. + * Create or replace an existing Virtual machine. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -1161,7 +1179,7 @@ public LabVirtualMachineInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1215,7 +1233,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1265,14 +1283,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1285,9 +1304,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1306,9 +1325,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1323,9 +1342,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -1340,7 +1359,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -1357,7 +1376,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { @@ -1403,11 +1422,11 @@ public void delete(String resourceGroupName, String labName, String name, Contex * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param labVirtualMachine Allows modifying tags of virtual machines. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1464,12 +1483,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param labVirtualMachine Allows modifying tags of virtual machines. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a virtual machine along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1527,11 +1546,11 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param labVirtualMachine Allows modifying tags of virtual machines. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1553,7 +1572,7 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param labVirtualMachine Allows modifying tags of virtual machines. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1571,12 +1590,12 @@ public LabVirtualMachineInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual machine. - * @param labVirtualMachine A virtual machine. + * @param labVirtualMachine Allows modifying tags of virtual machines. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1598,7 +1617,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> addDataDiskWithResponseAsync( @@ -1660,7 +1679,7 @@ private Mono>> addDataDiskWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> addDataDiskWithResponseAsync( @@ -1718,16 +1737,17 @@ private Mono>> addDataDiskWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAddDataDiskAsync( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { Mono>> mono = addDataDiskWithResponseAsync(resourceGroupName, labName, name, dataDiskProperties); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1741,9 +1761,9 @@ private PollerFlux, Void> beginAddDataDiskAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginAddDataDiskAsync( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, Context context) { context = this.client.mergeContext(context); @@ -1764,9 +1784,9 @@ private PollerFlux, Void> beginAddDataDiskAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties) { return beginAddDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties).getSyncPoller(); @@ -1783,9 +1803,9 @@ public SyncPoller, Void> beginAddDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginAddDataDisk( String resourceGroupName, String labName, String name, DataDiskProperties dataDiskProperties, Context context) { return beginAddDataDiskAsync(resourceGroupName, labName, name, dataDiskProperties, context).getSyncPoller(); @@ -1801,7 +1821,7 @@ public SyncPoller, Void> beginAddDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono addDataDiskAsync( @@ -1822,7 +1842,7 @@ private Mono addDataDiskAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono addDataDiskAsync( @@ -1877,7 +1897,7 @@ public void addDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> applyArtifactsWithResponseAsync( @@ -1939,7 +1959,7 @@ private Mono>> applyArtifactsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> applyArtifactsWithResponseAsync( @@ -2001,16 +2021,17 @@ private Mono>> applyArtifactsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginApplyArtifactsAsync( String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest) { Mono>> mono = applyArtifactsWithResponseAsync(resourceGroupName, labName, name, applyArtifactsRequest); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2024,9 +2045,9 @@ private PollerFlux, Void> beginApplyArtifactsAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginApplyArtifactsAsync( String resourceGroupName, String labName, @@ -2051,9 +2072,9 @@ private PollerFlux, Void> beginApplyArtifactsAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, String name, ApplyArtifactsRequest applyArtifactsRequest) { return beginApplyArtifactsAsync(resourceGroupName, labName, name, applyArtifactsRequest).getSyncPoller(); @@ -2070,9 +2091,9 @@ public SyncPoller, Void> beginApplyArtifacts( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginApplyArtifacts( String resourceGroupName, String labName, @@ -2093,7 +2114,7 @@ public SyncPoller, Void> beginApplyArtifacts( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono applyArtifactsAsync( @@ -2114,7 +2135,7 @@ private Mono applyArtifactsAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono applyArtifactsAsync( @@ -2176,7 +2197,7 @@ public void applyArtifacts( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> claimWithResponseAsync( @@ -2230,7 +2251,7 @@ private Mono>> claimWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> claimWithResponseAsync( @@ -2280,14 +2301,15 @@ private Mono>> claimWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAsync(String resourceGroupName, String labName, String name) { Mono>> mono = claimWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2300,9 +2322,9 @@ private PollerFlux, Void> beginClaimAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginClaimAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -2321,9 +2343,9 @@ private PollerFlux, Void> beginClaimAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaim(String resourceGroupName, String labName, String name) { return beginClaimAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -2338,9 +2360,9 @@ public SyncPoller, Void> beginClaim(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginClaim( String resourceGroupName, String labName, String name, Context context) { return beginClaimAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -2355,7 +2377,7 @@ public SyncPoller, Void> beginClaim( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono claimAsync(String resourceGroupName, String labName, String name) { @@ -2372,7 +2394,7 @@ private Mono claimAsync(String resourceGroupName, String labName, String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono claimAsync(String resourceGroupName, String labName, String name, Context context) { @@ -2412,6 +2434,160 @@ public void claim(String resourceGroupName, String labName, String name, Context claimAsync(resourceGroupName, labName, name, context).block(); } + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clearArtifactResultsWithResponseAsync( + String resourceGroupName, String labName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearArtifactResults( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clearArtifactResultsWithResponseAsync( + String resourceGroupName, String labName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearArtifactResults( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono clearArtifactResultsAsync(String resourceGroupName, String labName, String name) { + return clearArtifactResultsWithResponseAsync(resourceGroupName, labName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name 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 clearArtifactResults(String resourceGroupName, String labName, String name) { + clearArtifactResultsAsync(resourceGroupName, labName, name).block(); + } + + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response clearArtifactResultsWithResponse( + String resourceGroupName, String labName, String name, Context context) { + return clearArtifactResultsWithResponseAsync(resourceGroupName, labName, name, context).block(); + } + /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * @@ -2422,7 +2598,7 @@ public void claim(String resourceGroupName, String labName, String name, Context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> detachDataDiskWithResponseAsync( @@ -2485,7 +2661,7 @@ private Mono>> detachDataDiskWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> detachDataDiskWithResponseAsync( @@ -2548,16 +2724,17 @@ private Mono>> detachDataDiskWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachDataDiskAsync( String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { Mono>> mono = detachDataDiskWithResponseAsync(resourceGroupName, labName, name, detachDataDiskProperties); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2571,9 +2748,9 @@ private PollerFlux, Void> beginDetachDataDiskAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDetachDataDiskAsync( String resourceGroupName, String labName, @@ -2598,9 +2775,9 @@ private PollerFlux, Void> beginDetachDataDiskAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { return beginDetachDataDiskAsync(resourceGroupName, labName, name, detachDataDiskProperties).getSyncPoller(); @@ -2617,9 +2794,9 @@ public SyncPoller, Void> beginDetachDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDetachDataDisk( String resourceGroupName, String labName, @@ -2640,7 +2817,7 @@ public SyncPoller, Void> beginDetachDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono detachDataDiskAsync( @@ -2661,7 +2838,7 @@ private Mono detachDataDiskAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono detachDataDiskAsync( @@ -2723,7 +2900,8 @@ public void detachDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 string that represents the contents of the RDP file for the virtual machine. + * @return a string that represents the contents of the RDP file for the virtual machine along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getRdpFileContentsWithResponseAsync( @@ -2777,7 +2955,8 @@ private Mono> getRdpFileContentsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 string that represents the contents of the RDP file for the virtual machine. + * @return a string that represents the contents of the RDP file for the virtual machine along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getRdpFileContentsWithResponseAsync( @@ -2827,7 +3006,8 @@ private Mono> getRdpFileContentsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 string that represents the contents of the RDP file for the virtual machine. + * @return a string that represents the contents of the RDP file for the virtual machine on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getRdpFileContentsAsync(String resourceGroupName, String labName, String name) { @@ -2868,7 +3048,8 @@ public RdpConnectionInner getRdpFileContents(String resourceGroupName, String la * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 string that represents the contents of the RDP file for the virtual machine. + * @return a string that represents the contents of the RDP file for the virtual machine along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRdpFileContentsWithResponse( @@ -2885,7 +3066,8 @@ public Response getRdpFileContentsWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSchedulesWithResponseAsync( @@ -2939,7 +3121,8 @@ private Mono> listApplicableSchedulesWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listApplicableSchedulesWithResponseAsync( @@ -2989,7 +3172,7 @@ private Mono> listApplicableSchedulesWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listApplicableSchedulesAsync( @@ -3031,7 +3214,7 @@ public ApplicableScheduleInner listApplicableSchedules(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listApplicableSchedulesWithResponse( @@ -3048,7 +3231,7 @@ public Response listApplicableSchedulesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> redeployWithResponseAsync( @@ -3102,7 +3285,7 @@ private Mono>> redeployWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> redeployWithResponseAsync( @@ -3152,15 +3335,16 @@ private Mono>> redeployWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRedeployAsync( String resourceGroupName, String labName, String name) { Mono>> mono = redeployWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -3173,9 +3357,9 @@ private PollerFlux, Void> beginRedeployAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRedeployAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -3194,9 +3378,9 @@ private PollerFlux, Void> beginRedeployAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRedeploy(String resourceGroupName, String labName, String name) { return beginRedeployAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -3211,9 +3395,9 @@ public SyncPoller, Void> beginRedeploy(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRedeploy( String resourceGroupName, String labName, String name, Context context) { return beginRedeployAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -3228,7 +3412,7 @@ public SyncPoller, Void> beginRedeploy( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono redeployAsync(String resourceGroupName, String labName, String name) { @@ -3247,7 +3431,7 @@ private Mono redeployAsync(String resourceGroupName, String labName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono redeployAsync(String resourceGroupName, String labName, String name, Context context) { @@ -3297,7 +3481,7 @@ public void redeploy(String resourceGroupName, String labName, String name, Cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> resizeWithResponseAsync( @@ -3364,7 +3548,7 @@ private Mono>> resizeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> resizeWithResponseAsync( @@ -3428,9 +3612,9 @@ private Mono>> resizeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResizeAsync( String resourceGroupName, String labName, @@ -3440,7 +3624,8 @@ private PollerFlux, Void> beginResizeAsync( resizeWithResponseAsync(resourceGroupName, labName, name, resizeLabVirtualMachineProperties); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -3454,9 +3639,9 @@ private PollerFlux, Void> beginResizeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginResizeAsync( String resourceGroupName, String labName, @@ -3481,9 +3666,9 @@ private PollerFlux, Void> beginResizeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -3503,9 +3688,9 @@ public SyncPoller, Void> beginResize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginResize( String resourceGroupName, String labName, @@ -3526,7 +3711,7 @@ public SyncPoller, Void> beginResize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono resizeAsync( @@ -3550,7 +3735,7 @@ private Mono resizeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono resizeAsync( @@ -3615,7 +3800,7 @@ public void resize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync( @@ -3669,7 +3854,7 @@ private 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync( @@ -3719,15 +3904,16 @@ private 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRestartAsync( String resourceGroupName, String labName, String name) { Mono>> mono = restartWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -3740,9 +3926,9 @@ private PollerFlux, Void> beginRestartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRestartAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -3761,9 +3947,9 @@ private PollerFlux, Void> beginRestartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart(String resourceGroupName, String labName, String name) { return beginRestartAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -3778,9 +3964,9 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart( String resourceGroupName, String labName, String name, Context context) { return beginRestartAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -3795,7 +3981,7 @@ public SyncPoller, Void> beginRestart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono restartAsync(String resourceGroupName, String labName, String name) { @@ -3814,7 +4000,7 @@ private Mono restartAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono restartAsync(String resourceGroupName, String labName, String name, Context context) { @@ -3863,7 +4049,7 @@ public void restart(String resourceGroupName, String labName, String name, Conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync( @@ -3917,7 +4103,7 @@ private Mono>> startWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync( @@ -3967,14 +4153,15 @@ private Mono>> startWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync(String resourceGroupName, String labName, String name) { Mono>> mono = startWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -3987,9 +4174,9 @@ private PollerFlux, Void> beginStartAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4008,9 +4195,9 @@ private PollerFlux, Void> beginStartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart(String resourceGroupName, String labName, String name) { return beginStartAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -4025,9 +4212,9 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart( String resourceGroupName, String labName, String name, Context context) { return beginStartAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -4042,7 +4229,7 @@ public SyncPoller, Void> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String resourceGroupName, String labName, String name) { @@ -4059,7 +4246,7 @@ private Mono startAsync(String resourceGroupName, String labName, String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String resourceGroupName, String labName, String name, Context context) { @@ -4108,7 +4295,7 @@ public void start(String resourceGroupName, String labName, String name, Context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync( @@ -4162,7 +4349,7 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync( @@ -4212,14 +4399,15 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync(String resourceGroupName, String labName, String name) { Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -4232,9 +4420,9 @@ private PollerFlux, Void> beginStopAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4253,9 +4441,9 @@ private PollerFlux, Void> beginStopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop(String resourceGroupName, String labName, String name) { return beginStopAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -4270,9 +4458,9 @@ public SyncPoller, Void> beginStop(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop( String resourceGroupName, String labName, String name, Context context) { return beginStopAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -4287,7 +4475,7 @@ public SyncPoller, Void> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String resourceGroupName, String labName, String name) { @@ -4304,7 +4492,7 @@ private Mono stopAsync(String resourceGroupName, String labName, String na * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String resourceGroupName, String labName, String name, Context context) { @@ -4354,7 +4542,7 @@ public void stop(String resourceGroupName, String labName, String name, Context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> transferDisksWithResponseAsync( @@ -4409,7 +4597,7 @@ private Mono>> transferDisksWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> transferDisksWithResponseAsync( @@ -4460,15 +4648,16 @@ private Mono>> transferDisksWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTransferDisksAsync( String resourceGroupName, String labName, String name) { Mono>> mono = transferDisksWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -4482,9 +4671,9 @@ private PollerFlux, Void> beginTransferDisksAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTransferDisksAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4505,9 +4694,9 @@ private PollerFlux, Void> beginTransferDisksAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTransferDisks( String resourceGroupName, String labName, String name) { return beginTransferDisksAsync(resourceGroupName, labName, name).getSyncPoller(); @@ -4524,9 +4713,9 @@ public SyncPoller, Void> beginTransferDisks( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTransferDisks( String resourceGroupName, String labName, String name, Context context) { return beginTransferDisksAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -4542,7 +4731,7 @@ public SyncPoller, Void> beginTransferDisks( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono transferDisksAsync(String resourceGroupName, String labName, String name) { @@ -4562,7 +4751,7 @@ private Mono transferDisksAsync(String resourceGroupName, String labName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono transferDisksAsync(String resourceGroupName, String labName, String name, Context context) { @@ -4613,7 +4802,7 @@ public void transferDisks(String resourceGroupName, String labName, String name, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> unClaimWithResponseAsync( @@ -4667,7 +4856,7 @@ private Mono>> unClaimWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> unClaimWithResponseAsync( @@ -4717,15 +4906,16 @@ private Mono>> unClaimWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUnClaimAsync( String resourceGroupName, String labName, String name) { Mono>> mono = unClaimWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -4738,9 +4928,9 @@ private PollerFlux, Void> beginUnClaimAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginUnClaimAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -4759,9 +4949,9 @@ private PollerFlux, Void> beginUnClaimAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUnClaim(String resourceGroupName, String labName, String name) { return beginUnClaimAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -4776,9 +4966,9 @@ public SyncPoller, Void> beginUnClaim(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginUnClaim( String resourceGroupName, String labName, String name, Context context) { return beginUnClaimAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -4793,7 +4983,7 @@ public SyncPoller, Void> beginUnClaim( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono unClaimAsync(String resourceGroupName, String labName, String name) { @@ -4812,7 +5002,7 @@ private Mono unClaimAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono unClaimAsync(String resourceGroupName, String labName, String name, Context context) { @@ -4859,7 +5049,8 @@ public void unClaim(String resourceGroupName, String labName, String name, Conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -4895,7 +5086,8 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java index b44d78c408f1..ae4275bf6147 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualMachinesImpl.java @@ -118,6 +118,15 @@ public void claim(String resourceGroupName, String labName, String name, Context this.serviceClient().claim(resourceGroupName, labName, name, context); } + public void clearArtifactResults(String resourceGroupName, String labName, String name) { + this.serviceClient().clearArtifactResults(resourceGroupName, labName, name); + } + + public Response clearArtifactResultsWithResponse( + String resourceGroupName, String labName, String name, Context context) { + return this.serviceClient().clearArtifactResultsWithResponse(resourceGroupName, labName, name, context); + } + public void detachDataDisk( String resourceGroupName, String labName, String name, DetachDataDiskProperties detachDataDiskProperties) { this.serviceClient().detachDataDisk(resourceGroupName, labName, name, detachDataDiskProperties); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java index 2bb6b8da1d76..ad9303bc2d02 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworkImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkInner; import com.azure.resourcemanager.devtestlabs.models.ExternalSubnet; @@ -47,6 +48,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public List allowedSubnets() { List inner = this.innerModel().allowedSubnets(); if (inner != null) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java index 00c64127a8d9..c20cdd86c4db 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/VirtualNetworksClientImpl.java @@ -109,7 +109,7 @@ Mono> get( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs" + "/{labName}/virtualnetworks/{name}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -172,13 +172,14 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -237,14 +238,15 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -306,13 +308,13 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -330,7 +332,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String labName) { @@ -349,14 +351,14 @@ private PagedFlux listAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -380,7 +382,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String labName) { @@ -397,14 +399,14 @@ public PagedIterable list(String resourceGroupName, String * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -428,7 +430,7 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -484,7 +486,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -536,7 +538,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name, String expand) { @@ -560,7 +562,7 @@ private Mono getAsync(String resourceGroupName, String labN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String labName, String name) { @@ -604,7 +606,7 @@ public VirtualNetworkInner get(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -622,7 +624,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network. + * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -683,7 +685,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network. + * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -740,9 +742,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network. + * @return the {@link PollerFlux} for polling of a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { Mono>> mono = @@ -754,7 +756,7 @@ private PollerFlux, VirtualNetworkInner> beginCr this.client.getHttpPipeline(), VirtualNetworkInner.class, VirtualNetworkInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -768,9 +770,9 @@ private PollerFlux, VirtualNetworkInner> beginCr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return the {@link PollerFlux} for polling of a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context) { context = this.client.mergeContext(context); @@ -792,9 +794,9 @@ private PollerFlux, VirtualNetworkInner> beginCr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return the {@link SyncPoller} for polling of a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork).getSyncPoller(); @@ -811,9 +813,9 @@ public SyncPoller, VirtualNetworkInner> beginCre * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return the {@link SyncPoller} for polling of a virtual network. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( String resourceGroupName, String labName, String name, VirtualNetworkInner virtualNetwork, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, labName, name, virtualNetwork, context).getSyncPoller(); @@ -829,7 +831,7 @@ public SyncPoller, VirtualNetworkInner> beginCre * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return a virtual network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -850,7 +852,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a virtual network. + * @return a virtual network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -906,7 +908,7 @@ public VirtualNetworkInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -960,7 +962,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1010,14 +1012,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, name); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1030,9 +1033,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String labName, String name, Context context) { context = this.client.mergeContext(context); @@ -1051,9 +1054,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String name) { return beginDeleteAsync(resourceGroupName, labName, name).getSyncPoller(); } @@ -1068,9 +1071,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String labName, String name, Context context) { return beginDeleteAsync(resourceGroupName, labName, name, context).getSyncPoller(); @@ -1085,7 +1088,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name) { @@ -1102,7 +1105,7 @@ private Mono deleteAsync(String resourceGroupName, String labName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String labName, String name, Context context) { @@ -1148,11 +1151,11 @@ public void delete(String resourceGroupName, String labName, String name, Contex * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param virtualNetwork Allows modifying tags of virtual networks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1208,12 +1211,12 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param virtualNetwork Allows modifying tags of virtual networks. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return a virtual network along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1266,11 +1269,11 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param virtualNetwork Allows modifying tags of virtual networks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return a virtual network on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1292,7 +1295,7 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param virtualNetwork Allows modifying tags of virtual networks. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1310,12 +1313,12 @@ public VirtualNetworkInner update( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the virtual network. - * @param virtualNetwork A virtual network. + * @param virtualNetwork Allows modifying tags of virtual networks. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 network. + * @return a virtual network along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1330,7 +1333,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1366,7 +1370,8 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java index 33c94354dc47..8cd363b9d1c5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableSchedule.java @@ -4,60 +4,178 @@ package com.azure.resourcemanager.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of ApplicableSchedule. */ public interface ApplicableSchedule { /** - * Gets the id property: Fully qualified resource Id for the resource. + * Gets the tags property: Resource tags. * - * @return the id value. + * @return the tags value. */ - String id(); + Map tags(); /** - * Gets the name property: The name of the resource. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the name value. + * @return the systemData value. */ - String name(); + SystemData systemData(); /** - * Gets the type property: The type of the resource. + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. * - * @return the type value. + * @return the systemDataPropertiesSystemData value. */ - String type(); + SystemData systemDataPropertiesSystemData(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). * - * @return the location value. + * @return the status value. */ - String location(); + EnableStatus status(); /** - * Gets the tags property: Resource tags. + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). * - * @return the tags value. + * @return the taskType value. */ - Map tags(); + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); /** - * Gets the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource - * level. + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. * - * @return the labVmsShutdown value. + * @return the webhookUrl value. */ - Schedule labVmsShutdown(); + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: the geo-location where the resource live. + * + * @return the location value. + */ + String location(); /** - * Gets the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level. + * Gets the tagsPropertiesTags property: the tags of the resource. * - * @return the labVmsStartup value. + * @return the tagsPropertiesTags value. */ - Schedule labVmsStartup(); + Map tagsPropertiesTags(); /** * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableScheduleInner object. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java new file mode 100644 index 000000000000..ecfb87f0813d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleProperties.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableSchedulePropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplicableScheduleProperties. */ +public interface ApplicableScheduleProperties { + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: the geo-location where the resource live. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: the tags of the resource. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: the geo-location where the resource live. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: the tags of the resource. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.ApplicableSchedulePropertiesInner object. + * + * @return the inner object. + */ + ApplicableSchedulePropertiesInner innerModel(); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java index 557a56165373..6dda5b632633 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplate.java @@ -4,10 +4,10 @@ package com.azure.resourcemanager.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArmTemplateInner; import java.time.OffsetDateTime; import java.util.List; -import java.util.Map; /** An immutable client-side representation of ArmTemplate. */ public interface ArmTemplate { @@ -33,18 +33,11 @@ public interface ArmTemplate { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the location value. + * @return the systemData value. */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); + SystemData systemData(); /** * Gets the displayName property: The display name of the ARM template. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateList.java index 67a29f431656..c7b7505b1159 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplateList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of armTemplates and their properties. */ @Fluent public final class ArmTemplateList { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmTemplateList.class); /* - * Results of the list operation. + * List of armTemplates and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of armTemplates and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ArmTemplateList object itself. - */ - public ArmTemplateList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the ArmTemplateList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java index 402da0da244c..b44703a04188 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArmTemplates.java @@ -19,7 +19,7 @@ public interface ArmTemplates { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); @@ -29,21 +29,19 @@ public interface ArmTemplates { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of armTemplates and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, @@ -70,18 +68,12 @@ PagedIterable list( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the azure resource manager template. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure resource manager template. + * @return azure resource manager template along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context); + String resourceGroupName, String labName, String artifactSourceName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java index bdeab04a858c..be35f44eb0a8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifact.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactInner; import java.time.OffsetDateTime; -import java.util.Map; /** An immutable client-side representation of Artifact. */ public interface Artifact { @@ -32,18 +32,11 @@ public interface Artifact { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the location value. + * @return the systemData value. */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); + SystemData systemData(); /** * Gets the title property: The artifact's title. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactList.java index 8ff2c763013e..04f6c609409b 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of artifacts and their properties. */ @Fluent public final class ArtifactList { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactList.class); /* - * Results of the list operation. + * List of artifacts and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of artifacts and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ArtifactList object itself. - */ - public ArtifactList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the ArtifactList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java index d77896670881..dfc286aca097 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSource.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ArtifactSourceInner; import java.time.OffsetDateTime; @@ -47,6 +48,13 @@ public interface ArtifactSource { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the displayName property: The artifact source's display name. * @@ -335,9 +343,9 @@ interface UpdateStages { /** The stage of the ArtifactSource update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java index 3f85e8bbbb64..4c5decbf3641 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** Properties of an artifact source. */ -@Immutable -public final class ArtifactSourceFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class ArtifactSourceFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceList.java index f804d23214fd..d9d7fb65215e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSourceList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of artifactSources and their properties. */ @Fluent public final class ArtifactSourceList { @JsonIgnore private final ClientLogger logger = new ClientLogger(ArtifactSourceList.class); /* - * Results of the list operation. + * List of artifactSources and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of artifactSources and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ArtifactSourceList object itself. - */ - public ArtifactSourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the ArtifactSourceList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java index bce949b8b16c..e9364212da50 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ArtifactSources.java @@ -18,7 +18,7 @@ public interface ArtifactSources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -27,24 +27,17 @@ public interface ArtifactSources { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifactSources and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get artifact source. @@ -65,15 +58,13 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Delete artifact source. @@ -97,7 +88,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -108,7 +99,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source along with {@link Response}. */ ArtifactSource getById(String id); @@ -116,14 +107,13 @@ Response getWithResponse( * Get artifact source. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=displayName)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact source. + * @return artifact source along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete artifact source. @@ -143,7 +133,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java index ab048bf73dbe..b8a6e3350e5e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Artifacts.java @@ -19,7 +19,7 @@ public interface Artifacts { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String artifactSourceName); @@ -29,21 +29,19 @@ public interface Artifacts { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of artifacts and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String artifactSourceName, - String expand, String filter, Integer top, String orderby, @@ -70,20 +68,14 @@ PagedIterable list( * @param labName The name of the lab. * @param artifactSourceName The name of the artifact source. * @param name The name of the artifact. - * @param expand Specify the $expand query. Example: 'properties($select=title)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return artifact. + * @return artifact along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, - String labName, - String artifactSourceName, - String name, - String expand, - Context context); + String resourceGroupName, String labName, String artifactSourceName, String name, Context context); /** * Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates @@ -119,7 +111,7 @@ ArmTemplateInfo generateArmTemplate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 generated ARM template. + * @return information about a generated ARM template along with {@link Response}. */ Response generateArmTemplateWithResponse( String resourceGroupName, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHost.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHost.java new file mode 100644 index 000000000000..e0684f742b89 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHost.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.BastionHostInner; +import java.util.Map; + +/** An immutable client-side representation of BastionHost. */ +public interface BastionHost { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the externalBastionHostId property: The ID of the external BastionHost resource that corresponds to this DTL + * BastionHost. + * + * @return the externalBastionHostId value. + */ + String externalBastionHostId(); + + /** + * Gets the ipAddressId property: The ID of the PublicIpAddress resource that is created by and paired with this + * BastionHost. + * + * @return the ipAddressId value. + */ + String ipAddressId(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.BastionHostInner object. + * + * @return the inner object. + */ + BastionHostInner innerModel(); + + /** The entirety of the BastionHost definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The BastionHost definition stages. */ + interface DefinitionStages { + /** The first stage of the BastionHost definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BastionHost definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the BastionHost definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, labName, virtualNetworkName. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @return the next definition stage. + */ + WithCreate withExistingVirtualnetwork(String resourceGroupName, String labName, String virtualNetworkName); + } + /** + * The stage of the BastionHost definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + BastionHost create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BastionHost create(Context context); + } + /** The stage of the BastionHost definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the BastionHost resource. + * + * @return the stage of resource update. + */ + BastionHost.Update update(); + + /** The template for BastionHost update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BastionHost apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BastionHost apply(Context context); + } + /** The BastionHost update stages. */ + interface UpdateStages { + /** The stage of the BastionHost update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BastionHost refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BastionHost refresh(Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHostFragment.java similarity index 66% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleFragment.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHostFragment.java index 8d58391939e9..5e34f760e696 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ApplicableScheduleFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHostFragment.java @@ -4,19 +4,19 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level. */ -@Immutable -public final class ApplicableScheduleFragment extends UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicableScheduleFragment.class); +/** Patch. */ +@Fluent +public final class BastionHostFragment extends Tags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostFragment.class); /** {@inheritDoc} */ @Override - public ApplicableScheduleFragment withTags(Map tags) { + public BastionHostFragment withTags(Map tags) { super.withTags(tags); return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHostList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHostList.java new file mode 100644 index 000000000000..ba5cb99ea017 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHostList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.BastionHostInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains a list of bastionHosts and their properties. */ +@Fluent +public final class BastionHostList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostList.class); + + /* + * List of bastionHosts and their properties + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of bastionHosts and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the BastionHostList object itself. + */ + public BastionHostList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHosts.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHosts.java new file mode 100644 index 000000000000..0ec71cc33d58 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/BastionHosts.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BastionHosts. */ +public interface BastionHosts { + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String virtualNetworkName); + + /** + * List bastionhosts in a given virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of bastionHosts and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String labName, + String virtualNetworkName, + String filter, + Integer top, + String orderby, + Context context); + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost. + */ + BastionHost get(String resourceGroupName, String labName, String virtualNetworkName, String name); + + /** + * Get bastionhost. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String labName, String virtualNetworkName, String name, Context context); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String labName, String virtualNetworkName, String name); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param virtualNetworkName The name of the virtual network. + * @param name The name of the bastionhost. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String labName, String virtualNetworkName, String name, Context context); + + /** + * Get bastionhost. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost along with {@link Response}. + */ + BastionHost getById(String id); + + /** + * Get bastionhost. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastionhost along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete bastionhost. This operation can take a while to complete. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BastionHost resource. + * + * @param name resource name. + * @return the first stage of the new BastionHost definition. + */ + BastionHost.DefinitionStages.Blank define(String name); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java index 05a8fdc9adbc..18d085ebe1a7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CostThresholdProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.PercentageCostThresholdProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -24,7 +25,7 @@ public final class CostThresholdProperties { * The value of the percentage cost threshold. */ @JsonProperty(value = "percentageThreshold") - private PercentageCostThresholdProperties percentageThreshold; + private PercentageCostThresholdProperties innerPercentageThreshold; /* * Indicates whether this threshold will be displayed on cost charts. @@ -67,23 +68,12 @@ public CostThresholdProperties withThresholdId(String thresholdId) { } /** - * Get the percentageThreshold property: The value of the percentage cost threshold. + * Get the innerPercentageThreshold property: The value of the percentage cost threshold. * - * @return the percentageThreshold value. + * @return the innerPercentageThreshold value. */ - public PercentageCostThresholdProperties percentageThreshold() { - return this.percentageThreshold; - } - - /** - * Set the percentageThreshold property: The value of the percentage cost threshold. - * - * @param percentageThreshold the percentageThreshold value to set. - * @return the CostThresholdProperties object itself. - */ - public CostThresholdProperties withPercentageThreshold(PercentageCostThresholdProperties percentageThreshold) { - this.percentageThreshold = percentageThreshold; - return this; + private PercentageCostThresholdProperties innerPercentageThreshold() { + return this.innerPercentageThreshold; } /** @@ -148,14 +138,37 @@ public CostThresholdProperties withNotificationSent(String notificationSent) { return this; } + /** + * Get the thresholdValue property: The cost threshold value. + * + * @return the thresholdValue value. + */ + public Double thresholdValue() { + return this.innerPercentageThreshold() == null ? null : this.innerPercentageThreshold().thresholdValue(); + } + + /** + * Set the thresholdValue property: The cost threshold value. + * + * @param thresholdValue the thresholdValue value to set. + * @return the CostThresholdProperties object itself. + */ + public CostThresholdProperties withThresholdValue(Double thresholdValue) { + if (this.innerPercentageThreshold() == null) { + this.innerPercentageThreshold = new PercentageCostThresholdProperties(); + } + this.innerPercentageThreshold().withThresholdValue(thresholdValue); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (percentageThreshold() != null) { - percentageThreshold().validate(); + if (innerPercentageThreshold() != null) { + innerPercentageThreshold().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java index 1f341bab73ac..5595e8a258a7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Costs.java @@ -4,11 +4,48 @@ package com.azure.resourcemanager.devtestlabs.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; /** Resource collection API of Costs. */ public interface Costs { + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List costs in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param expand Specify the $expand query. Example: 'properties($expand=labCostDetails)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of costs and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String labName, + String expand, + String filter, + Integer top, + String orderby, + Context context); + /** * Get cost. * @@ -33,7 +70,7 @@ public interface Costs { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String labName, String name, String expand, Context context); @@ -45,7 +82,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost along with {@link Response}. */ LabCost getById(String id); @@ -58,7 +95,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cost. + * @return cost along with {@link Response}. */ Response getByIdWithResponse(String id, String expand, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java index 8f0f7c9e469a..21aa7324606c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImage.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.CustomImageInner; import java.time.OffsetDateTime; @@ -49,18 +50,11 @@ public interface CustomImage { Map tags(); /** - * Gets the vm property: The virtual machine from which the image is to be created. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the vm value. + * @return the systemData value. */ - CustomImagePropertiesFromVm vm(); - - /** - * Gets the vhd property: The VHD from which the image is to be created. - * - * @return the vhd value. - */ - CustomImagePropertiesCustom vhd(); + SystemData systemData(); /** * Gets the description property: The description of the custom image. @@ -104,13 +98,6 @@ public interface CustomImage { */ List dataDiskStorageInfo(); - /** - * Gets the customImagePlan property: Storage information about the plan related to this custom image. - * - * @return the customImagePlan value. - */ - CustomImagePropertiesFromPlan customImagePlan(); - /** * Gets the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for * programmatic deployment. @@ -133,6 +120,72 @@ public interface CustomImage { */ String uniqueIdentifier(); + /** + * Gets the sourceVmId property: The source vm identifier. + * + * @return the sourceVmId value. + */ + String sourceVmId(); + + /** + * Gets the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied). + * + * @return the windowsOsState value. + */ + WindowsOsState windowsOsState(); + + /** + * Gets the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). + * + * @return the linuxOsState value. + */ + LinuxOsState linuxOsState(); + + /** + * Gets the imageName property: The image name. + * + * @return the imageName value. + */ + String imageName(); + + /** + * Gets the sysPrep property: Indicates whether sysprep has been run on the VHD. + * + * @return the sysPrep value. + */ + Boolean sysPrep(); + + /** + * Gets the osType property: The OS type of the custom image (i.e. Windows, Linux). + * + * @return the osType value. + */ + CustomImageOsType osType(); + + /** + * Gets the idPropertiesId property: The id of the plan, equivalent to name of the plan. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the publisher property: The publisher for the plan from the marketplace image the custom image is derived + * from. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the offer property: The offer for the plan from the marketplace image the custom image is derived from. + * + * @return the offer value. + */ + String offer(); + /** * Gets the region of the resource. * @@ -201,15 +254,21 @@ interface WithParentResource { */ interface WithCreate extends DefinitionStages.WithTags, - DefinitionStages.WithVm, - DefinitionStages.WithVhd, DefinitionStages.WithDescription, DefinitionStages.WithAuthor, DefinitionStages.WithManagedImageId, DefinitionStages.WithManagedSnapshotId, DefinitionStages.WithDataDiskStorageInfo, - DefinitionStages.WithCustomImagePlan, - DefinitionStages.WithIsPlanAuthorized { + DefinitionStages.WithIsPlanAuthorized, + DefinitionStages.WithSourceVmId, + DefinitionStages.WithWindowsOsState, + DefinitionStages.WithLinuxOsState, + DefinitionStages.WithImageName, + DefinitionStages.WithSysPrep, + DefinitionStages.WithOsType, + DefinitionStages.WithIdPropertiesId, + DefinitionStages.WithPublisher, + DefinitionStages.WithOffer { /** * Executes the create request. * @@ -235,26 +294,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the CustomImage definition allowing to specify vm. */ - interface WithVm { - /** - * Specifies the vm property: The virtual machine from which the image is to be created.. - * - * @param vm The virtual machine from which the image is to be created. - * @return the next definition stage. - */ - WithCreate withVm(CustomImagePropertiesFromVm vm); - } - /** The stage of the CustomImage definition allowing to specify vhd. */ - interface WithVhd { - /** - * Specifies the vhd property: The VHD from which the image is to be created.. - * - * @param vhd The VHD from which the image is to be created. - * @return the next definition stage. - */ - WithCreate withVhd(CustomImagePropertiesCustom vhd); - } /** The stage of the CustomImage definition allowing to specify description. */ interface WithDescription { /** @@ -306,16 +345,6 @@ interface WithDataDiskStorageInfo { */ WithCreate withDataDiskStorageInfo(List dataDiskStorageInfo); } - /** The stage of the CustomImage definition allowing to specify customImagePlan. */ - interface WithCustomImagePlan { - /** - * Specifies the customImagePlan property: Storage information about the plan related to this custom image. - * - * @param customImagePlan Storage information about the plan related to this custom image. - * @return the next definition stage. - */ - WithCreate withCustomImagePlan(CustomImagePropertiesFromPlan customImagePlan); - } /** The stage of the CustomImage definition allowing to specify isPlanAuthorized. */ interface WithIsPlanAuthorized { /** @@ -328,6 +357,101 @@ interface WithIsPlanAuthorized { */ WithCreate withIsPlanAuthorized(Boolean isPlanAuthorized); } + /** The stage of the CustomImage definition allowing to specify sourceVmId. */ + interface WithSourceVmId { + /** + * Specifies the sourceVmId property: The source vm identifier.. + * + * @param sourceVmId The source vm identifier. + * @return the next definition stage. + */ + WithCreate withSourceVmId(String sourceVmId); + } + /** The stage of the CustomImage definition allowing to specify windowsOsState. */ + interface WithWindowsOsState { + /** + * Specifies the windowsOsState property: The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, + * SysprepApplied).. + * + * @param windowsOsState The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied). + * @return the next definition stage. + */ + WithCreate withWindowsOsState(WindowsOsState windowsOsState); + } + /** The stage of the CustomImage definition allowing to specify linuxOsState. */ + interface WithLinuxOsState { + /** + * Specifies the linuxOsState property: The state of the Linux OS (i.e. NonDeprovisioned, + * DeprovisionRequested, DeprovisionApplied).. + * + * @param linuxOsState The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, + * DeprovisionApplied). + * @return the next definition stage. + */ + WithCreate withLinuxOsState(LinuxOsState linuxOsState); + } + /** The stage of the CustomImage definition allowing to specify imageName. */ + interface WithImageName { + /** + * Specifies the imageName property: The image name.. + * + * @param imageName The image name. + * @return the next definition stage. + */ + WithCreate withImageName(String imageName); + } + /** The stage of the CustomImage definition allowing to specify sysPrep. */ + interface WithSysPrep { + /** + * Specifies the sysPrep property: Indicates whether sysprep has been run on the VHD.. + * + * @param sysPrep Indicates whether sysprep has been run on the VHD. + * @return the next definition stage. + */ + WithCreate withSysPrep(Boolean sysPrep); + } + /** The stage of the CustomImage definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: The OS type of the custom image (i.e. Windows, Linux). + * + * @param osType The OS type of the custom image (i.e. Windows, Linux). + * @return the next definition stage. + */ + WithCreate withOsType(CustomImageOsType osType); + } + /** The stage of the CustomImage definition allowing to specify idPropertiesId. */ + interface WithIdPropertiesId { + /** + * Specifies the idPropertiesId property: The id of the plan, equivalent to name of the plan. + * + * @param idPropertiesId The id of the plan, equivalent to name of the plan. + * @return the next definition stage. + */ + WithCreate withIdPropertiesId(String idPropertiesId); + } + /** The stage of the CustomImage definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The publisher for the plan from the marketplace image the custom image + * is derived from. + * + * @param publisher The publisher for the plan from the marketplace image the custom image is derived from. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the CustomImage definition allowing to specify offer. */ + interface WithOffer { + /** + * Specifies the offer property: The offer for the plan from the marketplace image the custom image is + * derived from. + * + * @param offer The offer for the plan from the marketplace image the custom image is derived from. + * @return the next definition stage. + */ + WithCreate withOffer(String offer); + } } /** * Begins update for the CustomImage resource. @@ -358,9 +482,9 @@ interface UpdateStages { /** The stage of the CustomImage update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java index d4cf59c9c3ee..d057ca81baeb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A custom image. */ -@Immutable -public final class CustomImageFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class CustomImageFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageList.java index b8dc4ec94f93..fa19f41e6fc1 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImageList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of customImages and their properties. */ @Fluent public final class CustomImageList { @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageList.class); /* - * Results of the list operation. + * List of customImages and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of customImages and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the CustomImageList object itself. - */ - public CustomImageList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the CustomImageList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java deleted file mode 100644 index 8817df65562b..000000000000 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImagePropertiesFromVm.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.devtestlabs.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties for creating a custom image from a virtual machine. */ -@Fluent -public final class CustomImagePropertiesFromVm { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImagePropertiesFromVm.class); - - /* - * The source vm identifier. - */ - @JsonProperty(value = "sourceVmId") - private String sourceVmId; - - /* - * The Windows OS information of the VM. - */ - @JsonProperty(value = "windowsOsInfo") - private WindowsOsInfo windowsOsInfo; - - /* - * The Linux OS information of the VM. - */ - @JsonProperty(value = "linuxOsInfo") - private LinuxOsInfo linuxOsInfo; - - /** - * Get the sourceVmId property: The source vm identifier. - * - * @return the sourceVmId value. - */ - public String sourceVmId() { - return this.sourceVmId; - } - - /** - * Set the sourceVmId property: The source vm identifier. - * - * @param sourceVmId the sourceVmId value to set. - * @return the CustomImagePropertiesFromVm object itself. - */ - public CustomImagePropertiesFromVm withSourceVmId(String sourceVmId) { - this.sourceVmId = sourceVmId; - return this; - } - - /** - * Get the windowsOsInfo property: The Windows OS information of the VM. - * - * @return the windowsOsInfo value. - */ - public WindowsOsInfo windowsOsInfo() { - return this.windowsOsInfo; - } - - /** - * Set the windowsOsInfo property: The Windows OS information of the VM. - * - * @param windowsOsInfo the windowsOsInfo value to set. - * @return the CustomImagePropertiesFromVm object itself. - */ - public CustomImagePropertiesFromVm withWindowsOsInfo(WindowsOsInfo windowsOsInfo) { - this.windowsOsInfo = windowsOsInfo; - return this; - } - - /** - * Get the linuxOsInfo property: The Linux OS information of the VM. - * - * @return the linuxOsInfo value. - */ - public LinuxOsInfo linuxOsInfo() { - return this.linuxOsInfo; - } - - /** - * Set the linuxOsInfo property: The Linux OS information of the VM. - * - * @param linuxOsInfo the linuxOsInfo value to set. - * @return the CustomImagePropertiesFromVm object itself. - */ - public CustomImagePropertiesFromVm withLinuxOsInfo(LinuxOsInfo linuxOsInfo) { - this.linuxOsInfo = linuxOsInfo; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (windowsOsInfo() != null) { - windowsOsInfo().validate(); - } - if (linuxOsInfo() != null) { - linuxOsInfo().validate(); - } - } -} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java index 8b395310c03c..f95605a29499 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/CustomImages.java @@ -18,7 +18,7 @@ public interface CustomImages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -27,24 +27,17 @@ public interface CustomImages { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of customImages and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get custom image. @@ -65,15 +58,13 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the custom image. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. + * @return custom image along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Delete custom image. This operation can take a while to complete. @@ -107,7 +98,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. + * @return custom image along with {@link Response}. */ CustomImage getById(String id); @@ -115,14 +106,13 @@ Response getWithResponse( * Get custom image. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=vm)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom image. + * @return custom image along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete custom image. This operation can take a while to complete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java index ff5a950e946e..85e10798d52c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DataDiskProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.AttachNewDataDiskOptions; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,7 +19,7 @@ public final class DataDiskProperties { * Specifies options to attach a new disk to the virtual machine. */ @JsonProperty(value = "attachNewDataDiskOptions") - private AttachNewDataDiskOptions attachNewDataDiskOptions; + private AttachNewDataDiskOptions innerAttachNewDataDiskOptions; /* * Specifies the existing lab disk id to attach to virtual machine. @@ -33,23 +34,12 @@ public final class DataDiskProperties { private HostCachingOptions hostCaching; /** - * Get the attachNewDataDiskOptions property: Specifies options to attach a new disk to the virtual machine. + * Get the innerAttachNewDataDiskOptions property: Specifies options to attach a new disk to the virtual machine. * - * @return the attachNewDataDiskOptions value. + * @return the innerAttachNewDataDiskOptions value. */ - public AttachNewDataDiskOptions attachNewDataDiskOptions() { - return this.attachNewDataDiskOptions; - } - - /** - * Set the attachNewDataDiskOptions property: Specifies options to attach a new disk to the virtual machine. - * - * @param attachNewDataDiskOptions the attachNewDataDiskOptions value to set. - * @return the DataDiskProperties object itself. - */ - public DataDiskProperties withAttachNewDataDiskOptions(AttachNewDataDiskOptions attachNewDataDiskOptions) { - this.attachNewDataDiskOptions = attachNewDataDiskOptions; - return this; + private AttachNewDataDiskOptions innerAttachNewDataDiskOptions() { + return this.innerAttachNewDataDiskOptions; } /** @@ -92,14 +82,83 @@ public DataDiskProperties withHostCaching(HostCachingOptions hostCaching) { return this; } + /** + * Get the diskSizeGiB property: Size of the disk to be attached in Gibibytes. + * + * @return the diskSizeGiB value. + */ + public Integer diskSizeGiB() { + return this.innerAttachNewDataDiskOptions() == null ? null : this.innerAttachNewDataDiskOptions().diskSizeGiB(); + } + + /** + * Set the diskSizeGiB property: Size of the disk to be attached in Gibibytes. + * + * @param diskSizeGiB the diskSizeGiB value to set. + * @return the DataDiskProperties object itself. + */ + public DataDiskProperties withDiskSizeGiB(Integer diskSizeGiB) { + if (this.innerAttachNewDataDiskOptions() == null) { + this.innerAttachNewDataDiskOptions = new AttachNewDataDiskOptions(); + } + this.innerAttachNewDataDiskOptions().withDiskSizeGiB(diskSizeGiB); + return this; + } + + /** + * Get the diskName property: The name of the disk to be attached. + * + * @return the diskName value. + */ + public String diskName() { + return this.innerAttachNewDataDiskOptions() == null ? null : this.innerAttachNewDataDiskOptions().diskName(); + } + + /** + * Set the diskName property: The name of the disk to be attached. + * + * @param diskName the diskName value to set. + * @return the DataDiskProperties object itself. + */ + public DataDiskProperties withDiskName(String diskName) { + if (this.innerAttachNewDataDiskOptions() == null) { + this.innerAttachNewDataDiskOptions = new AttachNewDataDiskOptions(); + } + this.innerAttachNewDataDiskOptions().withDiskName(diskName); + return this; + } + + /** + * Get the diskType property: The storage type for the disk (i.e. Standard, Premium). + * + * @return the diskType value. + */ + public StorageType diskType() { + return this.innerAttachNewDataDiskOptions() == null ? null : this.innerAttachNewDataDiskOptions().diskType(); + } + + /** + * Set the diskType property: The storage type for the disk (i.e. Standard, Premium). + * + * @param diskType the diskType value to set. + * @return the DataDiskProperties object itself. + */ + public DataDiskProperties withDiskType(StorageType diskType) { + if (this.innerAttachNewDataDiskOptions() == null) { + this.innerAttachNewDataDiskOptions = new AttachNewDataDiskOptions(); + } + this.innerAttachNewDataDiskOptions().withDiskType(diskType); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (attachNewDataDiskOptions() != null) { - attachNewDataDiskOptions().validate(); + if (innerAttachNewDataDiskOptions() != null) { + innerAttachNewDataDiskOptions().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java index f56e6a1bb064..72ade71eab1a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disk.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner; import java.time.OffsetDateTime; @@ -47,6 +48,13 @@ public interface Disk { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the diskType property: The storage type for the disk (i.e. Standard, Premium). * @@ -338,9 +346,9 @@ interface UpdateStages { /** The stage of the Disk update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java index e3e0362be522..103632b483e5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A Disk. */ -@Immutable -public final class DiskFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class DiskFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskList.java index 973192a12bcb..be16034d9190 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DiskList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of disks and their properties. */ @Fluent public final class DiskList { @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskList.class); /* - * Results of the list operation. + * List of disks and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of disks and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the DiskList object itself. - */ - public DiskList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the DiskList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java index b9ae9f616e0e..3ed1139ff36f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Disks.java @@ -19,7 +19,7 @@ public interface Disks { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String username); @@ -29,21 +29,19 @@ public interface Disks { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of disks and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -70,15 +68,14 @@ PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the disk. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return disk along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context); + String resourceGroupName, String labName, String username, String name, Context context); /** * Delete disk. This operation can take a while to complete. @@ -196,7 +193,7 @@ void detach( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return disk along with {@link Response}. */ Disk getById(String id); @@ -204,14 +201,13 @@ void detach( * Get disk. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=diskType)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return disk along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete disk. This operation can take a while to complete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java index 8d01a27b03a2..f0c1168b9a7c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironment.java @@ -5,8 +5,10 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.DtlEnvironmentInner; +import java.util.List; import java.util.Map; /** An immutable client-side representation of DtlEnvironment. */ @@ -47,11 +49,11 @@ public interface DtlEnvironment { Map tags(); /** - * Gets the deploymentProperties property: The deployment properties of the environment. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the deploymentProperties value. + * @return the systemData value. */ - EnvironmentDeploymentProperties deploymentProperties(); + SystemData systemData(); /** * Gets the armTemplateDisplayName property: The display name of the Azure Resource Manager template that produced @@ -89,6 +91,20 @@ public interface DtlEnvironment { */ String uniqueIdentifier(); + /** + * Gets the armTemplateId property: The Azure Resource Manager template's identifier. + * + * @return the armTemplateId value. + */ + String armTemplateId(); + + /** + * Gets the parameters property: The parameters of the Azure Resource Manager template. + * + * @return the parameters value. + */ + List parameters(); + /** * Gets the region of the resource. * @@ -158,8 +174,9 @@ interface WithParentResource { */ interface WithCreate extends DefinitionStages.WithTags, - DefinitionStages.WithDeploymentProperties, - DefinitionStages.WithArmTemplateDisplayName { + DefinitionStages.WithArmTemplateDisplayName, + DefinitionStages.WithArmTemplateId, + DefinitionStages.WithParameters { /** * Executes the create request. * @@ -185,16 +202,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the DtlEnvironment definition allowing to specify deploymentProperties. */ - interface WithDeploymentProperties { - /** - * Specifies the deploymentProperties property: The deployment properties of the environment.. - * - * @param deploymentProperties The deployment properties of the environment. - * @return the next definition stage. - */ - WithCreate withDeploymentProperties(EnvironmentDeploymentProperties deploymentProperties); - } /** The stage of the DtlEnvironment definition allowing to specify armTemplateDisplayName. */ interface WithArmTemplateDisplayName { /** @@ -207,6 +214,26 @@ interface WithArmTemplateDisplayName { */ WithCreate withArmTemplateDisplayName(String armTemplateDisplayName); } + /** The stage of the DtlEnvironment definition allowing to specify armTemplateId. */ + interface WithArmTemplateId { + /** + * Specifies the armTemplateId property: The Azure Resource Manager template's identifier.. + * + * @param armTemplateId The Azure Resource Manager template's identifier. + * @return the next definition stage. + */ + WithCreate withArmTemplateId(String armTemplateId); + } + /** The stage of the DtlEnvironment definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: The parameters of the Azure Resource Manager template.. + * + * @param parameters The parameters of the Azure Resource Manager template. + * @return the next definition stage. + */ + WithCreate withParameters(List parameters); + } } /** * Begins update for the DtlEnvironment resource. @@ -237,9 +264,9 @@ interface UpdateStages { /** The stage of the DtlEnvironment update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java index a7a1654b7145..e8e4a072e837 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** An environment, which is essentially an ARM template deployment. */ -@Immutable -public final class DtlEnvironmentFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class DtlEnvironmentFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(DtlEnvironmentFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentList.java index e1bda4c63c84..0f7e3d2520ac 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/DtlEnvironmentList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of environments and their properties. */ @Fluent public final class DtlEnvironmentList { @JsonIgnore private final ClientLogger logger = new ClientLogger(DtlEnvironmentList.class); /* - * Results of the list operation. + * List of environments and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of environments and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the DtlEnvironmentList object itself. - */ - public DtlEnvironmentList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the DtlEnvironmentList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableState.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableState.java new file mode 100644 index 000000000000..6e3d613e313b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EnableState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnableState. */ +public final class EnableState extends ExpandableStringEnum { + /** Static value Disabled for EnableState. */ + public static final EnableState DISABLED = fromString("Disabled"); + + /** Static value Enabled for EnableState. */ + public static final EnableState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a EnableState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnableState. + */ + @JsonCreator + public static EnableState fromString(String name) { + return fromString(name, EnableState.class); + } + + /** @return known EnableState values. */ + public static Collection values() { + return values(EnableState.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EncryptionType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EncryptionType.java new file mode 100644 index 000000000000..a428c95ccd8a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/EncryptionType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionType. */ +public final class EncryptionType extends ExpandableStringEnum { + /** Static value EncryptionAtRestWithPlatformKey for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = + fromString("EncryptionAtRestWithPlatformKey"); + + /** Static value EncryptionAtRestWithCustomerKey for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = + fromString("EncryptionAtRestWithCustomerKey"); + + /** + * Creates or finds a EncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionType. + */ + @JsonCreator + public static EncryptionType fromString(String name) { + return fromString(name, EncryptionType.class); + } + + /** @return known EncryptionType values. */ + public static Collection values() { + return values(EncryptionType.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java index 8ce166a90356..fee8dbb71ad4 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Environments.java @@ -19,7 +19,7 @@ public interface Environments { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String username); @@ -29,21 +29,19 @@ public interface Environments { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of environments and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -70,15 +68,14 @@ PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context); + String resourceGroupName, String labName, String username, String name, Context context); /** * Delete environment. This operation can take a while to complete. @@ -114,7 +111,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment along with {@link Response}. */ DtlEnvironment getById(String id); @@ -122,14 +119,13 @@ Response getWithResponse( * Get environment. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=deploymentProperties)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment. + * @return environment along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete environment. This operation can take a while to complete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ErrorAdditionalInfo.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..776d799a0990 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ErrorAdditionalInfo.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource management error additional info. */ +@Immutable +public final class ErrorAdditionalInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); + + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object info() { + return this.info; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ErrorDetail.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ErrorDetail.java new file mode 100644 index 000000000000..5fcc5f0fde90 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ErrorDetail.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The error detail. */ +@Immutable +public final class ErrorDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorDetail.class); + + /* + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the details property: The error details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Get the additionalInfo property: The error additional info. + * + * @return the additionalInfo value. + */ + public List additionalInfo() { + return this.additionalInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (additionalInfo() != null) { + additionalInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java index baa7d7821960..e45de92a2f78 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formula.java @@ -5,9 +5,11 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.FormulaInner; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Formula. */ @@ -47,61 +49,643 @@ public interface Formula { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the description property: The description of the formula. * - * @return the description value. + * @return the description value. + */ + String description(); + + /** + * Gets the author property: The author of the formula. + * + * @return the author value. + */ + String author(); + + /** + * Gets the osType property: The OS type of the formula. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the creationDate property: The creation date of the formula. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the namePropertiesName property: The name of the virtual machine or environment. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the locationPropertiesLocation property: The location of the new virtual machine or environment. + * + * @return the locationPropertiesLocation value. + */ + String locationPropertiesLocation(); + + /** + * Gets the tagsPropertiesTags property: The tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + Map tagsPropertiesTags(); + + /** + * Gets the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + String ownerObjectId(); + + /** + * Gets the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + String ownerUserPrincipalName(); + + /** + * Gets the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + String createdByUserId(); + + /** + * Gets the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + String createdByUser(); + + /** + * Gets the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + String computeId(); + + /** + * Gets the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + String customImageId(); + + /** + * Gets the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + String galleryImageVersionId(); + + /** + * Gets the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + String sharedImageId(); + + /** + * Gets the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + String sharedImageVersion(); + + /** + * Gets the osTypeFormulaContentOsType property: The OS type of the virtual machine. + * + * @return the osTypeFormulaContentOsType value. + */ + String osTypeFormulaContentOsType(); + + /** + * Gets the size property: The size of the virtual machine. + * + * @return the size value. + */ + String size(); + + /** + * Gets the username property: The user name of the virtual machine. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + String password(); + + /** + * Gets the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + String sshKey(); + + /** + * Gets the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + Boolean isAuthenticationWithSshKey(); + + /** + * Gets the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + String labSubnetName(); + + /** + * Gets the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + String labVirtualNetworkId(); + + /** + * Gets the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a + * public IP address. + * + * @return the disallowPublicIpAddress value. + */ + Boolean disallowPublicIpAddress(); + + /** + * Gets the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + List artifacts(); + + /** + * Gets the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + String planId(); + + /** + * Gets the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used + * to overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + Integer osDiskSizeGb(); + + /** + * Gets the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + Boolean allowClaim(); + + /** + * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + StorageType storageType(); + + /** + * Gets the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + VirtualMachineCreationSource virtualMachineCreationSource(); + + /** + * Gets the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + List dataDiskParameters(); + + /** + * Gets the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + List scheduleParameters(); + + /** + * Gets the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + String lastKnownPowerState(); + + /** + * Gets the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. + * + * @return the canApplyArtifacts value. + */ + Boolean canApplyArtifacts(); + + /** + * Gets the provisioningStateFormulaContentProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateFormulaContentProvisioningState value. + */ + String provisioningStateFormulaContentProvisioningState(); + + /** + * Gets the uniqueIdentifierFormulaContentUniqueIdentifier property: The unique immutable identifier of a resource + * (Guid). + * + * @return the uniqueIdentifierFormulaContentUniqueIdentifier value. + */ + String uniqueIdentifierFormulaContentUniqueIdentifier(); + + /** + * Gets the instanceCount property: The number of virtual machine instances to create. + * + * @return the instanceCount value. + */ + Integer instanceCount(); + + /** + * Gets the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + String deploymentStatus(); + + /** + * Gets the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + Integer artifactsApplied(); + + /** + * Gets the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + Integer totalArtifacts(); + + /** + * Gets the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + String osTypeGalleryImageReferenceOsType(); + + /** + * Gets the version property: The version of the gallery image. + * + * @return the version value. + */ + String version(); + + /** + * Gets the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + String osTypeComputeVmOsType(); + + /** + * Gets the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + String networkInterfaceId(); + + /** + * Gets the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + String osDiskId(); + + /** + * Gets the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + List dataDiskIds(); + + /** + * Gets the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + List dataDisks(); + + /** + * Gets the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + String virtualNetworkId(); + + /** + * Gets the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + String publicIpAddressId(); + + /** + * Gets the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + String publicIpAddress(); + + /** + * Gets the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + String rdpAuthority(); + + /** + * Gets the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + String sshAuthority(); + + /** + * Gets the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. */ - String description(); + OffsetDateTime createdDateApplicableScheduleCreatedDate(); /** - * Gets the author property: The author of the formula. + * Gets the targetResourceId property: The resource ID to which the schedule belongs. * - * @return the author value. + * @return the targetResourceId value. */ - String author(); + String targetResourceId(); /** - * Gets the osType property: The OS type of the formula. + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. * - * @return the osType value. + * @return the provisioningStateApplicableScheduleProvisioningState value. */ - String osType(); + String provisioningStateApplicableScheduleProvisioningState(); /** - * Gets the creationDate property: The creation date of the formula. + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). * - * @return the creationDate value. + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. */ - OffsetDateTime creationDate(); + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); /** - * Gets the formulaContent property: The content of the formula. + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). * - * @return the formulaContent value. + * @return the weekdays value. */ - LabVirtualMachineCreationParameter formulaContent(); + List weekdays(); /** - * Gets the vm property: Information about a VM from which a formula is to be created. + * Gets the time property: The time of the day the schedule will occur. * - * @return the vm value. + * @return the time value. */ - FormulaPropertiesFromVm vm(); + String time(); /** - * Gets the provisioningState property: The provisioning status of the resource. + * Gets the minute property: Minutes of the hour the schedule will run. * - * @return the provisioningState value. + * @return the minute value. */ - String provisioningState(); + Integer minute(); /** - * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * - * @return the uniqueIdentifier value. + * @return the statusNotificationSettingsStatus value. */ - String uniqueIdentifier(); + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the idPropertiesId property: the fully qualified resource ID for the resource. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the typePropertiesType property: the type of the resource. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the labVmId property: The identifier of the VM from which a formula is to be created. + * + * @return the labVmId value. + */ + String labVmId(); /** * Gets the region of the resource. @@ -173,8 +757,50 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithDescription, DefinitionStages.WithOsType, - DefinitionStages.WithFormulaContent, - DefinitionStages.WithVm { + DefinitionStages.WithNamePropertiesName, + DefinitionStages.WithLocationPropertiesLocation, + DefinitionStages.WithTagsPropertiesTags, + DefinitionStages.WithNotes, + DefinitionStages.WithOwnerObjectId, + DefinitionStages.WithOwnerUserPrincipalName, + DefinitionStages.WithCreatedDate, + DefinitionStages.WithCustomImageId, + DefinitionStages.WithGalleryImageVersionId, + DefinitionStages.WithSharedImageId, + DefinitionStages.WithSharedImageVersion, + DefinitionStages.WithSize, + DefinitionStages.WithUsername, + DefinitionStages.WithPassword, + DefinitionStages.WithSshKey, + DefinitionStages.WithIsAuthenticationWithSshKey, + DefinitionStages.WithLabSubnetName, + DefinitionStages.WithLabVirtualNetworkId, + DefinitionStages.WithDisallowPublicIpAddress, + DefinitionStages.WithArtifacts, + DefinitionStages.WithPlanId, + DefinitionStages.WithOsDiskSizeGb, + DefinitionStages.WithExpirationDate, + DefinitionStages.WithAllowClaim, + DefinitionStages.WithStorageType, + DefinitionStages.WithEnvironmentId, + DefinitionStages.WithDataDiskParameters, + DefinitionStages.WithScheduleParameters, + DefinitionStages.WithInstanceCount, + DefinitionStages.WithOffer, + DefinitionStages.WithPublisher, + DefinitionStages.WithSku, + DefinitionStages.WithOsTypeGalleryImageReferenceOsType, + DefinitionStages.WithVersion, + DefinitionStages.WithVirtualNetworkId, + DefinitionStages.WithSubnetId, + DefinitionStages.WithPublicIpAddressId, + DefinitionStages.WithPublicIpAddress, + DefinitionStages.WithPrivateIpAddress, + DefinitionStages.WithDnsName, + DefinitionStages.WithRdpAuthority, + DefinitionStages.WithSshAuthority, + DefinitionStages.WithInboundNatRules, + DefinitionStages.WithLabVmId { /** * Executes the create request. * @@ -220,25 +846,463 @@ interface WithOsType { */ WithCreate withOsType(String osType); } - /** The stage of the Formula definition allowing to specify formulaContent. */ - interface WithFormulaContent { + /** The stage of the Formula definition allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: The name of the virtual machine or environment. + * + * @param namePropertiesName The name of the virtual machine or environment. + * @return the next definition stage. + */ + WithCreate withNamePropertiesName(String namePropertiesName); + } + /** The stage of the Formula definition allowing to specify locationPropertiesLocation. */ + interface WithLocationPropertiesLocation { + /** + * Specifies the locationPropertiesLocation property: The location of the new virtual machine or + * environment. + * + * @param locationPropertiesLocation The location of the new virtual machine or environment. + * @return the next definition stage. + */ + WithCreate withLocationPropertiesLocation(String locationPropertiesLocation); + } + /** The stage of the Formula definition allowing to specify tagsPropertiesTags. */ + interface WithTagsPropertiesTags { + /** + * Specifies the tagsPropertiesTags property: The tags of the resource.. + * + * @param tagsPropertiesTags The tags of the resource. + * @return the next definition stage. + */ + WithCreate withTagsPropertiesTags(Map tagsPropertiesTags); + } + /** The stage of the Formula definition allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: The notes of the virtual machine.. + * + * @param notes The notes of the virtual machine. + * @return the next definition stage. + */ + WithCreate withNotes(String notes); + } + /** The stage of the Formula definition allowing to specify ownerObjectId. */ + interface WithOwnerObjectId { + /** + * Specifies the ownerObjectId property: The object identifier of the owner of the virtual machine.. + * + * @param ownerObjectId The object identifier of the owner of the virtual machine. + * @return the next definition stage. + */ + WithCreate withOwnerObjectId(String ownerObjectId); + } + /** The stage of the Formula definition allowing to specify ownerUserPrincipalName. */ + interface WithOwnerUserPrincipalName { + /** + * Specifies the ownerUserPrincipalName property: The user principal name of the virtual machine owner.. + * + * @param ownerUserPrincipalName The user principal name of the virtual machine owner. + * @return the next definition stage. + */ + WithCreate withOwnerUserPrincipalName(String ownerUserPrincipalName); + } + /** The stage of the Formula definition allowing to specify createdDate. */ + interface WithCreatedDate { + /** + * Specifies the createdDate property: The creation date of the virtual machine.. + * + * @param createdDate The creation date of the virtual machine. + * @return the next definition stage. + */ + WithCreate withCreatedDate(OffsetDateTime createdDate); + } + /** The stage of the Formula definition allowing to specify customImageId. */ + interface WithCustomImageId { + /** + * Specifies the customImageId property: The custom image identifier of the virtual machine.. + * + * @param customImageId The custom image identifier of the virtual machine. + * @return the next definition stage. + */ + WithCreate withCustomImageId(String customImageId); + } + /** The stage of the Formula definition allowing to specify galleryImageVersionId. */ + interface WithGalleryImageVersionId { + /** + * Specifies the galleryImageVersionId property: The shared gallery image version resource identifier of the + * virtual machine.. + * + * @param galleryImageVersionId The shared gallery image version resource identifier of the virtual machine. + * @return the next definition stage. + */ + WithCreate withGalleryImageVersionId(String galleryImageVersionId); + } + /** The stage of the Formula definition allowing to specify sharedImageId. */ + interface WithSharedImageId { + /** + * Specifies the sharedImageId property: The shared image resource identifier of the virtual machine.. + * + * @param sharedImageId The shared image resource identifier of the virtual machine. + * @return the next definition stage. + */ + WithCreate withSharedImageId(String sharedImageId); + } + /** The stage of the Formula definition allowing to specify sharedImageVersion. */ + interface WithSharedImageVersion { + /** + * Specifies the sharedImageVersion property: The shared image version for the specified shared image Id. + * Will use latest if not specified.. + * + * @param sharedImageVersion The shared image version for the specified shared image Id. Will use latest if + * not specified. + * @return the next definition stage. + */ + WithCreate withSharedImageVersion(String sharedImageVersion); + } + /** The stage of the Formula definition allowing to specify size. */ + interface WithSize { + /** + * Specifies the size property: The size of the virtual machine.. + * + * @param size The size of the virtual machine. + * @return the next definition stage. + */ + WithCreate withSize(String size); + } + /** The stage of the Formula definition allowing to specify username. */ + interface WithUsername { + /** + * Specifies the username property: The user name of the virtual machine.. + * + * @param username The user name of the virtual machine. + * @return the next definition stage. + */ + WithCreate withUsername(String username); + } + /** The stage of the Formula definition allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: The password of the virtual machine administrator.. + * + * @param password The password of the virtual machine administrator. + * @return the next definition stage. + */ + WithCreate withPassword(String password); + } + /** The stage of the Formula definition allowing to specify sshKey. */ + interface WithSshKey { + /** + * Specifies the sshKey property: The SSH key of the virtual machine administrator.. + * + * @param sshKey The SSH key of the virtual machine administrator. + * @return the next definition stage. + */ + WithCreate withSshKey(String sshKey); + } + /** The stage of the Formula definition allowing to specify isAuthenticationWithSshKey. */ + interface WithIsAuthenticationWithSshKey { + /** + * Specifies the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key + * for authentication.. + * + * @param isAuthenticationWithSshKey Indicates whether this virtual machine uses an SSH key for + * authentication. + * @return the next definition stage. + */ + WithCreate withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey); + } + /** The stage of the Formula definition allowing to specify labSubnetName. */ + interface WithLabSubnetName { + /** + * Specifies the labSubnetName property: The lab subnet name of the virtual machine.. + * + * @param labSubnetName The lab subnet name of the virtual machine. + * @return the next definition stage. + */ + WithCreate withLabSubnetName(String labSubnetName); + } + /** The stage of the Formula definition allowing to specify labVirtualNetworkId. */ + interface WithLabVirtualNetworkId { + /** + * Specifies the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine.. + * + * @param labVirtualNetworkId The lab virtual network identifier of the virtual machine. + * @return the next definition stage. + */ + WithCreate withLabVirtualNetworkId(String labVirtualNetworkId); + } + /** The stage of the Formula definition allowing to specify disallowPublicIpAddress. */ + interface WithDisallowPublicIpAddress { + /** + * Specifies the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created + * without a public IP address.. + * + * @param disallowPublicIpAddress Indicates whether the virtual machine is to be created without a public IP + * address. + * @return the next definition stage. + */ + WithCreate withDisallowPublicIpAddress(Boolean disallowPublicIpAddress); + } + /** The stage of the Formula definition allowing to specify artifacts. */ + interface WithArtifacts { + /** + * Specifies the artifacts property: The artifacts to be installed on the virtual machine.. + * + * @param artifacts The artifacts to be installed on the virtual machine. + * @return the next definition stage. + */ + WithCreate withArtifacts(List artifacts); + } + /** The stage of the Formula definition allowing to specify planId. */ + interface WithPlanId { + /** + * Specifies the planId property: The id of the plan associated with the virtual machine image. + * + * @param planId The id of the plan associated with the virtual machine image. + * @return the next definition stage. + */ + WithCreate withPlanId(String planId); + } + /** The stage of the Formula definition allowing to specify osDiskSizeGb. */ + interface WithOsDiskSizeGb { + /** + * Specifies the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image.. + * + * @param osDiskSizeGb Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. + * @return the next definition stage. + */ + WithCreate withOsDiskSizeGb(Integer osDiskSizeGb); + } + /** The stage of the Formula definition allowing to specify expirationDate. */ + interface WithExpirationDate { + /** + * Specifies the expirationDate property: The expiration date for VM.. + * + * @param expirationDate The expiration date for VM. + * @return the next definition stage. + */ + WithCreate withExpirationDate(OffsetDateTime expirationDate); + } + /** The stage of the Formula definition allowing to specify allowClaim. */ + interface WithAllowClaim { + /** + * Specifies the allowClaim property: Indicates whether another user can take ownership of the virtual + * machine. + * + * @param allowClaim Indicates whether another user can take ownership of the virtual machine. + * @return the next definition stage. + */ + WithCreate withAllowClaim(Boolean allowClaim); + } + /** The stage of the Formula definition allowing to specify storageType. */ + interface WithStorageType { + /** + * Specifies the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, + * StandardSSD).. + * + * @param storageType Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * @return the next definition stage. + */ + WithCreate withStorageType(StorageType storageType); + } + /** The stage of the Formula definition allowing to specify environmentId. */ + interface WithEnvironmentId { + /** + * Specifies the environmentId property: The resource ID of the environment that contains this virtual + * machine, if any.. + * + * @param environmentId The resource ID of the environment that contains this virtual machine, if any. + * @return the next definition stage. + */ + WithCreate withEnvironmentId(String environmentId); + } + /** The stage of the Formula definition allowing to specify dataDiskParameters. */ + interface WithDataDiskParameters { + /** + * Specifies the dataDiskParameters property: New or existing data disks to attach to the virtual machine + * after creation. + * + * @param dataDiskParameters New or existing data disks to attach to the virtual machine after creation. + * @return the next definition stage. + */ + WithCreate withDataDiskParameters(List dataDiskParameters); + } + /** The stage of the Formula definition allowing to specify scheduleParameters. */ + interface WithScheduleParameters { + /** + * Specifies the scheduleParameters property: Virtual Machine schedules to be created. + * + * @param scheduleParameters Virtual Machine schedules to be created. + * @return the next definition stage. + */ + WithCreate withScheduleParameters(List scheduleParameters); + } + /** The stage of the Formula definition allowing to specify instanceCount. */ + interface WithInstanceCount { + /** + * Specifies the instanceCount property: The number of virtual machine instances to create.. + * + * @param instanceCount The number of virtual machine instances to create. + * @return the next definition stage. + */ + WithCreate withInstanceCount(Integer instanceCount); + } + /** The stage of the Formula definition allowing to specify offer. */ + interface WithOffer { + /** + * Specifies the offer property: The offer of the gallery image.. + * + * @param offer The offer of the gallery image. + * @return the next definition stage. + */ + WithCreate withOffer(String offer); + } + /** The stage of the Formula definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The publisher of the gallery image.. + * + * @param publisher The publisher of the gallery image. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the Formula definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the gallery image.. + * + * @param sku The SKU of the gallery image. + * @return the next definition stage. + */ + WithCreate withSku(String sku); + } + /** The stage of the Formula definition allowing to specify osTypeGalleryImageReferenceOsType. */ + interface WithOsTypeGalleryImageReferenceOsType { + /** + * Specifies the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image.. + * + * @param osTypeGalleryImageReferenceOsType The OS type of the gallery image. + * @return the next definition stage. + */ + WithCreate withOsTypeGalleryImageReferenceOsType(String osTypeGalleryImageReferenceOsType); + } + /** The stage of the Formula definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: The version of the gallery image.. + * + * @param version The version of the gallery image. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + /** The stage of the Formula definition allowing to specify virtualNetworkId. */ + interface WithVirtualNetworkId { + /** + * Specifies the virtualNetworkId property: The resource ID of the virtual network.. + * + * @param virtualNetworkId The resource ID of the virtual network. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkId(String virtualNetworkId); + } + /** The stage of the Formula definition allowing to specify subnetId. */ + interface WithSubnetId { + /** + * Specifies the subnetId property: The resource ID of the sub net.. + * + * @param subnetId The resource ID of the sub net. + * @return the next definition stage. + */ + WithCreate withSubnetId(String subnetId); + } + /** The stage of the Formula definition allowing to specify publicIpAddressId. */ + interface WithPublicIpAddressId { + /** + * Specifies the publicIpAddressId property: The resource ID of the public IP address.. + * + * @param publicIpAddressId The resource ID of the public IP address. + * @return the next definition stage. + */ + WithCreate withPublicIpAddressId(String publicIpAddressId); + } + /** The stage of the Formula definition allowing to specify publicIpAddress. */ + interface WithPublicIpAddress { + /** + * Specifies the publicIpAddress property: The public IP address.. + * + * @param publicIpAddress The public IP address. + * @return the next definition stage. + */ + WithCreate withPublicIpAddress(String publicIpAddress); + } + /** The stage of the Formula definition allowing to specify privateIpAddress. */ + interface WithPrivateIpAddress { + /** + * Specifies the privateIpAddress property: The private IP address.. + * + * @param privateIpAddress The private IP address. + * @return the next definition stage. + */ + WithCreate withPrivateIpAddress(String privateIpAddress); + } + /** The stage of the Formula definition allowing to specify dnsName. */ + interface WithDnsName { /** - * Specifies the formulaContent property: The content of the formula.. + * Specifies the dnsName property: The DNS name.. * - * @param formulaContent The content of the formula. + * @param dnsName The DNS name. * @return the next definition stage. */ - WithCreate withFormulaContent(LabVirtualMachineCreationParameter formulaContent); + WithCreate withDnsName(String dnsName); } - /** The stage of the Formula definition allowing to specify vm. */ - interface WithVm { + /** The stage of the Formula definition allowing to specify rdpAuthority. */ + interface WithRdpAuthority { /** - * Specifies the vm property: Information about a VM from which a formula is to be created.. + * Specifies the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address + * followed by the service port number for RDP (Remote Desktop Protocol).. * - * @param vm Information about a VM from which a formula is to be created. + * @param rdpAuthority The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). * @return the next definition stage. */ - WithCreate withVm(FormulaPropertiesFromVm vm); + WithCreate withRdpAuthority(String rdpAuthority); + } + /** The stage of the Formula definition allowing to specify sshAuthority. */ + interface WithSshAuthority { + /** + * Specifies the sshAuthority property: The SshAuthority property is a server DNS host name or IP address + * followed by the service port number for SSH.. + * + * @param sshAuthority The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * @return the next definition stage. + */ + WithCreate withSshAuthority(String sshAuthority); + } + /** The stage of the Formula definition allowing to specify inboundNatRules. */ + interface WithInboundNatRules { + /** + * Specifies the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules The incoming NAT rules. + * @return the next definition stage. + */ + WithCreate withInboundNatRules(List inboundNatRules); + } + /** The stage of the Formula definition allowing to specify labVmId. */ + interface WithLabVmId { + /** + * Specifies the labVmId property: The identifier of the VM from which a formula is to be created.. + * + * @param labVmId The identifier of the VM from which a formula is to be created. + * @return the next definition stage. + */ + WithCreate withLabVmId(String labVmId); } } /** @@ -270,9 +1334,9 @@ interface UpdateStages { /** The stage of the Formula update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java index c55a002df1bf..2bc2e00570b3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A formula for creating a VM, specifying an image base and other parameters. */ -@Immutable -public final class FormulaFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class FormulaFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(FormulaFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaList.java index 8533445239a8..e51be188f25f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of formulas and their properties. */ @Fluent public final class FormulaList { @JsonIgnore private final ClientLogger logger = new ClientLogger(FormulaList.class); /* - * Results of the list operation. + * List of formulas and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of formulas and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the FormulaList object itself. - */ - public FormulaList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the FormulaList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaProperties.java new file mode 100644 index 000000000000..3d533d338b47 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/FormulaProperties.java @@ -0,0 +1,680 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.FormulaPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of FormulaProperties. */ +public interface FormulaProperties { + /** + * Gets the description property: The description of the formula. + * + * @return the description value. + */ + String description(); + + /** + * Gets the author property: The author of the formula. + * + * @return the author value. + */ + String author(); + + /** + * Gets the osType property: The OS type of the formula. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the creationDate property: The creation date of the formula. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the name property: The name of the virtual machine or environment. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: The location of the new virtual machine or environment. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: The tags of the resource. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + String ownerObjectId(); + + /** + * Gets the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + String ownerUserPrincipalName(); + + /** + * Gets the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + String createdByUserId(); + + /** + * Gets the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + String createdByUser(); + + /** + * Gets the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + String computeId(); + + /** + * Gets the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + String customImageId(); + + /** + * Gets the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + String galleryImageVersionId(); + + /** + * Gets the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + String sharedImageId(); + + /** + * Gets the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + String sharedImageVersion(); + + /** + * Gets the osTypeFormulaContentOsType property: The OS type of the virtual machine. + * + * @return the osTypeFormulaContentOsType value. + */ + String osTypeFormulaContentOsType(); + + /** + * Gets the size property: The size of the virtual machine. + * + * @return the size value. + */ + String size(); + + /** + * Gets the username property: The user name of the virtual machine. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + String password(); + + /** + * Gets the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + String sshKey(); + + /** + * Gets the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + Boolean isAuthenticationWithSshKey(); + + /** + * Gets the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + String labSubnetName(); + + /** + * Gets the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + String labVirtualNetworkId(); + + /** + * Gets the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a + * public IP address. + * + * @return the disallowPublicIpAddress value. + */ + Boolean disallowPublicIpAddress(); + + /** + * Gets the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + List artifacts(); + + /** + * Gets the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + String planId(); + + /** + * Gets the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used + * to overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + Integer osDiskSizeGb(); + + /** + * Gets the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + Boolean allowClaim(); + + /** + * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + StorageType storageType(); + + /** + * Gets the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + VirtualMachineCreationSource virtualMachineCreationSource(); + + /** + * Gets the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + List dataDiskParameters(); + + /** + * Gets the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + List scheduleParameters(); + + /** + * Gets the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + String lastKnownPowerState(); + + /** + * Gets the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. + * + * @return the canApplyArtifacts value. + */ + Boolean canApplyArtifacts(); + + /** + * Gets the provisioningStateFormulaContentProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateFormulaContentProvisioningState value. + */ + String provisioningStateFormulaContentProvisioningState(); + + /** + * Gets the uniqueIdentifierFormulaContentUniqueIdentifier property: The unique immutable identifier of a resource + * (Guid). + * + * @return the uniqueIdentifierFormulaContentUniqueIdentifier value. + */ + String uniqueIdentifierFormulaContentUniqueIdentifier(); + + /** + * Gets the instanceCount property: The number of virtual machine instances to create. + * + * @return the instanceCount value. + */ + Integer instanceCount(); + + /** + * Gets the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + String deploymentStatus(); + + /** + * Gets the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + Integer artifactsApplied(); + + /** + * Gets the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + Integer totalArtifacts(); + + /** + * Gets the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + String osTypeGalleryImageReferenceOsType(); + + /** + * Gets the version property: The version of the gallery image. + * + * @return the version value. + */ + String version(); + + /** + * Gets the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + String osTypeComputeVmOsType(); + + /** + * Gets the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + String networkInterfaceId(); + + /** + * Gets the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + String osDiskId(); + + /** + * Gets the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + List dataDiskIds(); + + /** + * Gets the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + List dataDisks(); + + /** + * Gets the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + String virtualNetworkId(); + + /** + * Gets the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + String publicIpAddressId(); + + /** + * Gets the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + String publicIpAddress(); + + /** + * Gets the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + String rdpAuthority(); + + /** + * Gets the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + String sshAuthority(); + + /** + * Gets the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + OffsetDateTime createdDateApplicableScheduleCreatedDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + String provisioningStateApplicableScheduleProvisioningState(); + + /** + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the namePropertiesName property: the name of the resource. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the type property: the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the locationPropertiesLocation property: the geo-location where the resource live. + * + * @return the locationPropertiesLocation value. + */ + String locationPropertiesLocation(); + + /** + * Gets the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + Map tagsPropertiesTags(); + + /** + * Gets the labVmId property: The identifier of the VM from which a formula is to be created. + * + * @return the labVmId value. + */ + String labVmId(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.FormulaPropertiesInner object. + * + * @return the inner object. + */ + FormulaPropertiesInner innerModel(); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java index 420a159e91e4..4f605d2d68c0 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Formulas.java @@ -18,7 +18,7 @@ public interface Formulas { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -27,24 +27,17 @@ public interface Formulas { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of formulas and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get formula. @@ -65,15 +58,13 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the formula. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Delete formula. @@ -97,7 +88,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -108,7 +99,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula along with {@link Response}. */ Formula getById(String id); @@ -116,14 +107,13 @@ Response getWithResponse( * Get formula. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return formula. + * @return formula along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete formula. @@ -143,7 +133,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java index 4c6b635e2ed4..3ef194c578fa 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImage.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.devtestlabs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner; import java.time.OffsetDateTime; -import java.util.Map; /** An immutable client-side representation of GalleryImage. */ public interface GalleryImage { @@ -32,18 +32,11 @@ public interface GalleryImage { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the location value. + * @return the systemData value. */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); + SystemData systemData(); /** * Gets the author property: The author of the gallery image. @@ -66,13 +59,6 @@ public interface GalleryImage { */ String description(); - /** - * Gets the imageReference property: The image reference of the gallery image. - * - * @return the imageReference value. - */ - GalleryImageReference imageReference(); - /** * Gets the icon property: The icon of the gallery image. * @@ -101,6 +87,41 @@ public interface GalleryImage { */ Boolean isPlanAuthorized(); + /** + * Gets the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the osType property: The OS type of the gallery image. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the version property: The version of the gallery image. + * + * @return the version value. + */ + String version(); + /** * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.GalleryImageInner object. * diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageList.java index 81f9d164936f..d3bd061d4009 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImageList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of galleryImages and their properties. */ @Fluent public final class GalleryImageList { @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageList.class); /* - * Results of the list operation. + * List of galleryImages and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of galleryImages and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the GalleryImageList object itself. - */ - public GalleryImageList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the GalleryImageList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java index 9f1af15099d2..bbd5f213a1c8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GalleryImages.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; /** Resource collection API of GalleryImages. */ @@ -17,7 +18,7 @@ public interface GalleryImages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -26,22 +27,42 @@ public interface GalleryImages { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of galleryImages and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image. + */ + GalleryImage get(String resourceGroupName, String labName, String name); + + /** + * Get gallery image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the gallery image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gallery image along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java index ab62d09cc507..84f7e10250f7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/GlobalSchedules.java @@ -15,24 +15,23 @@ public interface GlobalSchedules { * * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(); /** * List schedules in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); + PagedIterable list(String filter, Integer top, String orderby, Context context); /** * List schedules in a resource group. @@ -41,7 +40,7 @@ public interface GlobalSchedules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,18 +48,17 @@ public interface GlobalSchedules { * List schedules in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context); + String resourceGroupName, String filter, Integer top, String orderby, Context context); /** * Get schedule. @@ -79,15 +77,13 @@ PagedIterable listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String name, String expand, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); /** * Delete schedule. @@ -109,7 +105,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String name, Context context); @@ -169,7 +165,7 @@ void retarget( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ Schedule getById(String id); @@ -177,14 +173,13 @@ void retarget( * Get schedule. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete schedule. @@ -204,7 +199,7 @@ void retarget( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java index a9f425520177..7be83c6a3217 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/HttpStatusCode.java @@ -16,6 +16,12 @@ public final class HttpStatusCode extends ExpandableStringEnum { /** Static value SwitchingProtocols for HttpStatusCode. */ public static final HttpStatusCode SWITCHING_PROTOCOLS = fromString("SwitchingProtocols"); + /** Static value Processing for HttpStatusCode. */ + public static final HttpStatusCode PROCESSING = fromString("Processing"); + + /** Static value EarlyHints for HttpStatusCode. */ + public static final HttpStatusCode EARLY_HINTS = fromString("EarlyHints"); + /** Static value OK for HttpStatusCode. */ public static final HttpStatusCode OK = fromString("OK"); @@ -37,6 +43,15 @@ public final class HttpStatusCode extends ExpandableStringEnum { /** Static value PartialContent for HttpStatusCode. */ public static final HttpStatusCode PARTIAL_CONTENT = fromString("PartialContent"); + /** Static value MultiStatus for HttpStatusCode. */ + public static final HttpStatusCode MULTI_STATUS = fromString("MultiStatus"); + + /** Static value AlreadyReported for HttpStatusCode. */ + public static final HttpStatusCode ALREADY_REPORTED = fromString("AlreadyReported"); + + /** Static value IMUsed for HttpStatusCode. */ + public static final HttpStatusCode IMUSED = fromString("IMUsed"); + /** Static value MultipleChoices for HttpStatusCode. */ public static final HttpStatusCode MULTIPLE_CHOICES = fromString("MultipleChoices"); @@ -76,6 +91,9 @@ public final class HttpStatusCode extends ExpandableStringEnum { /** Static value RedirectKeepVerb for HttpStatusCode. */ public static final HttpStatusCode REDIRECT_KEEP_VERB = fromString("RedirectKeepVerb"); + /** Static value PermanentRedirect for HttpStatusCode. */ + public static final HttpStatusCode PERMANENT_REDIRECT = fromString("PermanentRedirect"); + /** Static value BadRequest for HttpStatusCode. */ public static final HttpStatusCode BAD_REQUEST = fromString("BadRequest"); @@ -130,9 +148,33 @@ public final class HttpStatusCode extends ExpandableStringEnum { /** Static value ExpectationFailed for HttpStatusCode. */ public static final HttpStatusCode EXPECTATION_FAILED = fromString("ExpectationFailed"); + /** Static value MisdirectedRequest for HttpStatusCode. */ + public static final HttpStatusCode MISDIRECTED_REQUEST = fromString("MisdirectedRequest"); + + /** Static value UnprocessableEntity for HttpStatusCode. */ + public static final HttpStatusCode UNPROCESSABLE_ENTITY = fromString("UnprocessableEntity"); + + /** Static value Locked for HttpStatusCode. */ + public static final HttpStatusCode LOCKED = fromString("Locked"); + + /** Static value FailedDependency for HttpStatusCode. */ + public static final HttpStatusCode FAILED_DEPENDENCY = fromString("FailedDependency"); + /** Static value UpgradeRequired for HttpStatusCode. */ public static final HttpStatusCode UPGRADE_REQUIRED = fromString("UpgradeRequired"); + /** Static value PreconditionRequired for HttpStatusCode. */ + public static final HttpStatusCode PRECONDITION_REQUIRED = fromString("PreconditionRequired"); + + /** Static value TooManyRequests for HttpStatusCode. */ + public static final HttpStatusCode TOO_MANY_REQUESTS = fromString("TooManyRequests"); + + /** Static value RequestHeaderFieldsTooLarge for HttpStatusCode. */ + public static final HttpStatusCode REQUEST_HEADER_FIELDS_TOO_LARGE = fromString("RequestHeaderFieldsTooLarge"); + + /** Static value UnavailableForLegalReasons for HttpStatusCode. */ + public static final HttpStatusCode UNAVAILABLE_FOR_LEGAL_REASONS = fromString("UnavailableForLegalReasons"); + /** Static value InternalServerError for HttpStatusCode. */ public static final HttpStatusCode INTERNAL_SERVER_ERROR = fromString("InternalServerError"); @@ -151,6 +193,21 @@ public final class HttpStatusCode extends ExpandableStringEnum { /** Static value HttpVersionNotSupported for HttpStatusCode. */ public static final HttpStatusCode HTTP_VERSION_NOT_SUPPORTED = fromString("HttpVersionNotSupported"); + /** Static value VariantAlsoNegotiates for HttpStatusCode. */ + public static final HttpStatusCode VARIANT_ALSO_NEGOTIATES = fromString("VariantAlsoNegotiates"); + + /** Static value InsufficientStorage for HttpStatusCode. */ + public static final HttpStatusCode INSUFFICIENT_STORAGE = fromString("InsufficientStorage"); + + /** Static value LoopDetected for HttpStatusCode. */ + public static final HttpStatusCode LOOP_DETECTED = fromString("LoopDetected"); + + /** Static value NotExtended for HttpStatusCode. */ + public static final HttpStatusCode NOT_EXTENDED = fromString("NotExtended"); + + /** Static value NetworkAuthenticationRequired for HttpStatusCode. */ + public static final HttpStatusCode NETWORK_AUTHENTICATION_REQUIRED = fromString("NetworkAuthenticationRequired"); + /** * Creates or finds a HttpStatusCode from its string representation. * diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Identity.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Identity.java new file mode 100644 index 000000000000..74d3f878bf79 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Identity.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity for the resource. */ +@Fluent +public class Identity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); + + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImageType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImageType.java new file mode 100644 index 000000000000..e2fa0ddeb257 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImageType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImageType. */ +public final class ImageType extends ExpandableStringEnum { + /** Static value Generalized for ImageType. */ + public static final ImageType GENERALIZED = fromString("Generalized"); + + /** Static value Specialized for ImageType. */ + public static final ImageType SPECIALIZED = fromString("Specialized"); + + /** + * Creates or finds a ImageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageType. + */ + @JsonCreator + public static ImageType fromString(String name) { + return fromString(name, ImageType.class); + } + + /** @return known ImageType values. */ + public static Collection values() { + return values(ImageType.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImageVersionProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImageVersionProperties.java new file mode 100644 index 000000000000..aa7792750083 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ImageVersionProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for a shared image version. */ +@Fluent +public final class ImageVersionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageVersionProperties.class); + + /* + * Image version name + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Image version name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Image version name. + * + * @param name the name value to set. + * @return the ImageVersionProperties object itself. + */ + public ImageVersionProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java index 9603a37c9da8..35768e54f503 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Lab.java @@ -7,8 +7,10 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabInner; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -50,6 +52,13 @@ public interface Lab { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the defaultStorageAccount property: The lab's default storage account. * @@ -134,22 +143,9 @@ public interface Lab { EnvironmentPermission environmentPermission(); /** - * Gets the announcement property: The properties of any lab announcement associated with this lab. - * - * @return the announcement value. - */ - LabAnnouncementProperties announcement(); - - /** - * Gets the support property: The properties of any lab support message associated with this lab. - * - * @return the support value. - */ - LabSupportProperties support(); - - /** - * Gets the vmCreationResourceGroup property: The resource group in which all new lab virtual machines will be - * created. To let DevTest Labs manage resource group creation, set this value to null. + * Gets the vmCreationResourceGroup property: The resource group ID in which all new lab virtual machines will be + * created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest Labs manage resource group creation, set + * this value to null. * * @return the vmCreationResourceGroup value. */ @@ -184,6 +180,42 @@ public interface Lab { */ Map extendedProperties(); + /** + * Gets the browserConnect property: Is browser connect enabled for the lab. + * + * @return the browserConnect value. + */ + EnableStatus browserConnect(); + + /** + * Gets the disableAutoUpgradeCseMinorVersion property: Is auto upgrade of CSE disabled for the lab?. + * + * @return the disableAutoUpgradeCseMinorVersion value. + */ + Boolean disableAutoUpgradeCseMinorVersion(); + + /** + * Gets the managementIdentities property: List of identities which can be used for management of resources. + * + * @return the managementIdentities value. + */ + Map managementIdentities(); + + /** + * Gets the isolateLabResources property: Indicates whether to create Lab resources (e.g. Storage accounts and Key + * Vaults) in network isolation. + * + * @return the isolateLabResources value. + */ + EnableStatus isolateLabResources(); + + /** + * Gets the defaultSecretName property: Default secret for creating virtual machines. + * + * @return the defaultSecretName value. + */ + String defaultSecretName(); + /** * Gets the provisioningState property: The provisioning status of the resource. * @@ -198,6 +230,108 @@ public interface Lab { */ String uniqueIdentifier(); + /** + * Gets the title property: The plain text title for the lab announcement. + * + * @return the title value. + */ + String title(); + + /** + * Gets the markdown property: The markdown text (if any) that this lab displays in the UI. If left empty/null, + * nothing will be shown. + * + * @return the markdown value. + */ + String markdown(); + + /** + * Gets the enabled property: Is the lab announcement active/enabled at this time?. + * + * @return the enabled value. + */ + EnableStatus enabled(); + + /** + * Gets the expirationDate property: The time at which the announcement expires (null for never). + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the expired property: Has this announcement expired?. + * + * @return the expired value. + */ + Boolean expired(); + + /** + * Gets the provisioningStateAnnouncementProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateAnnouncementProvisioningState value. + */ + String provisioningStateAnnouncementProvisioningState(); + + /** + * Gets the uniqueIdentifierAnnouncementUniqueIdentifier property: The unique immutable identifier of a resource + * (Guid). + * + * @return the uniqueIdentifierAnnouncementUniqueIdentifier value. + */ + String uniqueIdentifierAnnouncementUniqueIdentifier(); + + /** + * Gets the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * + * @return the diskEncryptionSetId value. + */ + String diskEncryptionSetId(); + + /** + * Gets the typePropertiesType property: Gets or sets the type of key used to encrypt the data of the disk. Possible + * values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @return the typePropertiesType value. + */ + EncryptionType typePropertiesType(); + + /** + * Gets the typeIdentityType property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @return the typeIdentityType value. + */ + ManagedIdentityType typeIdentityType(); + + /** + * Gets the principalId property: The principal id of resource identity. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the tenantId property: The tenant identifier of resource. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the clientSecretUrl property: The client secret URL of the identity. + * + * @return the clientSecretUrl value. + */ + String clientSecretUrl(); + + /** + * Gets the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @return the userAssignedIdentities value. + */ + Map userAssignedIdentities(); + /** * Gets the region of the resource. * @@ -265,14 +399,31 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithArtifactsStorageAccount, DefinitionStages.WithLabStorageType, DefinitionStages.WithMandatoryArtifactsResourceIdsLinux, DefinitionStages.WithMandatoryArtifactsResourceIdsWindows, DefinitionStages.WithPremiumDataDisks, DefinitionStages.WithEnvironmentPermission, - DefinitionStages.WithAnnouncement, - DefinitionStages.WithSupport, - DefinitionStages.WithExtendedProperties { + DefinitionStages.WithVmCreationResourceGroup, + DefinitionStages.WithExtendedProperties, + DefinitionStages.WithBrowserConnect, + DefinitionStages.WithDisableAutoUpgradeCseMinorVersion, + DefinitionStages.WithManagementIdentities, + DefinitionStages.WithIsolateLabResources, + DefinitionStages.WithDefaultSecretName, + DefinitionStages.WithTitle, + DefinitionStages.WithMarkdown, + DefinitionStages.WithEnabled, + DefinitionStages.WithExpirationDate, + DefinitionStages.WithExpired, + DefinitionStages.WithDiskEncryptionSetId, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeIdentityType, + DefinitionStages.WithPrincipalId, + DefinitionStages.WithTenantId, + DefinitionStages.WithClientSecretUrl, + DefinitionStages.WithUserAssignedIdentities { /** * Executes the create request. * @@ -298,6 +449,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Lab definition allowing to specify artifactsStorageAccount. */ + interface WithArtifactsStorageAccount { + /** + * Specifies the artifactsStorageAccount property: The lab's artifact storage account.. + * + * @param artifactsStorageAccount The lab's artifact storage account. + * @return the next definition stage. + */ + WithCreate withArtifactsStorageAccount(String artifactsStorageAccount); + } /** The stage of the Lab definition allowing to specify labStorageType. */ interface WithLabStorageType { /** @@ -361,25 +522,19 @@ interface WithEnvironmentPermission { */ WithCreate withEnvironmentPermission(EnvironmentPermission environmentPermission); } - /** The stage of the Lab definition allowing to specify announcement. */ - interface WithAnnouncement { - /** - * Specifies the announcement property: The properties of any lab announcement associated with this lab. - * - * @param announcement The properties of any lab announcement associated with this lab. - * @return the next definition stage. - */ - WithCreate withAnnouncement(LabAnnouncementProperties announcement); - } - /** The stage of the Lab definition allowing to specify support. */ - interface WithSupport { + /** The stage of the Lab definition allowing to specify vmCreationResourceGroup. */ + interface WithVmCreationResourceGroup { /** - * Specifies the support property: The properties of any lab support message associated with this lab. + * Specifies the vmCreationResourceGroup property: The resource group ID in which all new lab virtual + * machines will be created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest Labs manage + * resource group creation, set this value to null.. * - * @param support The properties of any lab support message associated with this lab. + * @param vmCreationResourceGroup The resource group ID in which all new lab virtual machines will be + * created. Ex: /subscriptions/subId/resourceGroups/rgName To let DevTest Labs manage resource group + * creation, set this value to null. * @return the next definition stage. */ - WithCreate withSupport(LabSupportProperties support); + WithCreate withVmCreationResourceGroup(String vmCreationResourceGroup); } /** The stage of the Lab definition allowing to specify extendedProperties. */ interface WithExtendedProperties { @@ -391,6 +546,186 @@ interface WithExtendedProperties { */ WithCreate withExtendedProperties(Map extendedProperties); } + /** The stage of the Lab definition allowing to specify browserConnect. */ + interface WithBrowserConnect { + /** + * Specifies the browserConnect property: Is browser connect enabled for the lab. + * + * @param browserConnect Is browser connect enabled for the lab. + * @return the next definition stage. + */ + WithCreate withBrowserConnect(EnableStatus browserConnect); + } + /** The stage of the Lab definition allowing to specify disableAutoUpgradeCseMinorVersion. */ + interface WithDisableAutoUpgradeCseMinorVersion { + /** + * Specifies the disableAutoUpgradeCseMinorVersion property: Is auto upgrade of CSE disabled for the lab?. + * + * @param disableAutoUpgradeCseMinorVersion Is auto upgrade of CSE disabled for the lab?. + * @return the next definition stage. + */ + WithCreate withDisableAutoUpgradeCseMinorVersion(Boolean disableAutoUpgradeCseMinorVersion); + } + /** The stage of the Lab definition allowing to specify managementIdentities. */ + interface WithManagementIdentities { + /** + * Specifies the managementIdentities property: List of identities which can be used for management of + * resources.. + * + * @param managementIdentities List of identities which can be used for management of resources. + * @return the next definition stage. + */ + WithCreate withManagementIdentities(Map managementIdentities); + } + /** The stage of the Lab definition allowing to specify isolateLabResources. */ + interface WithIsolateLabResources { + /** + * Specifies the isolateLabResources property: Indicates whether to create Lab resources (e.g. Storage + * accounts and Key Vaults) in network isolation.. + * + * @param isolateLabResources Indicates whether to create Lab resources (e.g. Storage accounts and Key + * Vaults) in network isolation. + * @return the next definition stage. + */ + WithCreate withIsolateLabResources(EnableStatus isolateLabResources); + } + /** The stage of the Lab definition allowing to specify defaultSecretName. */ + interface WithDefaultSecretName { + /** + * Specifies the defaultSecretName property: Default secret for creating virtual machines.. + * + * @param defaultSecretName Default secret for creating virtual machines. + * @return the next definition stage. + */ + WithCreate withDefaultSecretName(String defaultSecretName); + } + /** The stage of the Lab definition allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: The plain text title for the lab announcement. + * + * @param title The plain text title for the lab announcement. + * @return the next definition stage. + */ + WithCreate withTitle(String title); + } + /** The stage of the Lab definition allowing to specify markdown. */ + interface WithMarkdown { + /** + * Specifies the markdown property: The markdown text (if any) that this lab displays in the UI. If left + * empty/null, nothing will be shown.. + * + * @param markdown The markdown text (if any) that this lab displays in the UI. If left empty/null, nothing + * will be shown. + * @return the next definition stage. + */ + WithCreate withMarkdown(String markdown); + } + /** The stage of the Lab definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Is the lab announcement active/enabled at this time?. + * + * @param enabled Is the lab announcement active/enabled at this time?. + * @return the next definition stage. + */ + WithCreate withEnabled(EnableStatus enabled); + } + /** The stage of the Lab definition allowing to specify expirationDate. */ + interface WithExpirationDate { + /** + * Specifies the expirationDate property: The time at which the announcement expires (null for never). + * + * @param expirationDate The time at which the announcement expires (null for never). + * @return the next definition stage. + */ + WithCreate withExpirationDate(OffsetDateTime expirationDate); + } + /** The stage of the Lab definition allowing to specify expired. */ + interface WithExpired { + /** + * Specifies the expired property: Has this announcement expired?. + * + * @param expired Has this announcement expired?. + * @return the next definition stage. + */ + WithCreate withExpired(Boolean expired); + } + /** The stage of the Lab definition allowing to specify diskEncryptionSetId. */ + interface WithDiskEncryptionSetId { + /** + * Specifies the diskEncryptionSetId property: Gets or sets resourceId of the disk encryption set to use for + * enabling encryption at rest.. + * + * @param diskEncryptionSetId Gets or sets resourceId of the disk encryption set to use for enabling + * encryption at rest. + * @return the next definition stage. + */ + WithCreate withDiskEncryptionSetId(String diskEncryptionSetId); + } + /** The stage of the Lab definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Gets or sets the type of key used to encrypt the data of the + * disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * + * @param typePropertiesType Gets or sets the type of key used to encrypt the data of the disk. Possible + * values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey'. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(EncryptionType typePropertiesType); + } + /** The stage of the Lab definition allowing to specify typeIdentityType. */ + interface WithTypeIdentityType { + /** + * Specifies the typeIdentityType property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @param typeIdentityType Type of identity (SystemAssigned, UserAssigned, None). + * @return the next definition stage. + */ + WithCreate withTypeIdentityType(ManagedIdentityType typeIdentityType); + } + /** The stage of the Lab definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal id of resource identity.. + * + * @param principalId The principal id of resource identity. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + /** The stage of the Lab definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant identifier of resource.. + * + * @param tenantId The tenant identifier of resource. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the Lab definition allowing to specify clientSecretUrl. */ + interface WithClientSecretUrl { + /** + * Specifies the clientSecretUrl property: The client secret URL of the identity.. + * + * @param clientSecretUrl The client secret URL of the identity. + * @return the next definition stage. + */ + WithCreate withClientSecretUrl(String clientSecretUrl); + } + /** The stage of the Lab definition allowing to specify userAssignedIdentities. */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned + * identities.. + * + * @param userAssignedIdentities If Type is 'UserAssigned': List of user assigned identities. + * @return the next definition stage. + */ + WithCreate withUserAssignedIdentities(Map userAssignedIdentities); + } } /** * Begins update for the Lab resource. @@ -421,9 +756,9 @@ interface UpdateStages { /** The stage of the Lab update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); @@ -470,7 +805,7 @@ interface WithTags { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void createEnvironment(LabVirtualMachineCreationParameter labVirtualMachineCreationParameter); + void createEnvironment(LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter); /** * Create virtual machines in a lab. This operation can take a while to complete. @@ -481,7 +816,26 @@ interface WithTags { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void createEnvironment(LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, Context context); + void createEnvironment(LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context); + + /** + * Ensure the current user has a valid profile in the lab. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void ensureCurrentUserProfile(); + + /** + * Ensure the current user has a valid profile in the lab. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response ensureCurrentUserProfileWithResponse(Context context); /** * Exports the lab resource usage into a storage account This operation can take a while to complete. @@ -523,7 +877,7 @@ interface WithTags { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 body for generating an upload URI. + * @return response body for generating an upload URI along with {@link Response}. */ Response generateUploadUriWithResponse( GenerateUploadUriParameter generateUploadUriParameter, Context context); @@ -556,7 +910,7 @@ Response generateUploadUriWithResponse( * * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listVhds(); @@ -567,7 +921,7 @@ Response generateUploadUriWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listVhds(Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java index 09637436bb99..db931068373c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCost.java @@ -4,12 +4,11 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner; import java.time.OffsetDateTime; import java.util.List; -import java.util.Map; /** An immutable client-side representation of LabCost. */ public interface LabCost { @@ -35,32 +34,11 @@ public interface LabCost { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the location value. + * @return the systemData value. */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the targetCost property: The target cost properties. - * - * @return the targetCost value. - */ - TargetCostProperties targetCost(); - - /** - * Gets the labCostSummary property: The lab cost summary component of the cost data. - * - * @return the labCostSummary value. - */ - LabCostSummaryProperties labCostSummary(); + SystemData systemData(); /** * Gets the labCostDetails property: The lab cost details component of the cost data. @@ -119,18 +97,53 @@ public interface LabCost { String uniqueIdentifier(); /** - * Gets the region of the resource. + * Gets the status property: Target cost status. + * + * @return the status value. + */ + TargetCostStatus status(); + + /** + * Gets the target property: Lab target cost. * - * @return the region of the resource. + * @return the target value. */ - Region region(); + Integer target(); /** - * Gets the name of the resource region. + * Gets the costThresholds property: Cost thresholds. * - * @return the name of the resource region. + * @return the costThresholds value. */ - String regionName(); + List costThresholds(); + + /** + * Gets the cycleStartDateTime property: Reporting cycle start date. + * + * @return the cycleStartDateTime value. + */ + OffsetDateTime cycleStartDateTime(); + + /** + * Gets the cycleEndDateTime property: Reporting cycle end date. + * + * @return the cycleEndDateTime value. + */ + OffsetDateTime cycleEndDateTime(); + + /** + * Gets the cycleType property: Reporting cycle type. + * + * @return the cycleType value. + */ + ReportingCycleType cycleType(); + + /** + * Gets the estimatedLabCost property: The cost component of the cost item. + * + * @return the estimatedLabCost value. + */ + Double estimatedLabCost(); /** * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner object. @@ -141,33 +154,12 @@ public interface LabCost { /** The entirety of the LabCost definition. */ interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** The LabCost definition stages. */ interface DefinitionStages { /** The first stage of the LabCost definition. */ - interface Blank extends WithLocation { - } - /** The stage of the LabCost definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithParentResource withRegion(String location); + interface Blank extends WithParentResource { } /** The stage of the LabCost definition allowing to specify parent resource. */ interface WithParentResource { @@ -185,12 +177,16 @@ interface WithParentResource { * created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithTargetCost, - DefinitionStages.WithCurrencyCode, + extends DefinitionStages.WithCurrencyCode, DefinitionStages.WithStartDateTime, DefinitionStages.WithEndDateTime, - DefinitionStages.WithCreatedDate { + DefinitionStages.WithCreatedDate, + DefinitionStages.WithStatus, + DefinitionStages.WithTarget, + DefinitionStages.WithCostThresholds, + DefinitionStages.WithCycleStartDateTime, + DefinitionStages.WithCycleEndDateTime, + DefinitionStages.WithCycleType { /** * Executes the create request. * @@ -206,26 +202,6 @@ interface WithCreate */ LabCost create(Context context); } - /** The stage of the LabCost definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the LabCost definition allowing to specify targetCost. */ - interface WithTargetCost { - /** - * Specifies the targetCost property: The target cost properties. - * - * @param targetCost The target cost properties. - * @return the next definition stage. - */ - WithCreate withTargetCost(TargetCostProperties targetCost); - } /** The stage of the LabCost definition allowing to specify currencyCode. */ interface WithCurrencyCode { /** @@ -266,6 +242,66 @@ interface WithCreatedDate { */ WithCreate withCreatedDate(OffsetDateTime createdDate); } + /** The stage of the LabCost definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Target cost status. + * + * @param status Target cost status. + * @return the next definition stage. + */ + WithCreate withStatus(TargetCostStatus status); + } + /** The stage of the LabCost definition allowing to specify target. */ + interface WithTarget { + /** + * Specifies the target property: Lab target cost. + * + * @param target Lab target cost. + * @return the next definition stage. + */ + WithCreate withTarget(Integer target); + } + /** The stage of the LabCost definition allowing to specify costThresholds. */ + interface WithCostThresholds { + /** + * Specifies the costThresholds property: Cost thresholds.. + * + * @param costThresholds Cost thresholds. + * @return the next definition stage. + */ + WithCreate withCostThresholds(List costThresholds); + } + /** The stage of the LabCost definition allowing to specify cycleStartDateTime. */ + interface WithCycleStartDateTime { + /** + * Specifies the cycleStartDateTime property: Reporting cycle start date.. + * + * @param cycleStartDateTime Reporting cycle start date. + * @return the next definition stage. + */ + WithCreate withCycleStartDateTime(OffsetDateTime cycleStartDateTime); + } + /** The stage of the LabCost definition allowing to specify cycleEndDateTime. */ + interface WithCycleEndDateTime { + /** + * Specifies the cycleEndDateTime property: Reporting cycle end date.. + * + * @param cycleEndDateTime Reporting cycle end date. + * @return the next definition stage. + */ + WithCreate withCycleEndDateTime(OffsetDateTime cycleEndDateTime); + } + /** The stage of the LabCost definition allowing to specify cycleType. */ + interface WithCycleType { + /** + * Specifies the cycleType property: Reporting cycle type.. + * + * @param cycleType Reporting cycle type. + * @return the next definition stage. + */ + WithCreate withCycleType(ReportingCycleType cycleType); + } } /** * Begins update for the LabCost resource. @@ -276,12 +312,16 @@ interface WithCreatedDate { /** The template for LabCost update. */ interface Update - extends UpdateStages.WithTags, - UpdateStages.WithTargetCost, - UpdateStages.WithCurrencyCode, + extends UpdateStages.WithCurrencyCode, UpdateStages.WithStartDateTime, UpdateStages.WithEndDateTime, - UpdateStages.WithCreatedDate { + UpdateStages.WithCreatedDate, + UpdateStages.WithStatus, + UpdateStages.WithTarget, + UpdateStages.WithCostThresholds, + UpdateStages.WithCycleStartDateTime, + UpdateStages.WithCycleEndDateTime, + UpdateStages.WithCycleType { /** * Executes the update request. * @@ -299,26 +339,6 @@ interface Update } /** The LabCost update stages. */ interface UpdateStages { - /** The stage of the LabCost update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the LabCost update allowing to specify targetCost. */ - interface WithTargetCost { - /** - * Specifies the targetCost property: The target cost properties. - * - * @param targetCost The target cost properties. - * @return the next definition stage. - */ - Update withTargetCost(TargetCostProperties targetCost); - } /** The stage of the LabCost update allowing to specify currencyCode. */ interface WithCurrencyCode { /** @@ -359,6 +379,66 @@ interface WithCreatedDate { */ Update withCreatedDate(OffsetDateTime createdDate); } + /** The stage of the LabCost update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Target cost status. + * + * @param status Target cost status. + * @return the next definition stage. + */ + Update withStatus(TargetCostStatus status); + } + /** The stage of the LabCost update allowing to specify target. */ + interface WithTarget { + /** + * Specifies the target property: Lab target cost. + * + * @param target Lab target cost. + * @return the next definition stage. + */ + Update withTarget(Integer target); + } + /** The stage of the LabCost update allowing to specify costThresholds. */ + interface WithCostThresholds { + /** + * Specifies the costThresholds property: Cost thresholds.. + * + * @param costThresholds Cost thresholds. + * @return the next definition stage. + */ + Update withCostThresholds(List costThresholds); + } + /** The stage of the LabCost update allowing to specify cycleStartDateTime. */ + interface WithCycleStartDateTime { + /** + * Specifies the cycleStartDateTime property: Reporting cycle start date.. + * + * @param cycleStartDateTime Reporting cycle start date. + * @return the next definition stage. + */ + Update withCycleStartDateTime(OffsetDateTime cycleStartDateTime); + } + /** The stage of the LabCost update allowing to specify cycleEndDateTime. */ + interface WithCycleEndDateTime { + /** + * Specifies the cycleEndDateTime property: Reporting cycle end date.. + * + * @param cycleEndDateTime Reporting cycle end date. + * @return the next definition stage. + */ + Update withCycleEndDateTime(OffsetDateTime cycleEndDateTime); + } + /** The stage of the LabCost update allowing to specify cycleType. */ + interface WithCycleType { + /** + * Specifies the cycleType property: Reporting cycle type.. + * + * @param cycleType Reporting cycle type. + * @return the next definition stage. + */ + Update withCycleType(ReportingCycleType cycleType); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostList.java new file mode 100644 index 000000000000..6e19c2c46e80 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabCostList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabCostInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains a list of costs and their properties. */ +@Fluent +public final class LabCostList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabCostList.class); + + /* + * List of costs and their properties + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of costs and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the LabCostList object itself. + */ + public LabCostList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java index 18296f1d5f5f..015a05585cad 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A lab. */ -@Immutable -public final class LabFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class LabFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabList.java index be5a252f099d..2acf57988e7a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of labs and their properties. */ @Fluent public final class LabList { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabList.class); /* - * Results of the list operation. + * List of labs and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of labs and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the LabList object itself. - */ - public LabList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the LabList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecret.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecret.java new file mode 100644 index 000000000000..a65590e1360c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecret.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabSecretInner; +import java.util.Map; + +/** An immutable client-side representation of LabSecret. */ +public interface LabSecret { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the value property: The value of the secret for secret creation. + * + * @return the value value. + */ + String value(); + + /** + * Gets the keyVaultEntry property: The name of the entry in the lab KeyVault. + * + * @return the keyVaultEntry value. + */ + String keyVaultEntry(); + + /** + * Gets the enabledForArtifacts property: Is the secret enabled for use with artifacts?. + * + * @return the enabledForArtifacts value. + */ + Boolean enabledForArtifacts(); + + /** + * Gets the enabledForVmCreation property: Is the secret enabled for use with creation of VMs?. + * + * @return the enabledForVmCreation value. + */ + Boolean enabledForVmCreation(); + + /** + * Gets the enabledForArmEnvironments property: Is the secret enabled for use with ARM environments?. + * + * @return the enabledForArmEnvironments value. + */ + Boolean enabledForArmEnvironments(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.LabSecretInner object. + * + * @return the inner object. + */ + LabSecretInner innerModel(); + + /** The entirety of the LabSecret definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The LabSecret definition stages. */ + interface DefinitionStages { + /** The first stage of the LabSecret definition. */ + interface Blank extends WithLocation { + } + /** The stage of the LabSecret definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the LabSecret definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, labName. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @return the next definition stage. + */ + WithCreate withExistingLab(String resourceGroupName, String labName); + } + /** + * The stage of the LabSecret definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithValue, + DefinitionStages.WithEnabledForArtifacts, + DefinitionStages.WithEnabledForVmCreation, + DefinitionStages.WithEnabledForArmEnvironments { + /** + * Executes the create request. + * + * @return the created resource. + */ + LabSecret create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LabSecret create(Context context); + } + /** The stage of the LabSecret definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the LabSecret definition allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: The value of the secret for secret creation.. + * + * @param value The value of the secret for secret creation. + * @return the next definition stage. + */ + WithCreate withValue(String value); + } + /** The stage of the LabSecret definition allowing to specify enabledForArtifacts. */ + interface WithEnabledForArtifacts { + /** + * Specifies the enabledForArtifacts property: Is the secret enabled for use with artifacts?. + * + * @param enabledForArtifacts Is the secret enabled for use with artifacts?. + * @return the next definition stage. + */ + WithCreate withEnabledForArtifacts(Boolean enabledForArtifacts); + } + /** The stage of the LabSecret definition allowing to specify enabledForVmCreation. */ + interface WithEnabledForVmCreation { + /** + * Specifies the enabledForVmCreation property: Is the secret enabled for use with creation of VMs?. + * + * @param enabledForVmCreation Is the secret enabled for use with creation of VMs?. + * @return the next definition stage. + */ + WithCreate withEnabledForVmCreation(Boolean enabledForVmCreation); + } + /** The stage of the LabSecret definition allowing to specify enabledForArmEnvironments. */ + interface WithEnabledForArmEnvironments { + /** + * Specifies the enabledForArmEnvironments property: Is the secret enabled for use with ARM environments?. + * + * @param enabledForArmEnvironments Is the secret enabled for use with ARM environments?. + * @return the next definition stage. + */ + WithCreate withEnabledForArmEnvironments(Boolean enabledForArmEnvironments); + } + } + /** + * Begins update for the LabSecret resource. + * + * @return the stage of resource update. + */ + LabSecret.Update update(); + + /** The template for LabSecret update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LabSecret apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LabSecret apply(Context context); + } + /** The LabSecret update stages. */ + interface UpdateStages { + /** The stage of the LabSecret update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LabSecret refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LabSecret refresh(Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecretFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecretFragment.java new file mode 100644 index 000000000000..824cb5b5ec63 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecretFragment.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Patch. */ +@Fluent +public final class LabSecretFragment extends Tags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabSecretFragment.class); + + /** {@inheritDoc} */ + @Override + public LabSecretFragment withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecretList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecretList.java new file mode 100644 index 000000000000..ec393ce91e9d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecretList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabSecretInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains a list of secrets and their properties. */ +@Fluent +public final class LabSecretList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabSecretList.class); + + /* + * List of secrets and their properties + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of secrets and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the LabSecretList object itself. + */ + public LabSecretList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecrets.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecrets.java new file mode 100644 index 000000000000..c70fd9bcd7e1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabSecrets.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LabSecrets. */ +public interface LabSecrets { + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List lab secrets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret. + */ + LabSecret get(String resourceGroupName, String labName, String name); + + /** + * Get lab secret. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String labName, String name); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the lab secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String labName, String name, Context context); + + /** + * Get lab secret. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret along with {@link Response}. + */ + LabSecret getById(String id); + + /** + * Get lab secret. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lab secret along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete lab secret. This operation can take a while to complete. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LabSecret resource. + * + * @param name resource name. + * @return the first stage of the new LabSecret definition. + */ + LabSecret.DefinitionStages.Blank define(String name); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhdList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhdList.java index c56180269280..fa3567402017 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhdList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVhdList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of Lab Vhd and their properties. */ @Fluent public final class LabVhdList { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVhdList.class); /* - * Results of the list operation. + * List of Lab Vhd and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of Lab Vhd and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the LabVhdList object itself. - */ - public LabVhdList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the LabVhdList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachine.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachine.java index b98618489a9f..b8637c0fcd0f 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachine.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachine.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineInner; import java.time.OffsetDateTime; @@ -49,6 +50,13 @@ public interface LabVirtualMachine { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the notes property: The notes of the virtual machine. * @@ -105,6 +113,29 @@ public interface LabVirtualMachine { */ String customImageId(); + /** + * Gets the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + String galleryImageVersionId(); + + /** + * Gets the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + String sharedImageId(); + + /** + * Gets the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + String sharedImageVersion(); + /** * Gets the osType property: The OS type of the virtual machine. * @@ -184,20 +215,6 @@ public interface LabVirtualMachine { */ List artifacts(); - /** - * Gets the artifactDeploymentStatus property: The artifact deployment status for the virtual machine. - * - * @return the artifactDeploymentStatus value. - */ - ArtifactDeploymentStatusProperties artifactDeploymentStatus(); - - /** - * Gets the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. - * - * @return the galleryImageReference value. - */ - GalleryImageReference galleryImageReference(); - /** * Gets the planId property: The id of the plan associated with the virtual machine image. * @@ -206,25 +223,12 @@ public interface LabVirtualMachine { String planId(); /** - * Gets the computeVm property: The compute virtual machine properties. - * - * @return the computeVm value. - */ - ComputeVmProperties computeVm(); - - /** - * Gets the networkInterface property: The network interface properties. - * - * @return the networkInterface value. - */ - NetworkInterfaceProperties networkInterface(); - - /** - * Gets the applicableSchedule property: The applicable schedule for the virtual machine. + * Gets the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used + * to overwrite the size of the disk in a virtual machine image. * - * @return the applicableSchedule value. + * @return the osDiskSizeGb value. */ - ApplicableSchedule applicableSchedule(); + Integer osDiskSizeGb(); /** * Gets the expirationDate property: The expiration date for VM. @@ -241,11 +245,11 @@ public interface LabVirtualMachine { Boolean allowClaim(); /** - * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). * * @return the storageType value. */ - String storageType(); + StorageTypes storageType(); /** * Gets the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property @@ -283,6 +287,14 @@ public interface LabVirtualMachine { */ String lastKnownPowerState(); + /** + * Gets the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. + * + * @return the canApplyArtifacts value. + */ + Boolean canApplyArtifacts(); + /** * Gets the provisioningState property: The provisioning status of the resource. * @@ -297,6 +309,328 @@ public interface LabVirtualMachine { */ String uniqueIdentifier(); + /** + * Gets the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + String deploymentStatus(); + + /** + * Gets the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + Integer artifactsApplied(); + + /** + * Gets the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + Integer totalArtifacts(); + + /** + * Gets the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + String osTypeGalleryImageReferenceOsType(); + + /** + * Gets the version property: The version of the gallery image. + * + * @return the version value. + */ + String version(); + + /** + * Gets the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + String osTypeComputeVmOsType(); + + /** + * Gets the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + String networkInterfaceId(); + + /** + * Gets the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + String osDiskId(); + + /** + * Gets the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + List dataDiskIds(); + + /** + * Gets the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + List dataDisks(); + + /** + * Gets the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + String virtualNetworkId(); + + /** + * Gets the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + String publicIpAddressId(); + + /** + * Gets the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + String publicIpAddress(); + + /** + * Gets the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + String rdpAuthority(); + + /** + * Gets the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + String sshAuthority(); + + /** + * Gets the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + OffsetDateTime createdDateApplicableScheduleCreatedDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + String provisioningStateApplicableScheduleProvisioningState(); + + /** + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the idPropertiesId property: the fully qualified resource ID for the resource. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the namePropertiesName property: the name of the resource. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the typePropertiesType property: the type of the resource. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the locationPropertiesLocation property: the geo-location where the resource live. + * + * @return the locationPropertiesLocation value. + */ + String locationPropertiesLocation(); + + /** + * Gets the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + Map tagsPropertiesTags(); + /** * Gets the region of the resource. * @@ -370,6 +704,9 @@ interface WithCreate DefinitionStages.WithOwnerUserPrincipalName, DefinitionStages.WithCreatedDate, DefinitionStages.WithCustomImageId, + DefinitionStages.WithGalleryImageVersionId, + DefinitionStages.WithSharedImageId, + DefinitionStages.WithSharedImageVersion, DefinitionStages.WithSize, DefinitionStages.WithUsername, DefinitionStages.WithPassword, @@ -379,15 +716,28 @@ interface WithCreate DefinitionStages.WithLabVirtualNetworkId, DefinitionStages.WithDisallowPublicIpAddress, DefinitionStages.WithArtifacts, - DefinitionStages.WithGalleryImageReference, DefinitionStages.WithPlanId, - DefinitionStages.WithNetworkInterface, + DefinitionStages.WithOsDiskSizeGb, DefinitionStages.WithExpirationDate, DefinitionStages.WithAllowClaim, DefinitionStages.WithStorageType, DefinitionStages.WithEnvironmentId, DefinitionStages.WithDataDiskParameters, - DefinitionStages.WithScheduleParameters { + DefinitionStages.WithScheduleParameters, + DefinitionStages.WithOffer, + DefinitionStages.WithPublisher, + DefinitionStages.WithSku, + DefinitionStages.WithOsTypeGalleryImageReferenceOsType, + DefinitionStages.WithVersion, + DefinitionStages.WithVirtualNetworkId, + DefinitionStages.WithSubnetId, + DefinitionStages.WithPublicIpAddressId, + DefinitionStages.WithPublicIpAddress, + DefinitionStages.WithPrivateIpAddress, + DefinitionStages.WithDnsName, + DefinitionStages.WithRdpAuthority, + DefinitionStages.WithSshAuthority, + DefinitionStages.WithInboundNatRules { /** * Executes the create request. * @@ -463,6 +813,39 @@ interface WithCustomImageId { */ WithCreate withCustomImageId(String customImageId); } + /** The stage of the LabVirtualMachine definition allowing to specify galleryImageVersionId. */ + interface WithGalleryImageVersionId { + /** + * Specifies the galleryImageVersionId property: The shared gallery image version resource identifier of the + * virtual machine.. + * + * @param galleryImageVersionId The shared gallery image version resource identifier of the virtual machine. + * @return the next definition stage. + */ + WithCreate withGalleryImageVersionId(String galleryImageVersionId); + } + /** The stage of the LabVirtualMachine definition allowing to specify sharedImageId. */ + interface WithSharedImageId { + /** + * Specifies the sharedImageId property: The shared image resource identifier of the virtual machine.. + * + * @param sharedImageId The shared image resource identifier of the virtual machine. + * @return the next definition stage. + */ + WithCreate withSharedImageId(String sharedImageId); + } + /** The stage of the LabVirtualMachine definition allowing to specify sharedImageVersion. */ + interface WithSharedImageVersion { + /** + * Specifies the sharedImageVersion property: The shared image version for the specified shared image Id. + * Will use latest if not specified.. + * + * @param sharedImageVersion The shared image version for the specified shared image Id. Will use latest if + * not specified. + * @return the next definition stage. + */ + WithCreate withSharedImageVersion(String sharedImageVersion); + } /** The stage of the LabVirtualMachine definition allowing to specify size. */ interface WithSize { /** @@ -557,17 +940,6 @@ interface WithArtifacts { */ WithCreate withArtifacts(List artifacts); } - /** The stage of the LabVirtualMachine definition allowing to specify galleryImageReference. */ - interface WithGalleryImageReference { - /** - * Specifies the galleryImageReference property: The Microsoft Azure Marketplace image reference of the - * virtual machine.. - * - * @param galleryImageReference The Microsoft Azure Marketplace image reference of the virtual machine. - * @return the next definition stage. - */ - WithCreate withGalleryImageReference(GalleryImageReference galleryImageReference); - } /** The stage of the LabVirtualMachine definition allowing to specify planId. */ interface WithPlanId { /** @@ -578,15 +950,17 @@ interface WithPlanId { */ WithCreate withPlanId(String planId); } - /** The stage of the LabVirtualMachine definition allowing to specify networkInterface. */ - interface WithNetworkInterface { + /** The stage of the LabVirtualMachine definition allowing to specify osDiskSizeGb. */ + interface WithOsDiskSizeGb { /** - * Specifies the networkInterface property: The network interface properties.. + * Specifies the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element + * can be used to overwrite the size of the disk in a virtual machine image.. * - * @param networkInterface The network interface properties. + * @param osDiskSizeGb Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. * @return the next definition stage. */ - WithCreate withNetworkInterface(NetworkInterfaceProperties networkInterface); + WithCreate withOsDiskSizeGb(Integer osDiskSizeGb); } /** The stage of the LabVirtualMachine definition allowing to specify expirationDate. */ interface WithExpirationDate { @@ -612,12 +986,13 @@ interface WithAllowClaim { /** The stage of the LabVirtualMachine definition allowing to specify storageType. */ interface WithStorageType { /** - * Specifies the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium).. + * Specifies the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, + * StandardSSD).. * - * @param storageType Storage type to use for virtual machine (i.e. Standard, Premium). + * @param storageType Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). * @return the next definition stage. */ - WithCreate withStorageType(String storageType); + WithCreate withStorageType(StorageTypes storageType); } /** The stage of the LabVirtualMachine definition allowing to specify environmentId. */ interface WithEnvironmentId { @@ -651,6 +1026,150 @@ interface WithScheduleParameters { */ WithCreate withScheduleParameters(List scheduleParameters); } + /** The stage of the LabVirtualMachine definition allowing to specify offer. */ + interface WithOffer { + /** + * Specifies the offer property: The offer of the gallery image.. + * + * @param offer The offer of the gallery image. + * @return the next definition stage. + */ + WithCreate withOffer(String offer); + } + /** The stage of the LabVirtualMachine definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The publisher of the gallery image.. + * + * @param publisher The publisher of the gallery image. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the LabVirtualMachine definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the gallery image.. + * + * @param sku The SKU of the gallery image. + * @return the next definition stage. + */ + WithCreate withSku(String sku); + } + /** The stage of the LabVirtualMachine definition allowing to specify osTypeGalleryImageReferenceOsType. */ + interface WithOsTypeGalleryImageReferenceOsType { + /** + * Specifies the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image.. + * + * @param osTypeGalleryImageReferenceOsType The OS type of the gallery image. + * @return the next definition stage. + */ + WithCreate withOsTypeGalleryImageReferenceOsType(String osTypeGalleryImageReferenceOsType); + } + /** The stage of the LabVirtualMachine definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: The version of the gallery image.. + * + * @param version The version of the gallery image. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + /** The stage of the LabVirtualMachine definition allowing to specify virtualNetworkId. */ + interface WithVirtualNetworkId { + /** + * Specifies the virtualNetworkId property: The resource ID of the virtual network.. + * + * @param virtualNetworkId The resource ID of the virtual network. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkId(String virtualNetworkId); + } + /** The stage of the LabVirtualMachine definition allowing to specify subnetId. */ + interface WithSubnetId { + /** + * Specifies the subnetId property: The resource ID of the sub net.. + * + * @param subnetId The resource ID of the sub net. + * @return the next definition stage. + */ + WithCreate withSubnetId(String subnetId); + } + /** The stage of the LabVirtualMachine definition allowing to specify publicIpAddressId. */ + interface WithPublicIpAddressId { + /** + * Specifies the publicIpAddressId property: The resource ID of the public IP address.. + * + * @param publicIpAddressId The resource ID of the public IP address. + * @return the next definition stage. + */ + WithCreate withPublicIpAddressId(String publicIpAddressId); + } + /** The stage of the LabVirtualMachine definition allowing to specify publicIpAddress. */ + interface WithPublicIpAddress { + /** + * Specifies the publicIpAddress property: The public IP address.. + * + * @param publicIpAddress The public IP address. + * @return the next definition stage. + */ + WithCreate withPublicIpAddress(String publicIpAddress); + } + /** The stage of the LabVirtualMachine definition allowing to specify privateIpAddress. */ + interface WithPrivateIpAddress { + /** + * Specifies the privateIpAddress property: The private IP address.. + * + * @param privateIpAddress The private IP address. + * @return the next definition stage. + */ + WithCreate withPrivateIpAddress(String privateIpAddress); + } + /** The stage of the LabVirtualMachine definition allowing to specify dnsName. */ + interface WithDnsName { + /** + * Specifies the dnsName property: The DNS name.. + * + * @param dnsName The DNS name. + * @return the next definition stage. + */ + WithCreate withDnsName(String dnsName); + } + /** The stage of the LabVirtualMachine definition allowing to specify rdpAuthority. */ + interface WithRdpAuthority { + /** + * Specifies the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address + * followed by the service port number for RDP (Remote Desktop Protocol).. + * + * @param rdpAuthority The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * @return the next definition stage. + */ + WithCreate withRdpAuthority(String rdpAuthority); + } + /** The stage of the LabVirtualMachine definition allowing to specify sshAuthority. */ + interface WithSshAuthority { + /** + * Specifies the sshAuthority property: The SshAuthority property is a server DNS host name or IP address + * followed by the service port number for SSH.. + * + * @param sshAuthority The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * @return the next definition stage. + */ + WithCreate withSshAuthority(String sshAuthority); + } + /** The stage of the LabVirtualMachine definition allowing to specify inboundNatRules. */ + interface WithInboundNatRules { + /** + * Specifies the inboundNatRules property: The incoming NAT rules. + * + * @param inboundNatRules The incoming NAT rules. + * @return the next definition stage. + */ + WithCreate withInboundNatRules(List inboundNatRules); + } } /** * Begins update for the LabVirtualMachine resource. @@ -681,9 +1200,9 @@ interface UpdateStages { /** The stage of the LabVirtualMachine update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); @@ -764,6 +1283,25 @@ interface WithTags { */ void claim(Context context); + /** + * Clears the artifact results of the virtual machine. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void clearArtifactResults(); + + /** + * Clears the artifact results of the virtual machine. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response clearArtifactResultsWithResponse(Context context); + /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * @@ -801,7 +1339,8 @@ interface WithTags { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 string that represents the contents of the RDP file for the virtual machine. + * @return a string that represents the contents of the RDP file for the virtual machine along with {@link + * Response}. */ Response getRdpFileContentsWithResponse(Context context); @@ -821,7 +1360,7 @@ interface WithTags { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ Response listApplicableSchedulesWithResponse(Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java index d4954b1acd96..6870ae73fda2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameter.java @@ -4,756 +4,628 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -/** Properties for creating a virtual machine. */ -@JsonFlatten -@Fluent -public class LabVirtualMachineCreationParameter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineCreationParameter.class); +/** An immutable client-side representation of LabVirtualMachineCreationParameter. */ +public interface LabVirtualMachineCreationParameter { + /** + * Gets the name property: The name of the virtual machine or environment. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: The location of the new virtual machine or environment. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: The tags of the resource. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + String ownerObjectId(); - /* - * The name of the virtual machine or environment + /** + * Gets the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + String ownerUserPrincipalName(); + + /** + * Gets the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. */ - @JsonProperty(value = "name") - private String name; + String createdByUserId(); - /* - * The location of the new virtual machine or environment + /** + * Gets the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. */ - @JsonProperty(value = "location") - private String location; + String createdByUser(); - /* - * The tags of the resource. + /** + * Gets the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. */ - @JsonProperty(value = "tags") - private Map tags; + OffsetDateTime createdDate(); - /* - * The number of virtual machine instances to create. + /** + * Gets the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. */ - @JsonProperty(value = "properties.bulkCreationParameters") - private BulkCreationParameters bulkCreationParameters; + String computeId(); - /* - * The notes of the virtual machine. + /** + * Gets the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. */ - @JsonProperty(value = "properties.notes") - private String notes; + String customImageId(); - /* - * The object identifier of the owner of the virtual machine. + /** + * Gets the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. */ - @JsonProperty(value = "properties.ownerObjectId") - private String ownerObjectId; + String galleryImageVersionId(); - /* - * The user principal name of the virtual machine owner. + /** + * Gets the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. */ - @JsonProperty(value = "properties.ownerUserPrincipalName") - private String ownerUserPrincipalName; + String sharedImageId(); - /* - * The creation date of the virtual machine. + /** + * Gets the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. */ - @JsonProperty(value = "properties.createdDate") - private OffsetDateTime createdDate; + String sharedImageVersion(); - /* - * The custom image identifier of the virtual machine. + /** + * Gets the osType property: The OS type of the virtual machine. + * + * @return the osType value. */ - @JsonProperty(value = "properties.customImageId") - private String customImageId; + String osType(); - /* - * The size of the virtual machine. + /** + * Gets the size property: The size of the virtual machine. + * + * @return the size value. */ - @JsonProperty(value = "properties.size") - private String size; + String size(); - /* - * The user name of the virtual machine. + /** + * Gets the username property: The user name of the virtual machine. + * + * @return the username value. */ - @JsonProperty(value = "properties.userName") - private String username; + String username(); - /* - * The password of the virtual machine administrator. + /** + * Gets the password property: The password of the virtual machine administrator. + * + * @return the password value. */ - @JsonProperty(value = "properties.password") - private String password; + String password(); - /* - * The SSH key of the virtual machine administrator. + /** + * Gets the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. */ - @JsonProperty(value = "properties.sshKey") - private String sshKey; + String sshKey(); - /* - * Indicates whether this virtual machine uses an SSH key for + /** + * Gets the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for * authentication. + * + * @return the isAuthenticationWithSshKey value. */ - @JsonProperty(value = "properties.isAuthenticationWithSshKey") - private Boolean isAuthenticationWithSshKey; + Boolean isAuthenticationWithSshKey(); - /* - * The lab subnet name of the virtual machine. + /** + * Gets the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. */ - @JsonProperty(value = "properties.labSubnetName") - private String labSubnetName; + String fqdn(); - /* - * The lab virtual network identifier of the virtual machine. + /** + * Gets the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. */ - @JsonProperty(value = "properties.labVirtualNetworkId") - private String labVirtualNetworkId; + String labSubnetName(); - /* - * Indicates whether the virtual machine is to be created without a public - * IP address. + /** + * Gets the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. */ - @JsonProperty(value = "properties.disallowPublicIpAddress") - private Boolean disallowPublicIpAddress; + String labVirtualNetworkId(); - /* - * The artifacts to be installed on the virtual machine. + /** + * Gets the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a + * public IP address. + * + * @return the disallowPublicIpAddress value. */ - @JsonProperty(value = "properties.artifacts") - private List artifacts; + Boolean disallowPublicIpAddress(); - /* - * The Microsoft Azure Marketplace image reference of the virtual machine. + /** + * Gets the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. */ - @JsonProperty(value = "properties.galleryImageReference") - private GalleryImageReference galleryImageReference; + List artifacts(); - /* - * The id of the plan associated with the virtual machine image + /** + * Gets the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. */ - @JsonProperty(value = "properties.planId") - private String planId; + String planId(); - /* - * The network interface properties. + /** + * Gets the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used + * to overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. */ - @JsonProperty(value = "properties.networkInterface") - private NetworkInterfaceProperties networkInterface; + Integer osDiskSizeGb(); - /* - * The expiration date for VM. + /** + * Gets the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. */ - @JsonProperty(value = "properties.expirationDate") - private OffsetDateTime expirationDate; + OffsetDateTime expirationDate(); - /* - * Indicates whether another user can take ownership of the virtual machine + /** + * Gets the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. */ - @JsonProperty(value = "properties.allowClaim") - private Boolean allowClaim; + Boolean allowClaim(); - /* - * Storage type to use for virtual machine (i.e. Standard, Premium). + /** + * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. */ - @JsonProperty(value = "properties.storageType") - private String storageType; + StorageType storageType(); - /* - * The resource ID of the environment that contains this virtual machine, - * if any. + /** + * Gets the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. */ - @JsonProperty(value = "properties.environmentId") - private String environmentId; + VirtualMachineCreationSource virtualMachineCreationSource(); - /* - * New or existing data disks to attach to the virtual machine after - * creation + /** + * Gets the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. */ - @JsonProperty(value = "properties.dataDiskParameters") - private List dataDiskParameters; + String environmentId(); - /* - * Virtual Machine schedules to be created + /** + * Gets the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. */ - @JsonProperty(value = "properties.scheduleParameters") - private List scheduleParameters; + List dataDiskParameters(); /** - * Get the name property: The name of the virtual machine or environment. + * Gets the scheduleParameters property: Virtual Machine schedules to be created. * - * @return the name value. + * @return the scheduleParameters value. */ - public String name() { - return this.name; - } + List scheduleParameters(); /** - * Set the name property: The name of the virtual machine or environment. + * Gets the lastKnownPowerState property: Last known compute power state captured in DTL. * - * @param name the name value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the lastKnownPowerState value. */ - public LabVirtualMachineCreationParameter withName(String name) { - this.name = name; - return this; - } + String lastKnownPowerState(); /** - * Get the location property: The location of the new virtual machine or environment. + * Gets the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. * - * @return the location value. + * @return the canApplyArtifacts value. */ - public String location() { - return this.location; - } + Boolean canApplyArtifacts(); /** - * Set the location property: The location of the new virtual machine or environment. + * Gets the provisioningState property: The provisioning status of the resource. * - * @param location the location value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the provisioningState value. */ - public LabVirtualMachineCreationParameter withLocation(String location) { - this.location = location; - return this; - } + String provisioningState(); /** - * Get the tags property: The tags of the resource. + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). * - * @return the tags value. + * @return the uniqueIdentifier value. */ - public Map tags() { - return this.tags; - } + String uniqueIdentifier(); /** - * Set the tags property: The tags of the resource. + * Gets the instanceCount property: The number of virtual machine instances to create. * - * @param tags the tags value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the instanceCount value. */ - public LabVirtualMachineCreationParameter withTags(Map tags) { - this.tags = tags; - return this; - } + Integer instanceCount(); /** - * Get the bulkCreationParameters property: The number of virtual machine instances to create. + * Gets the deploymentStatus property: The deployment status of the artifact. * - * @return the bulkCreationParameters value. + * @return the deploymentStatus value. */ - public BulkCreationParameters bulkCreationParameters() { - return this.bulkCreationParameters; - } + String deploymentStatus(); /** - * Set the bulkCreationParameters property: The number of virtual machine instances to create. + * Gets the artifactsApplied property: The total count of the artifacts that were successfully applied. * - * @param bulkCreationParameters the bulkCreationParameters value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the artifactsApplied value. */ - public LabVirtualMachineCreationParameter withBulkCreationParameters( - BulkCreationParameters bulkCreationParameters) { - this.bulkCreationParameters = bulkCreationParameters; - return this; - } + Integer artifactsApplied(); /** - * Get the notes property: The notes of the virtual machine. + * Gets the totalArtifacts property: The total count of the artifacts that were tentatively applied. * - * @return the notes value. + * @return the totalArtifacts value. */ - public String notes() { - return this.notes; - } + Integer totalArtifacts(); /** - * Set the notes property: The notes of the virtual machine. + * Gets the offer property: The offer of the gallery image. * - * @param notes the notes value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the offer value. */ - public LabVirtualMachineCreationParameter withNotes(String notes) { - this.notes = notes; - return this; - } + String offer(); /** - * Get the ownerObjectId property: The object identifier of the owner of the virtual machine. + * Gets the publisher property: The publisher of the gallery image. * - * @return the ownerObjectId value. + * @return the publisher value. */ - public String ownerObjectId() { - return this.ownerObjectId; - } + String publisher(); /** - * Set the ownerObjectId property: The object identifier of the owner of the virtual machine. + * Gets the sku property: The SKU of the gallery image. * - * @param ownerObjectId the ownerObjectId value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the sku value. */ - public LabVirtualMachineCreationParameter withOwnerObjectId(String ownerObjectId) { - this.ownerObjectId = ownerObjectId; - return this; - } + String sku(); /** - * Get the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * Gets the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. * - * @return the ownerUserPrincipalName value. + * @return the osTypeGalleryImageReferenceOsType value. */ - public String ownerUserPrincipalName() { - return this.ownerUserPrincipalName; - } + String osTypeGalleryImageReferenceOsType(); /** - * Set the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * Gets the version property: The version of the gallery image. * - * @param ownerUserPrincipalName the ownerUserPrincipalName value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the version value. */ - public LabVirtualMachineCreationParameter withOwnerUserPrincipalName(String ownerUserPrincipalName) { - this.ownerUserPrincipalName = ownerUserPrincipalName; - return this; - } + String version(); /** - * Get the createdDate property: The creation date of the virtual machine. + * Gets the statuses property: Gets the statuses of the virtual machine. * - * @return the createdDate value. + * @return the statuses value. */ - public OffsetDateTime createdDate() { - return this.createdDate; - } + List statuses(); /** - * Set the createdDate property: The creation date of the virtual machine. + * Gets the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. * - * @param createdDate the createdDate value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the osTypeComputeVmOsType value. */ - public LabVirtualMachineCreationParameter withCreatedDate(OffsetDateTime createdDate) { - this.createdDate = createdDate; - return this; - } + String osTypeComputeVmOsType(); /** - * Get the customImageId property: The custom image identifier of the virtual machine. + * Gets the vmSize property: Gets the size of the virtual machine. * - * @return the customImageId value. + * @return the vmSize value. */ - public String customImageId() { - return this.customImageId; - } + String vmSize(); /** - * Set the customImageId property: The custom image identifier of the virtual machine. + * Gets the networkInterfaceId property: Gets the network interface ID of the virtual machine. * - * @param customImageId the customImageId value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the networkInterfaceId value. */ - public LabVirtualMachineCreationParameter withCustomImageId(String customImageId) { - this.customImageId = customImageId; - return this; - } + String networkInterfaceId(); /** - * Get the size property: The size of the virtual machine. + * Gets the osDiskId property: Gets OS disk blob uri for the virtual machine. * - * @return the size value. + * @return the osDiskId value. */ - public String size() { - return this.size; - } + String osDiskId(); /** - * Set the size property: The size of the virtual machine. + * Gets the dataDiskIds property: Gets data disks blob uri for the virtual machine. * - * @param size the size value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the dataDiskIds value. */ - public LabVirtualMachineCreationParameter withSize(String size) { - this.size = size; - return this; - } + List dataDiskIds(); /** - * Get the username property: The user name of the virtual machine. + * Gets the dataDisks property: Gets all data disks attached to the virtual machine. * - * @return the username value. + * @return the dataDisks value. */ - public String username() { - return this.username; - } + List dataDisks(); /** - * Set the username property: The user name of the virtual machine. + * Gets the virtualNetworkId property: The resource ID of the virtual network. * - * @param username the username value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the virtualNetworkId value. */ - public LabVirtualMachineCreationParameter withUsername(String username) { - this.username = username; - return this; - } + String virtualNetworkId(); /** - * Get the password property: The password of the virtual machine administrator. + * Gets the subnetId property: The resource ID of the sub net. * - * @return the password value. + * @return the subnetId value. */ - public String password() { - return this.password; - } + String subnetId(); /** - * Set the password property: The password of the virtual machine administrator. + * Gets the publicIpAddressId property: The resource ID of the public IP address. * - * @param password the password value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the publicIpAddressId value. */ - public LabVirtualMachineCreationParameter withPassword(String password) { - this.password = password; - return this; - } + String publicIpAddressId(); /** - * Get the sshKey property: The SSH key of the virtual machine administrator. + * Gets the publicIpAddress property: The public IP address. * - * @return the sshKey value. + * @return the publicIpAddress value. */ - public String sshKey() { - return this.sshKey; - } + String publicIpAddress(); /** - * Set the sshKey property: The SSH key of the virtual machine administrator. + * Gets the privateIpAddress property: The private IP address. * - * @param sshKey the sshKey value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the privateIpAddress value. */ - public LabVirtualMachineCreationParameter withSshKey(String sshKey) { - this.sshKey = sshKey; - return this; - } + String privateIpAddress(); /** - * Get the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for - * authentication. + * Gets the dnsName property: The DNS name. * - * @return the isAuthenticationWithSshKey value. + * @return the dnsName value. */ - public Boolean isAuthenticationWithSshKey() { - return this.isAuthenticationWithSshKey; - } + String dnsName(); /** - * Set the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for - * authentication. + * Gets the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). * - * @param isAuthenticationWithSshKey the isAuthenticationWithSshKey value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the rdpAuthority value. */ - public LabVirtualMachineCreationParameter withIsAuthenticationWithSshKey(Boolean isAuthenticationWithSshKey) { - this.isAuthenticationWithSshKey = isAuthenticationWithSshKey; - return this; - } + String rdpAuthority(); /** - * Get the labSubnetName property: The lab subnet name of the virtual machine. + * Gets the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. * - * @return the labSubnetName value. + * @return the sshAuthority value. */ - public String labSubnetName() { - return this.labSubnetName; - } + String sshAuthority(); /** - * Set the labSubnetName property: The lab subnet name of the virtual machine. + * Gets the inboundNatRules property: The incoming NAT rules. * - * @param labSubnetName the labSubnetName value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the inboundNatRules value. */ - public LabVirtualMachineCreationParameter withLabSubnetName(String labSubnetName) { - this.labSubnetName = labSubnetName; - return this; - } + List inboundNatRules(); /** - * Get the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the labVirtualNetworkId value. + * @return the systemData value. */ - public String labVirtualNetworkId() { - return this.labVirtualNetworkId; - } + SystemData systemData(); /** - * Set the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. * - * @param labVirtualNetworkId the labVirtualNetworkId value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the systemDataPropertiesSystemData value. */ - public LabVirtualMachineCreationParameter withLabVirtualNetworkId(String labVirtualNetworkId) { - this.labVirtualNetworkId = labVirtualNetworkId; - return this; - } + SystemData systemDataPropertiesSystemData(); /** - * Get the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public - * IP address. + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). * - * @return the disallowPublicIpAddress value. + * @return the status value. */ - public Boolean disallowPublicIpAddress() { - return this.disallowPublicIpAddress; - } + EnableStatus status(); /** - * Set the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a public - * IP address. + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). * - * @param disallowPublicIpAddress the disallowPublicIpAddress value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the taskType value. */ - public LabVirtualMachineCreationParameter withDisallowPublicIpAddress(Boolean disallowPublicIpAddress) { - this.disallowPublicIpAddress = disallowPublicIpAddress; - return this; - } + String taskType(); /** - * Get the artifacts property: The artifacts to be installed on the virtual machine. + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). * - * @return the artifacts value. + * @return the timeZoneId value. */ - public List artifacts() { - return this.artifacts; - } + String timeZoneId(); /** - * Set the artifacts property: The artifacts to be installed on the virtual machine. + * Gets the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. * - * @param artifacts the artifacts value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the createdDateApplicableScheduleCreatedDate value. */ - public LabVirtualMachineCreationParameter withArtifacts(List artifacts) { - this.artifacts = artifacts; - return this; - } + OffsetDateTime createdDateApplicableScheduleCreatedDate(); /** - * Get the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. + * Gets the targetResourceId property: The resource ID to which the schedule belongs. * - * @return the galleryImageReference value. + * @return the targetResourceId value. */ - public GalleryImageReference galleryImageReference() { - return this.galleryImageReference; - } + String targetResourceId(); /** - * Set the galleryImageReference property: The Microsoft Azure Marketplace image reference of the virtual machine. + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. * - * @param galleryImageReference the galleryImageReference value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the provisioningStateApplicableScheduleProvisioningState value. */ - public LabVirtualMachineCreationParameter withGalleryImageReference(GalleryImageReference galleryImageReference) { - this.galleryImageReference = galleryImageReference; - return this; - } + String provisioningStateApplicableScheduleProvisioningState(); /** - * Get the planId property: The id of the plan associated with the virtual machine image. + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). * - * @return the planId value. + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. */ - public String planId() { - return this.planId; - } + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); /** - * Set the planId property: The id of the plan associated with the virtual machine image. + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). * - * @param planId the planId value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the weekdays value. */ - public LabVirtualMachineCreationParameter withPlanId(String planId) { - this.planId = planId; - return this; - } + List weekdays(); /** - * Get the networkInterface property: The network interface properties. + * Gets the time property: The time of the day the schedule will occur. * - * @return the networkInterface value. + * @return the time value. */ - public NetworkInterfaceProperties networkInterface() { - return this.networkInterface; - } + String time(); /** - * Set the networkInterface property: The network interface properties. + * Gets the minute property: Minutes of the hour the schedule will run. * - * @param networkInterface the networkInterface value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the minute value. */ - public LabVirtualMachineCreationParameter withNetworkInterface(NetworkInterfaceProperties networkInterface) { - this.networkInterface = networkInterface; - return this; - } + Integer minute(); /** - * Get the expirationDate property: The expiration date for VM. + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * - * @return the expirationDate value. + * @return the statusNotificationSettingsStatus value. */ - public OffsetDateTime expirationDate() { - return this.expirationDate; - } + EnableStatus statusNotificationSettingsStatus(); /** - * Set the expirationDate property: The expiration date for VM. + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. * - * @param expirationDate the expirationDate value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the timeInMinutes value. */ - public LabVirtualMachineCreationParameter withExpirationDate(OffsetDateTime expirationDate) { - this.expirationDate = expirationDate; - return this; - } + Integer timeInMinutes(); /** - * Get the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. * - * @return the allowClaim value. + * @return the webhookUrl value. */ - public Boolean allowClaim() { - return this.allowClaim; - } + String webhookUrl(); /** - * Set the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). * - * @param allowClaim the allowClaim value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the emailRecipient value. */ - public LabVirtualMachineCreationParameter withAllowClaim(Boolean allowClaim) { - this.allowClaim = allowClaim; - return this; - } + String emailRecipient(); /** - * Get the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). * - * @return the storageType value. + * @return the notificationLocale value. */ - public String storageType() { - return this.storageType; - } + String notificationLocale(); /** - * Set the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium). + * Gets the id property: the fully qualified resource ID for the resource. * - * @param storageType the storageType value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the id value. */ - public LabVirtualMachineCreationParameter withStorageType(String storageType) { - this.storageType = storageType; - return this; - } + String id(); /** - * Get the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * Gets the namePropertiesName property: the name of the resource. * - * @return the environmentId value. + * @return the namePropertiesName value. */ - public String environmentId() { - return this.environmentId; - } + String namePropertiesName(); /** - * Set the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * Gets the type property: the type of the resource. * - * @param environmentId the environmentId value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the type value. */ - public LabVirtualMachineCreationParameter withEnvironmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } + String type(); /** - * Get the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * Gets the locationPropertiesLocation property: the geo-location where the resource live. * - * @return the dataDiskParameters value. + * @return the locationPropertiesLocation value. */ - public List dataDiskParameters() { - return this.dataDiskParameters; - } + String locationPropertiesLocation(); /** - * Set the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * Gets the tagsPropertiesTags property: the tags of the resource. * - * @param dataDiskParameters the dataDiskParameters value to set. - * @return the LabVirtualMachineCreationParameter object itself. + * @return the tagsPropertiesTags value. */ - public LabVirtualMachineCreationParameter withDataDiskParameters(List dataDiskParameters) { - this.dataDiskParameters = dataDiskParameters; - return this; - } + Map tagsPropertiesTags(); /** - * Get the scheduleParameters property: Virtual Machine schedules to be created. + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner + * object. * - * @return the scheduleParameters value. + * @return the inner object. */ - public List scheduleParameters() { - return this.scheduleParameters; - } - - /** - * Set the scheduleParameters property: Virtual Machine schedules to be created. - * - * @param scheduleParameters the scheduleParameters value to set. - * @return the LabVirtualMachineCreationParameter object itself. - */ - public LabVirtualMachineCreationParameter withScheduleParameters( - List scheduleParameters) { - this.scheduleParameters = scheduleParameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (bulkCreationParameters() != null) { - bulkCreationParameters().validate(); - } - if (artifacts() != null) { - artifacts().forEach(e -> e.validate()); - } - if (galleryImageReference() != null) { - galleryImageReference().validate(); - } - if (networkInterface() != null) { - networkInterface().validate(); - } - if (dataDiskParameters() != null) { - dataDiskParameters().forEach(e -> e.validate()); - } - if (scheduleParameters() != null) { - scheduleParameters().forEach(e -> e.validate()); - } - } + LabVirtualMachineCreationParameterInner innerModel(); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameterProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameterProperties.java new file mode 100644 index 000000000000..c2815ce06c12 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineCreationParameterProperties.java @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LabVirtualMachineCreationParameterProperties. */ +public interface LabVirtualMachineCreationParameterProperties { + /** + * Gets the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + String ownerObjectId(); + + /** + * Gets the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + String ownerUserPrincipalName(); + + /** + * Gets the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + String createdByUserId(); + + /** + * Gets the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + String createdByUser(); + + /** + * Gets the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + String computeId(); + + /** + * Gets the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + String customImageId(); + + /** + * Gets the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + String galleryImageVersionId(); + + /** + * Gets the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + String sharedImageId(); + + /** + * Gets the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + String sharedImageVersion(); + + /** + * Gets the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the size property: The size of the virtual machine. + * + * @return the size value. + */ + String size(); + + /** + * Gets the username property: The user name of the virtual machine. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + String password(); + + /** + * Gets the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + String sshKey(); + + /** + * Gets the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + Boolean isAuthenticationWithSshKey(); + + /** + * Gets the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + String labSubnetName(); + + /** + * Gets the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + String labVirtualNetworkId(); + + /** + * Gets the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a + * public IP address. + * + * @return the disallowPublicIpAddress value. + */ + Boolean disallowPublicIpAddress(); + + /** + * Gets the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + List artifacts(); + + /** + * Gets the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + String planId(); + + /** + * Gets the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used + * to overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + Integer osDiskSizeGb(); + + /** + * Gets the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + Boolean allowClaim(); + + /** + * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + StorageType storageType(); + + /** + * Gets the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + VirtualMachineCreationSource virtualMachineCreationSource(); + + /** + * Gets the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + List dataDiskParameters(); + + /** + * Gets the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + List scheduleParameters(); + + /** + * Gets the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + String lastKnownPowerState(); + + /** + * Gets the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. + * + * @return the canApplyArtifacts value. + */ + Boolean canApplyArtifacts(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the instanceCount property: The number of virtual machine instances to create. + * + * @return the instanceCount value. + */ + Integer instanceCount(); + + /** + * Gets the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + String deploymentStatus(); + + /** + * Gets the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + Integer artifactsApplied(); + + /** + * Gets the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + Integer totalArtifacts(); + + /** + * Gets the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + String osTypeGalleryImageReferenceOsType(); + + /** + * Gets the version property: The version of the gallery image. + * + * @return the version value. + */ + String version(); + + /** + * Gets the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + String osTypeComputeVmOsType(); + + /** + * Gets the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + String networkInterfaceId(); + + /** + * Gets the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + String osDiskId(); + + /** + * Gets the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + List dataDiskIds(); + + /** + * Gets the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + List dataDisks(); + + /** + * Gets the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + String virtualNetworkId(); + + /** + * Gets the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + String publicIpAddressId(); + + /** + * Gets the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + String publicIpAddress(); + + /** + * Gets the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + String rdpAuthority(); + + /** + * Gets the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + String sshAuthority(); + + /** + * Gets the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + OffsetDateTime createdDateApplicableScheduleCreatedDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + String provisioningStateApplicableScheduleProvisioningState(); + + /** + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: the geo-location where the resource live. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + Map tagsPropertiesTags(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the inner + * com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterPropertiesInner object. + * + * @return the inner object. + */ + LabVirtualMachineCreationParameterPropertiesInner innerModel(); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java index 60feabce04c6..ea703722ede8 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A virtual machine. */ -@Immutable -public final class LabVirtualMachineFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class LabVirtualMachineFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineList.java index 5ad1986eeb9d..cff5b9d1c304 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of virtualMachines and their properties. */ @Fluent public final class LabVirtualMachineList { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabVirtualMachineList.class); /* - * Results of the list operation. + * List of virtualMachines and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of virtualMachines and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the LabVirtualMachineList object itself. - */ - public LabVirtualMachineList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the LabVirtualMachineList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java new file mode 100644 index 000000000000..d0654b9c5c73 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/LabVirtualMachineProperties.java @@ -0,0 +1,609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachinePropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LabVirtualMachineProperties. */ +public interface LabVirtualMachineProperties { + /** + * Gets the notes property: The notes of the virtual machine. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the ownerObjectId property: The object identifier of the owner of the virtual machine. + * + * @return the ownerObjectId value. + */ + String ownerObjectId(); + + /** + * Gets the ownerUserPrincipalName property: The user principal name of the virtual machine owner. + * + * @return the ownerUserPrincipalName value. + */ + String ownerUserPrincipalName(); + + /** + * Gets the createdByUserId property: The object identifier of the creator of the virtual machine. + * + * @return the createdByUserId value. + */ + String createdByUserId(); + + /** + * Gets the createdByUser property: The email address of creator of the virtual machine. + * + * @return the createdByUser value. + */ + String createdByUser(); + + /** + * Gets the createdDate property: The creation date of the virtual machine. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the computeId property: The resource identifier (Microsoft.Compute) of the virtual machine. + * + * @return the computeId value. + */ + String computeId(); + + /** + * Gets the customImageId property: The custom image identifier of the virtual machine. + * + * @return the customImageId value. + */ + String customImageId(); + + /** + * Gets the galleryImageVersionId property: The shared gallery image version resource identifier of the virtual + * machine. + * + * @return the galleryImageVersionId value. + */ + String galleryImageVersionId(); + + /** + * Gets the sharedImageId property: The shared image resource identifier of the virtual machine. + * + * @return the sharedImageId value. + */ + String sharedImageId(); + + /** + * Gets the sharedImageVersion property: The shared image version for the specified shared image Id. Will use latest + * if not specified. + * + * @return the sharedImageVersion value. + */ + String sharedImageVersion(); + + /** + * Gets the osType property: The OS type of the virtual machine. + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the size property: The size of the virtual machine. + * + * @return the size value. + */ + String size(); + + /** + * Gets the username property: The user name of the virtual machine. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: The password of the virtual machine administrator. + * + * @return the password value. + */ + String password(); + + /** + * Gets the sshKey property: The SSH key of the virtual machine administrator. + * + * @return the sshKey value. + */ + String sshKey(); + + /** + * Gets the isAuthenticationWithSshKey property: Indicates whether this virtual machine uses an SSH key for + * authentication. + * + * @return the isAuthenticationWithSshKey value. + */ + Boolean isAuthenticationWithSshKey(); + + /** + * Gets the fqdn property: The fully-qualified domain name of the virtual machine. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the labSubnetName property: The lab subnet name of the virtual machine. + * + * @return the labSubnetName value. + */ + String labSubnetName(); + + /** + * Gets the labVirtualNetworkId property: The lab virtual network identifier of the virtual machine. + * + * @return the labVirtualNetworkId value. + */ + String labVirtualNetworkId(); + + /** + * Gets the disallowPublicIpAddress property: Indicates whether the virtual machine is to be created without a + * public IP address. + * + * @return the disallowPublicIpAddress value. + */ + Boolean disallowPublicIpAddress(); + + /** + * Gets the artifacts property: The artifacts to be installed on the virtual machine. + * + * @return the artifacts value. + */ + List artifacts(); + + /** + * Gets the planId property: The id of the plan associated with the virtual machine image. + * + * @return the planId value. + */ + String planId(); + + /** + * Gets the osDiskSizeGb property: Specifies the size of an empty data disk in gigabytes. This element can be used + * to overwrite the size of the disk in a virtual machine image. + * + * @return the osDiskSizeGb value. + */ + Integer osDiskSizeGb(); + + /** + * Gets the expirationDate property: The expiration date for VM. + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the allowClaim property: Indicates whether another user can take ownership of the virtual machine. + * + * @return the allowClaim value. + */ + Boolean allowClaim(); + + /** + * Gets the storageType property: Storage type to use for virtual machine (i.e. Standard, Premium, StandardSSD). + * + * @return the storageType value. + */ + StorageTypes storageType(); + + /** + * Gets the virtualMachineCreationSource property: Tells source of creation of lab virtual machine. Output property + * only. + * + * @return the virtualMachineCreationSource value. + */ + VirtualMachineCreationSource virtualMachineCreationSource(); + + /** + * Gets the environmentId property: The resource ID of the environment that contains this virtual machine, if any. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the dataDiskParameters property: New or existing data disks to attach to the virtual machine after creation. + * + * @return the dataDiskParameters value. + */ + List dataDiskParameters(); + + /** + * Gets the scheduleParameters property: Virtual Machine schedules to be created. + * + * @return the scheduleParameters value. + */ + List scheduleParameters(); + + /** + * Gets the lastKnownPowerState property: Last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value. + */ + String lastKnownPowerState(); + + /** + * Gets the canApplyArtifacts property: Flag to determine if apply artifacts can be triggered at the time of + * fetching the document. + * + * @return the canApplyArtifacts value. + */ + Boolean canApplyArtifacts(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the deploymentStatus property: The deployment status of the artifact. + * + * @return the deploymentStatus value. + */ + String deploymentStatus(); + + /** + * Gets the artifactsApplied property: The total count of the artifacts that were successfully applied. + * + * @return the artifactsApplied value. + */ + Integer artifactsApplied(); + + /** + * Gets the totalArtifacts property: The total count of the artifacts that were tentatively applied. + * + * @return the totalArtifacts value. + */ + Integer totalArtifacts(); + + /** + * Gets the offer property: The offer of the gallery image. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the publisher property: The publisher of the gallery image. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the sku property: The SKU of the gallery image. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the osTypeGalleryImageReferenceOsType property: The OS type of the gallery image. + * + * @return the osTypeGalleryImageReferenceOsType value. + */ + String osTypeGalleryImageReferenceOsType(); + + /** + * Gets the version property: The version of the gallery image. + * + * @return the version value. + */ + String version(); + + /** + * Gets the statuses property: Gets the statuses of the virtual machine. + * + * @return the statuses value. + */ + List statuses(); + + /** + * Gets the osTypeComputeVmOsType property: Gets the OS type of the virtual machine. + * + * @return the osTypeComputeVmOsType value. + */ + String osTypeComputeVmOsType(); + + /** + * Gets the vmSize property: Gets the size of the virtual machine. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the networkInterfaceId property: Gets the network interface ID of the virtual machine. + * + * @return the networkInterfaceId value. + */ + String networkInterfaceId(); + + /** + * Gets the osDiskId property: Gets OS disk blob uri for the virtual machine. + * + * @return the osDiskId value. + */ + String osDiskId(); + + /** + * Gets the dataDiskIds property: Gets data disks blob uri for the virtual machine. + * + * @return the dataDiskIds value. + */ + List dataDiskIds(); + + /** + * Gets the dataDisks property: Gets all data disks attached to the virtual machine. + * + * @return the dataDisks value. + */ + List dataDisks(); + + /** + * Gets the virtualNetworkId property: The resource ID of the virtual network. + * + * @return the virtualNetworkId value. + */ + String virtualNetworkId(); + + /** + * Gets the subnetId property: The resource ID of the sub net. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the publicIpAddressId property: The resource ID of the public IP address. + * + * @return the publicIpAddressId value. + */ + String publicIpAddressId(); + + /** + * Gets the publicIpAddress property: The public IP address. + * + * @return the publicIpAddress value. + */ + String publicIpAddress(); + + /** + * Gets the privateIpAddress property: The private IP address. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the dnsName property: The DNS name. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the rdpAuthority property: The RdpAuthority property is a server DNS host name or IP address followed by the + * service port number for RDP (Remote Desktop Protocol). + * + * @return the rdpAuthority value. + */ + String rdpAuthority(); + + /** + * Gets the sshAuthority property: The SshAuthority property is a server DNS host name or IP address followed by the + * service port number for SSH. + * + * @return the sshAuthority value. + */ + String sshAuthority(); + + /** + * Gets the inboundNatRules property: The incoming NAT rules. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDateApplicableScheduleCreatedDate property: The creation date of the schedule. + * + * @return the createdDateApplicableScheduleCreatedDate value. + */ + OffsetDateTime createdDateApplicableScheduleCreatedDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + String provisioningStateApplicableScheduleProvisioningState(); + + /** + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: the geo-location where the resource live. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + Map tagsPropertiesTags(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachinePropertiesInner object. + * + * @return the inner object. + */ + LabVirtualMachinePropertiesInner innerModel(); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java index 34261c9de4e8..f2b5dbe5c23a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Labs.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; /** Resource collection API of Labs. */ public interface Labs { @@ -15,24 +16,23 @@ public interface Labs { * * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(); /** * List labs in a subscription. * - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); + PagedIterable list(String filter, Integer top, String orderby, Context context); /** * List labs in a resource group. @@ -41,7 +41,7 @@ public interface Labs { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,18 +49,17 @@ public interface Labs { * List labs in a resource group. * * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of labs and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context); + String resourceGroupName, String filter, Integer top, String orderby, Context context); /** * Get lab. @@ -79,14 +78,13 @@ PagedIterable listByResourceGroup( * * @param resourceGroupName The name of the resource group. * @param name The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String name, String expand, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); /** * Delete lab. This operation can take a while to complete. @@ -145,7 +143,9 @@ PagedIterable listByResourceGroup( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void createEnvironment( - String resourceGroupName, String name, LabVirtualMachineCreationParameter labVirtualMachineCreationParameter); + String resourceGroupName, + String name, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter); /** * Create virtual machines in a lab. This operation can take a while to complete. @@ -161,9 +161,33 @@ void createEnvironment( void createEnvironment( String resourceGroupName, String name, - LabVirtualMachineCreationParameter labVirtualMachineCreationParameter, + LabVirtualMachineCreationParameterInner labVirtualMachineCreationParameter, Context context); + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void ensureCurrentUserProfile(String resourceGroupName, String name); + + /** + * Ensure the current user has a valid profile in the lab. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the lab. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response ensureCurrentUserProfileWithResponse(String resourceGroupName, String name, Context context); + /** * Exports the lab resource usage into a storage account This operation can take a while to complete. * @@ -218,7 +242,7 @@ GenerateUploadUriResponse generateUploadUri( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 body for generating an upload URI. + * @return response body for generating an upload URI along with {@link Response}. */ Response generateUploadUriWithResponse( String resourceGroupName, String name, GenerateUploadUriParameter generateUploadUriParameter, Context context); @@ -263,7 +287,7 @@ void importVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listVhds(String resourceGroupName, String name); @@ -276,7 +300,7 @@ void importVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of Lab Vhd and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listVhds(String resourceGroupName, String name, Context context); @@ -287,7 +311,7 @@ void importVirtualMachine( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab along with {@link Response}. */ Lab getById(String id); @@ -295,14 +319,13 @@ void importVirtualMachine( * Get lab. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return lab along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete lab. This operation can take a while to complete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java index d50efd65dd96..384c45e5d54c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannel.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.NotificationChannelInner; import java.time.OffsetDateTime; @@ -49,6 +50,13 @@ public interface NotificationChannel { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the webhookUrl property: The webhook URL to send notifications to. * @@ -289,9 +297,9 @@ interface UpdateStages { /** The stage of the NotificationChannel update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); @@ -330,7 +338,7 @@ interface WithTags { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response notifyWithResponse(NotifyParameters notifyParameters, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java index f95756995d12..6bd0cbdebf34 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A notification. */ -@Immutable -public final class NotificationChannelFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class NotificationChannelFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationChannelFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelList.java index 83b46fcd73d1..67956992e93a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannelList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of notificationChannels and their properties. */ @Fluent public final class NotificationChannelList { @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationChannelList.class); /* - * Results of the list operation. + * List of notificationChannels and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of notificationChannels and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the NotificationChannelList object itself. - */ - public NotificationChannelList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the NotificationChannelList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java index 60e368e43878..9f78c0254dbe 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/NotificationChannels.java @@ -18,7 +18,8 @@ public interface NotificationChannels { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -27,24 +28,18 @@ public interface NotificationChannels { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of notificationChannels and their properties as paginated response with {@link + * PagedIterable}. */ PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get notification channel. @@ -65,15 +60,14 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the notification channel. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + String resourceGroupName, String labName, String name, Context context); /** * Delete notification channel. @@ -97,7 +91,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -125,7 +119,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response notifyWithResponse( String resourceGroupName, String labName, String name, NotifyParameters notifyParameters, Context context); @@ -137,7 +131,7 @@ Response notifyWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel along with {@link Response}. */ NotificationChannel getById(String id); @@ -145,14 +139,13 @@ Response notifyWithResponse( * Get notification channel. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=webHookUrl)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return notification channel. + * @return notification channel along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete notification channel. @@ -172,7 +165,7 @@ Response notifyWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java index 36df0a9465e5..bfd0d481fcb7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationResult.java @@ -23,11 +23,18 @@ public interface OperationResult { HttpStatusCode statusCode(); /** - * Gets the error property: Error details for the operation in case of a failure. + * Gets the code property: The error code of the operation error. * - * @return the error value. + * @return the code value. */ - OperationError error(); + String code(); + + /** + * Gets the message property: The error message of the operation error. + * + * @return the message value. + */ + String message(); /** * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.OperationResultInner object. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationStatusResult.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationStatusResult.java new file mode 100644 index 000000000000..62056f27ada8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OperationStatusResult.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The current status of an async operation. */ +@Fluent +public final class OperationStatusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusResult.class); + + /* + * Fully qualified ID for the async operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the async operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * Percent of the operation that is complete. + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /* + * The start time of the operation. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The operations list. + */ + @JsonProperty(value = "operations") + private List operations; + + /* + * If present, details of the operation error. + */ + @JsonProperty(value = "error") + private ErrorDetail error; + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ErrorDetail error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResult object itself. + */ + public OperationStatusResult withError(ErrorDetail error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model OperationStatusResult")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java index fb6620b923f7..dd5b2689f82c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Operations.java @@ -30,7 +30,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return operation along with {@link Response}. */ Response getWithResponse(String locationName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OsType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OsType.java new file mode 100644 index 000000000000..4f4c40270ffa --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/OsType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OsType. */ +public final class OsType extends ExpandableStringEnum { + /** Static value Windows for OsType. */ + public static final OsType WINDOWS = fromString("Windows"); + + /** Static value Linux for OsType. */ + public static final OsType LINUX = fromString("Linux"); + + /** + * Creates or finds a OsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OsType. + */ + @JsonCreator + public static OsType fromString(String name) { + return fromString(name, OsType.class); + } + + /** @return known OsType values. */ + public static Collection values() { + return values(OsType.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Plan.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Plan.java new file mode 100644 index 000000000000..5f5aab14bb40 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Plan.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Plan for the resource. */ +@Fluent +public class Plan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Plan.class); + + /* + * A user defined name of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The publisher of the 3rd Party Artifact that is being bought. E.g. + * NewRelic + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product + * maps to the OfferID specified for the artifact at the time of Data + * Market onboarding. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /* + * A publisher provided promotion code as provisioned in Data Market for + * the said product/artifact. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The version of the desired product/artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set. + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set. + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set. + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The version of the desired product/artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the desired product/artifact. + * + * @param version the version value to set. + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Plan")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property publisher in model Plan")); + } + if (product() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property product in model Plan")); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java index 7f152836281d..c067af0b02a7 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policies.java @@ -19,7 +19,7 @@ public interface Policies { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String policySetName); @@ -29,21 +29,19 @@ public interface Policies { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param policySetName The name of the policy set. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of policies and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String policySetName, - String expand, String filter, Integer top, String orderby, @@ -70,15 +68,14 @@ PagedIterable list( * @param labName The name of the lab. * @param policySetName The name of the policy set. * @param name The name of the policy. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, String labName, String policySetName, String name, String expand, Context context); + String resourceGroupName, String labName, String policySetName, String name, Context context); /** * Delete policy. @@ -104,7 +101,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String labName, String policySetName, String name, Context context); @@ -116,7 +113,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy along with {@link Response}. */ Policy getById(String id); @@ -124,14 +121,13 @@ Response deleteWithResponse( * Get policy. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=description)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy. + * @return policy along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete policy. @@ -151,7 +147,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java index 80351b877744..8c452a542807 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Policy.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.PolicyInner; import java.time.OffsetDateTime; @@ -47,6 +48,13 @@ public interface Policy { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the description property: The description of the policy. * @@ -305,9 +313,9 @@ interface UpdateStages { /** The stage of the Policy update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java index 92b3b1f13b57..3f82b40c1318 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A Policy. */ -@Immutable -public final class PolicyFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class PolicyFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyList.java index 322f4cb081eb..baeec8adcd23 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicyList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of policies and their properties. */ @Fluent public final class PolicyList { @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyList.class); /* - * Results of the list operation. + * List of policies and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of policies and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the PolicyList object itself. - */ - public PolicyList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the PolicyList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySet.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySet.java new file mode 100644 index 000000000000..715366c69c70 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySet.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.PolicySetInner; + +/** An immutable client-side representation of PolicySet. */ +public interface PolicySet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.PolicySetInner object. + * + * @return the inner object. + */ + PolicySetInner innerModel(); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetList.java new file mode 100644 index 000000000000..ceba773f6638 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySetList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.PolicySetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains a list of policySets and their properties. */ +@Fluent +public final class PolicySetList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicySetList.class); + + /* + * List of policySets and their properties + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of policySets and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the PolicySetList object itself. + */ + public PolicySetList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java index 51b4e62b90f7..817af82370b5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/PolicySets.java @@ -4,11 +4,41 @@ package com.azure.resourcemanager.devtestlabs.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; /** Resource collection API of PolicySets. */ public interface PolicySets { + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List policy sets in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of policySets and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + /** * Evaluates lab policy. * @@ -35,7 +65,7 @@ EvaluatePoliciesResponse evaluatePolicies( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 body for evaluating a policy set. + * @return response body for evaluating a policy set along with {@link Response}. */ Response evaluatePoliciesWithResponse( String resourceGroupName, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java index 309352292976..e2fb764addd9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ProviderOperations.java @@ -14,7 +14,7 @@ public interface ProviderOperations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface ProviderOperations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceIdentityType.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceIdentityType.java new file mode 100644 index 000000000000..7a66bd3dcb9e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceIdentityType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetIdentity.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetIdentity.java new file mode 100644 index 000000000000..676bc180c4c5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetIdentity.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceModelWithAllowedPropertySetIdentity model. */ +@Fluent +public class ResourceModelWithAllowedPropertySetIdentity extends Identity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceModelWithAllowedPropertySetIdentity.class); + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetIdentity withType(ResourceIdentityType type) { + super.withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetPlan.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetPlan.java new file mode 100644 index 000000000000..a32559f635f5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetPlan.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceModelWithAllowedPropertySetPlan model. */ +@Fluent +public final class ResourceModelWithAllowedPropertySetPlan extends Plan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceModelWithAllowedPropertySetPlan.class); + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetPlan withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetPlan withPublisher(String publisher) { + super.withPublisher(publisher); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetPlan withProduct(String product) { + super.withProduct(product); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetPlan withPromotionCode(String promotionCode) { + super.withPromotionCode(promotionCode); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetPlan withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetSku.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetSku.java new file mode 100644 index 000000000000..2fc9ad1c2782 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ResourceModelWithAllowedPropertySetSku.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The ResourceModelWithAllowedPropertySetSku model. */ +@Fluent +public final class ResourceModelWithAllowedPropertySetSku extends Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceModelWithAllowedPropertySetSku.class); + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetSku withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetSku withTier(SkuTier tier) { + super.withTier(tier); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetSku withSize(String size) { + super.withSize(size); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetSku withFamily(String family) { + super.withFamily(family); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceModelWithAllowedPropertySetSku withCapacity(Integer capacity) { + super.withCapacity(capacity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java index fd2feb3572ab..71799b2af3f3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedule.java @@ -5,9 +5,11 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Schedule. */ @@ -47,6 +49,13 @@ public interface Schedule { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). * @@ -62,70 +71,99 @@ public interface Schedule { String taskType(); /** - * Gets the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly - * recurrence. + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). * - * @return the weeklyRecurrence value. + * @return the timeZoneId value. */ - WeekDetails weeklyRecurrence(); + String timeZoneId(); /** - * Gets the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily - * recurrence. + * Gets the createdDate property: The creation date of the schedule. * - * @return the dailyRecurrence value. + * @return the createdDate value. */ - DayDetails dailyRecurrence(); + OffsetDateTime createdDate(); /** - * Gets the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly - * recurrence. + * Gets the targetResourceId property: The resource ID to which the schedule belongs. * - * @return the hourlyRecurrence value. + * @return the targetResourceId value. */ - HourDetails hourlyRecurrence(); + String targetResourceId(); /** - * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * Gets the provisioningState property: The provisioning status of the resource. * - * @return the timeZoneId value. + * @return the provisioningState value. */ - String timeZoneId(); + String provisioningState(); /** - * Gets the notificationSettings property: Notification settings. + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). * - * @return the notificationSettings value. + * @return the uniqueIdentifier value. */ - NotificationSettings notificationSettings(); + String uniqueIdentifier(); /** - * Gets the createdDate property: The creation date of the schedule. + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). * - * @return the createdDate value. + * @return the weekdays value. */ - OffsetDateTime createdDate(); + List weekdays(); /** - * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * Gets the time property: The time of the day the schedule will occur. * - * @return the targetResourceId value. + * @return the time value. */ - String targetResourceId(); + String time(); /** - * Gets the provisioningState property: The provisioning status of the resource. + * Gets the minute property: Minutes of the hour the schedule will run. * - * @return the provisioningState value. + * @return the minute value. */ - String provisioningState(); + Integer minute(); /** - * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * - * @return the uniqueIdentifier value. + * @return the statusNotificationSettingsStatus value. */ - String uniqueIdentifier(); + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); /** * Gets the region of the resource. @@ -196,12 +234,16 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithStatus, DefinitionStages.WithTaskType, - DefinitionStages.WithWeeklyRecurrence, - DefinitionStages.WithDailyRecurrence, - DefinitionStages.WithHourlyRecurrence, DefinitionStages.WithTimeZoneId, - DefinitionStages.WithNotificationSettings, - DefinitionStages.WithTargetResourceId { + DefinitionStages.WithTargetResourceId, + DefinitionStages.WithWeekdays, + DefinitionStages.WithTime, + DefinitionStages.WithMinute, + DefinitionStages.WithStatusNotificationSettingsStatus, + DefinitionStages.WithTimeInMinutes, + DefinitionStages.WithWebhookUrl, + DefinitionStages.WithEmailRecipient, + DefinitionStages.WithNotificationLocale { /** * Executes the create request. * @@ -248,70 +290,112 @@ interface WithTaskType { */ WithCreate withTaskType(String taskType); } - /** The stage of the Schedule definition allowing to specify weeklyRecurrence. */ - interface WithWeeklyRecurrence { + /** The stage of the Schedule definition allowing to specify timeZoneId. */ + interface WithTimeZoneId { /** - * Specifies the weeklyRecurrence property: If the schedule will occur only some days of the week, specify - * the weekly recurrence.. + * Specifies the timeZoneId property: The time zone ID (e.g. Pacific Standard time).. * - * @param weeklyRecurrence If the schedule will occur only some days of the week, specify the weekly - * recurrence. + * @param timeZoneId The time zone ID (e.g. Pacific Standard time). * @return the next definition stage. */ - WithCreate withWeeklyRecurrence(WeekDetails weeklyRecurrence); + WithCreate withTimeZoneId(String timeZoneId); } - /** The stage of the Schedule definition allowing to specify dailyRecurrence. */ - interface WithDailyRecurrence { + /** The stage of the Schedule definition allowing to specify targetResourceId. */ + interface WithTargetResourceId { /** - * Specifies the dailyRecurrence property: If the schedule will occur once each day of the week, specify the - * daily recurrence.. + * Specifies the targetResourceId property: The resource ID to which the schedule belongs. * - * @param dailyRecurrence If the schedule will occur once each day of the week, specify the daily - * recurrence. + * @param targetResourceId The resource ID to which the schedule belongs. * @return the next definition stage. */ - WithCreate withDailyRecurrence(DayDetails dailyRecurrence); + WithCreate withTargetResourceId(String targetResourceId); } - /** The stage of the Schedule definition allowing to specify hourlyRecurrence. */ - interface WithHourlyRecurrence { + /** The stage of the Schedule definition allowing to specify weekdays. */ + interface WithWeekdays { /** - * Specifies the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the - * hourly recurrence.. + * Specifies the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, + * Tuesday, etc.).. * - * @param hourlyRecurrence If the schedule will occur multiple times a day, specify the hourly recurrence. + * @param weekdays The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, etc.). * @return the next definition stage. */ - WithCreate withHourlyRecurrence(HourDetails hourlyRecurrence); + WithCreate withWeekdays(List weekdays); } - /** The stage of the Schedule definition allowing to specify timeZoneId. */ - interface WithTimeZoneId { + /** The stage of the Schedule definition allowing to specify time. */ + interface WithTime { /** - * Specifies the timeZoneId property: The time zone ID (e.g. Pacific Standard time).. + * Specifies the time property: The time of the day the schedule will occur.. * - * @param timeZoneId The time zone ID (e.g. Pacific Standard time). + * @param time The time of the day the schedule will occur. * @return the next definition stage. */ - WithCreate withTimeZoneId(String timeZoneId); + WithCreate withTime(String time); } - /** The stage of the Schedule definition allowing to specify notificationSettings. */ - interface WithNotificationSettings { + /** The stage of the Schedule definition allowing to specify minute. */ + interface WithMinute { /** - * Specifies the notificationSettings property: Notification settings.. + * Specifies the minute property: Minutes of the hour the schedule will run.. * - * @param notificationSettings Notification settings. + * @param minute Minutes of the hour the schedule will run. * @return the next definition stage. */ - WithCreate withNotificationSettings(NotificationSettings notificationSettings); + WithCreate withMinute(Integer minute); } - /** The stage of the Schedule definition allowing to specify targetResourceId. */ - interface WithTargetResourceId { + /** The stage of the Schedule definition allowing to specify statusNotificationSettingsStatus. */ + interface WithStatusNotificationSettingsStatus { /** - * Specifies the targetResourceId property: The resource ID to which the schedule belongs. + * Specifies the statusNotificationSettingsStatus property: If notifications are enabled for this schedule + * (i.e. Enabled, Disabled).. * - * @param targetResourceId The resource ID to which the schedule belongs. + * @param statusNotificationSettingsStatus If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * @return the next definition stage. */ - WithCreate withTargetResourceId(String targetResourceId); + WithCreate withStatusNotificationSettingsStatus(EnableStatus statusNotificationSettingsStatus); + } + /** The stage of the Schedule definition allowing to specify timeInMinutes. */ + interface WithTimeInMinutes { + /** + * Specifies the timeInMinutes property: Time in minutes before event at which notification will be sent.. + * + * @param timeInMinutes Time in minutes before event at which notification will be sent. + * @return the next definition stage. + */ + WithCreate withTimeInMinutes(Integer timeInMinutes); + } + /** The stage of the Schedule definition allowing to specify webhookUrl. */ + interface WithWebhookUrl { + /** + * Specifies the webhookUrl property: The webhook URL to which the notification will be sent.. + * + * @param webhookUrl The webhook URL to which the notification will be sent. + * @return the next definition stage. + */ + WithCreate withWebhookUrl(String webhookUrl); + } + /** The stage of the Schedule definition allowing to specify emailRecipient. */ + interface WithEmailRecipient { + /** + * Specifies the emailRecipient property: The email recipient to send notifications to (can be a list of + * semi-colon separated email addresses).. + * + * @param emailRecipient The email recipient to send notifications to (can be a list of semi-colon separated + * email addresses). + * @return the next definition stage. + */ + WithCreate withEmailRecipient(String emailRecipient); + } + /** The stage of the Schedule definition allowing to specify notificationLocale. */ + interface WithNotificationLocale { + /** + * Specifies the notificationLocale property: The locale to use when sending a notification (fallback for + * unsupported languages is EN).. + * + * @param notificationLocale The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * @return the next definition stage. + */ + WithCreate withNotificationLocale(String notificationLocale); } } /** @@ -343,9 +427,9 @@ interface UpdateStages { /** The stage of the Schedule update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java index df984223e28b..860e58c4f0cc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleCreationParameter.java @@ -5,18 +5,26 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleCreationParameterProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Properties for creating a schedule. */ -@JsonFlatten @Fluent -public class ScheduleCreationParameter { +public final class ScheduleCreationParameter { @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleCreationParameter.class); + /* + * The properties of the schedule. + */ + @JsonProperty(value = "properties", required = true) + private ScheduleCreationParameterProperties innerProperties = new ScheduleCreationParameterProperties(); + /* * The name of the virtual machine or environment */ @@ -33,58 +41,17 @@ public class ScheduleCreationParameter { * The tags of the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The status of the schedule (i.e. Enabled, Disabled) - */ - @JsonProperty(value = "properties.status") - private EnableStatus status; - - /* - * The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). - */ - @JsonProperty(value = "properties.taskType") - private String taskType; - - /* - * If the schedule will occur only some days of the week, specify the - * weekly recurrence. - */ - @JsonProperty(value = "properties.weeklyRecurrence") - private WeekDetails weeklyRecurrence; - - /* - * If the schedule will occur once each day of the week, specify the daily - * recurrence. - */ - @JsonProperty(value = "properties.dailyRecurrence") - private DayDetails dailyRecurrence; - - /* - * If the schedule will occur multiple times a day, specify the hourly - * recurrence. - */ - @JsonProperty(value = "properties.hourlyRecurrence") - private HourDetails hourlyRecurrence; - - /* - * The time zone ID (e.g. Pacific Standard time). - */ - @JsonProperty(value = "properties.timeZoneId") - private String timeZoneId; - - /* - * Notification settings. - */ - @JsonProperty(value = "properties.notificationSettings") - private NotificationSettings notificationSettings; - - /* - * The resource ID to which the schedule belongs + /** + * Get the innerProperties property: The properties of the schedule. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.targetResourceId") - private String targetResourceId; + private ScheduleCreationParameterProperties innerProperties() { + return this.innerProperties; + } /** * Get the name property: The name of the virtual machine or environment. @@ -152,7 +119,7 @@ public ScheduleCreationParameter withTags(Map tags) { * @return the status value. */ public EnableStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -162,7 +129,10 @@ public EnableStatus status() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withStatus(EnableStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withStatus(status); return this; } @@ -172,7 +142,7 @@ public ScheduleCreationParameter withStatus(EnableStatus status) { * @return the taskType value. */ public String taskType() { - return this.taskType; + return this.innerProperties() == null ? null : this.innerProperties().taskType(); } /** @@ -182,153 +152,292 @@ public String taskType() { * @return the ScheduleCreationParameter object itself. */ public ScheduleCreationParameter withTaskType(String taskType) { - this.taskType = taskType; + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withTaskType(taskType); return this; } /** - * Get the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly - * recurrence. + * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). * - * @return the weeklyRecurrence value. + * @return the timeZoneId value. */ - public WeekDetails weeklyRecurrence() { - return this.weeklyRecurrence; + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); } /** - * Set the weeklyRecurrence property: If the schedule will occur only some days of the week, specify the weekly - * recurrence. + * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). * - * @param weeklyRecurrence the weeklyRecurrence value to set. + * @param timeZoneId the timeZoneId value to set. * @return the ScheduleCreationParameter object itself. */ - public ScheduleCreationParameter withWeeklyRecurrence(WeekDetails weeklyRecurrence) { - this.weeklyRecurrence = weeklyRecurrence; + public ScheduleCreationParameter withTimeZoneId(String timeZoneId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withTimeZoneId(timeZoneId); return this; } /** - * Get the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily - * recurrence. + * Get the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); + } + + /** + * Get the targetResourceId property: The resource ID to which the schedule belongs. * - * @return the dailyRecurrence value. + * @return the targetResourceId value. */ - public DayDetails dailyRecurrence() { - return this.dailyRecurrence; + public String targetResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceId(); } /** - * Set the dailyRecurrence property: If the schedule will occur once each day of the week, specify the daily - * recurrence. + * Set the targetResourceId property: The resource ID to which the schedule belongs. * - * @param dailyRecurrence the dailyRecurrence value to set. + * @param targetResourceId the targetResourceId value to set. * @return the ScheduleCreationParameter object itself. */ - public ScheduleCreationParameter withDailyRecurrence(DayDetails dailyRecurrence) { - this.dailyRecurrence = dailyRecurrence; + public ScheduleCreationParameter withTargetResourceId(String targetResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withTargetResourceId(targetResourceId); return this; } /** - * Get the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly - * recurrence. + * Get the provisioningState property: The provisioning status of the resource. * - * @return the hourlyRecurrence value. + * @return the provisioningState value. */ - public HourDetails hourlyRecurrence() { - return this.hourlyRecurrence; + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** - * Set the hourlyRecurrence property: If the schedule will occur multiple times a day, specify the hourly - * recurrence. + * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). * - * @param hourlyRecurrence the hourlyRecurrence value to set. + * @return the uniqueIdentifier value. + */ + public String uniqueIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier(); + } + + /** + * Get the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + public List weekdays() { + return this.innerProperties() == null ? null : this.innerProperties().weekdays(); + } + + /** + * Set the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @param weekdays the weekdays value to set. * @return the ScheduleCreationParameter object itself. */ - public ScheduleCreationParameter withHourlyRecurrence(HourDetails hourlyRecurrence) { - this.hourlyRecurrence = hourlyRecurrence; + public ScheduleCreationParameter withWeekdays(List weekdays) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withWeekdays(weekdays); return this; } /** - * Get the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * Get the time property: The time of the day the schedule will occur. * - * @return the timeZoneId value. + * @return the time value. */ - public String timeZoneId() { - return this.timeZoneId; + public String time() { + return this.innerProperties() == null ? null : this.innerProperties().time(); } /** - * Set the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * Set the time property: The time of the day the schedule will occur. * - * @param timeZoneId the timeZoneId value to set. + * @param time the time value to set. * @return the ScheduleCreationParameter object itself. */ - public ScheduleCreationParameter withTimeZoneId(String timeZoneId) { - this.timeZoneId = timeZoneId; + public ScheduleCreationParameter withTime(String time) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withTime(time); return this; } /** - * Get the notificationSettings property: Notification settings. + * Get the minute property: Minutes of the hour the schedule will run. * - * @return the notificationSettings value. + * @return the minute value. */ - public NotificationSettings notificationSettings() { - return this.notificationSettings; + public Integer minute() { + return this.innerProperties() == null ? null : this.innerProperties().minute(); } /** - * Set the notificationSettings property: Notification settings. + * Set the minute property: Minutes of the hour the schedule will run. * - * @param notificationSettings the notificationSettings value to set. + * @param minute the minute value to set. * @return the ScheduleCreationParameter object itself. */ - public ScheduleCreationParameter withNotificationSettings(NotificationSettings notificationSettings) { - this.notificationSettings = notificationSettings; + public ScheduleCreationParameter withMinute(Integer minute) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withMinute(minute); return this; } /** - * Get the targetResourceId property: The resource ID to which the schedule belongs. + * Get the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * - * @return the targetResourceId value. + * @return the statusNotificationSettingsStatus value. */ - public String targetResourceId() { - return this.targetResourceId; + public EnableStatus statusNotificationSettingsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().statusNotificationSettingsStatus(); } /** - * Set the targetResourceId property: The resource ID to which the schedule belongs. + * Set the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). * - * @param targetResourceId the targetResourceId value to set. + * @param statusNotificationSettingsStatus the statusNotificationSettingsStatus value to set. * @return the ScheduleCreationParameter object itself. */ - public ScheduleCreationParameter withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; + public ScheduleCreationParameter withStatusNotificationSettingsStatus( + EnableStatus statusNotificationSettingsStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withStatusNotificationSettingsStatus(statusNotificationSettingsStatus); return this; } /** - * Validates the instance. + * Get the timeInMinutes property: Time in minutes before event at which notification will be sent. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the timeInMinutes value. */ - public void validate() { - if (weeklyRecurrence() != null) { - weeklyRecurrence().validate(); + public Integer timeInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().timeInMinutes(); + } + + /** + * Set the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @param timeInMinutes the timeInMinutes value to set. + * @return the ScheduleCreationParameter object itself. + */ + public ScheduleCreationParameter withTimeInMinutes(Integer timeInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); } - if (dailyRecurrence() != null) { - dailyRecurrence().validate(); + this.innerProperties().withTimeInMinutes(timeInMinutes); + return this; + } + + /** + * Get the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.innerProperties() == null ? null : this.innerProperties().webhookUrl(); + } + + /** + * Set the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @param webhookUrl the webhookUrl value to set. + * @return the ScheduleCreationParameter object itself. + */ + public ScheduleCreationParameter withWebhookUrl(String webhookUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); } - if (hourlyRecurrence() != null) { - hourlyRecurrence().validate(); + this.innerProperties().withWebhookUrl(webhookUrl); + return this; + } + + /** + * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + public String emailRecipient() { + return this.innerProperties() == null ? null : this.innerProperties().emailRecipient(); + } + + /** + * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @param emailRecipient the emailRecipient value to set. + * @return the ScheduleCreationParameter object itself. + */ + public ScheduleCreationParameter withEmailRecipient(String emailRecipient) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); + } + this.innerProperties().withEmailRecipient(emailRecipient); + return this; + } + + /** + * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + public String notificationLocale() { + return this.innerProperties() == null ? null : this.innerProperties().notificationLocale(); + } + + /** + * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @param notificationLocale the notificationLocale value to set. + * @return the ScheduleCreationParameter object itself. + */ + public ScheduleCreationParameter withNotificationLocale(String notificationLocale) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleCreationParameterProperties(); } - if (notificationSettings() != null) { - notificationSettings().validate(); + this.innerProperties().withNotificationLocale(notificationLocale); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ScheduleCreationParameter")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java index 6b6cab823f1c..ee7bcf5fa170 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A schedule. */ -@Immutable -public final class ScheduleFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class ScheduleFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleList.java index d0ac150bb546..3936770ad84d 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ScheduleList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of schedules and their properties. */ @Fluent public final class ScheduleList { @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleList.class); /* - * Results of the list operation. + * List of schedules and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of schedules and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ScheduleList object itself. - */ - public ScheduleList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the ScheduleList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java index 0106062e12c6..abe9bcf5d933 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Schedules.java @@ -19,7 +19,7 @@ public interface Schedules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -28,24 +28,17 @@ public interface Schedules { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get schedule. @@ -66,15 +59,13 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Create or replace an existing schedule. @@ -101,7 +92,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ Response createOrUpdateWithResponse( String resourceGroupName, String labName, String name, ScheduleInner schedule, Context context); @@ -128,7 +119,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); @@ -138,7 +129,7 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -152,12 +143,12 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 schedule. + * @return a schedule along with {@link Response}. */ Response updateWithResponse( String resourceGroupName, String labName, String name, ScheduleFragment schedule, Context context); @@ -196,7 +187,7 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listApplicable(String resourceGroupName, String labName, String name); @@ -210,7 +201,7 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable listApplicable(String resourceGroupName, String labName, String name, Context context); } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java index 2a2ceaceca42..ceeef77696b5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secret.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.SecretInner; import java.util.Map; @@ -46,6 +47,13 @@ public interface Secret { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the value property: The value of the secret for secret creation. * @@ -200,9 +208,9 @@ interface UpdateStages { /** The stage of the Secret update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java index 979efbf3b2ad..8e32524f7c97 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A secret. */ -@Immutable -public final class SecretFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class SecretFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretList.java index 4bd6052f8032..1ae7c2b2e318 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SecretList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of secrets and their properties. */ @Fluent public final class SecretList { @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretList.class); /* - * Results of the list operation. + * List of secrets and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of secrets and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the SecretList object itself. - */ - public SecretList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the SecretList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java index 95983b15e491..a3cb4f1ad817 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Secrets.java @@ -19,7 +19,7 @@ public interface Secrets { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String username); @@ -29,21 +29,19 @@ public interface Secrets { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param username The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of secrets and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String username, - String expand, String filter, Integer top, String orderby, @@ -70,15 +68,14 @@ PagedIterable list( * @param labName The name of the lab. * @param username The name of the user profile. * @param name The name of the secret. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, String labName, String username, String name, String expand, Context context); + String resourceGroupName, String labName, String username, String name, Context context); /** * Delete secret. @@ -104,7 +101,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String labName, String username, String name, Context context); @@ -116,7 +113,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret along with {@link Response}. */ Secret getById(String id); @@ -124,14 +121,13 @@ Response deleteWithResponse( * Get secret. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=value)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secret. + * @return secret along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete secret. @@ -151,7 +147,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java index 52867db8817e..f1535be7b0f3 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabric.java @@ -6,8 +6,11 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricInner; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of ServiceFabric. */ @@ -47,6 +50,13 @@ public interface ServiceFabric { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the externalServiceFabricId property: The backing service fabric resource's id. * @@ -62,13 +72,6 @@ public interface ServiceFabric { */ String environmentId(); - /** - * Gets the applicableSchedule property: The applicable schedule for the virtual machine. - * - * @return the applicableSchedule value. - */ - ApplicableSchedule applicableSchedule(); - /** * Gets the provisioningState property: The provisioning status of the resource. * @@ -83,6 +86,158 @@ public interface ServiceFabric { */ String uniqueIdentifier(); + /** + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + String provisioningStateApplicableScheduleProvisioningState(); + + /** + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the idPropertiesId property: the fully qualified resource ID for the resource. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the namePropertiesName property: the name of the resource. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the typePropertiesType property: the type of the resource. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the locationPropertiesLocation property: the geo-location where the resource live. + * + * @return the locationPropertiesLocation value. + */ + String locationPropertiesLocation(); + + /** + * Gets the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + Map tagsPropertiesTags(); + /** * Gets the region of the resource. * @@ -231,9 +386,9 @@ interface UpdateStages { /** The stage of the ServiceFabric update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); @@ -270,7 +425,7 @@ interface WithTags { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ Response listApplicableSchedulesWithResponse(Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java index 62f21e5a80ac..90828f4d47cb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A Service Fabric. */ -@Immutable -public final class ServiceFabricFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class ServiceFabricFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceFabricFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricList.java index 87703cf4c31d..9acb4d7b51cb 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of serviceFabrics and their properties. */ @Fluent public final class ServiceFabricList { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceFabricList.class); /* - * Results of the list operation. + * List of serviceFabrics and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of serviceFabrics and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ServiceFabricList object itself. - */ - public ServiceFabricList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the ServiceFabricList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java new file mode 100644 index 000000000000..0fa357679389 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricProperties.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ServiceFabricProperties. */ +public interface ServiceFabricProperties { + /** + * Gets the externalServiceFabricId property: The backing service fabric resource's id. + * + * @return the externalServiceFabricId value. + */ + String externalServiceFabricId(); + + /** + * Gets the environmentId property: The resource id of the environment under which the service fabric resource is + * present. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the systemDataPropertiesSystemData property: The system metadata relating to this resource. + * + * @return the systemDataPropertiesSystemData value. + */ + SystemData systemDataPropertiesSystemData(); + + /** + * Gets the status property: The status of the schedule (i.e. Enabled, Disabled). + * + * @return the status value. + */ + EnableStatus status(); + + /** + * Gets the taskType property: The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + * + * @return the taskType value. + */ + String taskType(); + + /** + * Gets the timeZoneId property: The time zone ID (e.g. Pacific Standard time). + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the createdDate property: The creation date of the schedule. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the targetResourceId property: The resource ID to which the schedule belongs. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the provisioningStateApplicableScheduleProvisioningState property: The provisioning status of the resource. + * + * @return the provisioningStateApplicableScheduleProvisioningState value. + */ + String provisioningStateApplicableScheduleProvisioningState(); + + /** + * Gets the uniqueIdentifierApplicableScheduleUniqueIdentifier property: The unique immutable identifier of a + * resource (Guid). + * + * @return the uniqueIdentifierApplicableScheduleUniqueIdentifier value. + */ + String uniqueIdentifierApplicableScheduleUniqueIdentifier(); + + /** + * Gets the weekdays property: The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, + * etc.). + * + * @return the weekdays value. + */ + List weekdays(); + + /** + * Gets the time property: The time of the day the schedule will occur. + * + * @return the time value. + */ + String time(); + + /** + * Gets the minute property: Minutes of the hour the schedule will run. + * + * @return the minute value. + */ + Integer minute(); + + /** + * Gets the statusNotificationSettingsStatus property: If notifications are enabled for this schedule (i.e. Enabled, + * Disabled). + * + * @return the statusNotificationSettingsStatus value. + */ + EnableStatus statusNotificationSettingsStatus(); + + /** + * Gets the timeInMinutes property: Time in minutes before event at which notification will be sent. + * + * @return the timeInMinutes value. + */ + Integer timeInMinutes(); + + /** + * Gets the webhookUrl property: The webhook URL to which the notification will be sent. + * + * @return the webhookUrl value. + */ + String webhookUrl(); + + /** + * Gets the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon + * separated email addresses). + * + * @return the emailRecipient value. + */ + String emailRecipient(); + + /** + * Gets the notificationLocale property: The locale to use when sending a notification (fallback for unsupported + * languages is EN). + * + * @return the notificationLocale value. + */ + String notificationLocale(); + + /** + * Gets the id property: the fully qualified resource ID for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: the name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: the type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: the geo-location where the resource live. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tagsPropertiesTags property: the tags of the resource. + * + * @return the tagsPropertiesTags value. + */ + Map tagsPropertiesTags(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.ServiceFabricPropertiesInner object. + * + * @return the inner object. + */ + ServiceFabricPropertiesInner innerModel(); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java index ce7640d86d44..75f0430fe289 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabricSchedules.java @@ -21,7 +21,7 @@ public interface ServiceFabricSchedules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String username, String serviceFabricName); @@ -32,22 +32,20 @@ public interface ServiceFabricSchedules { * @param labName The name of the lab. * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String username, String serviceFabricName, - String expand, String filter, Integer top, String orderby, @@ -76,12 +74,11 @@ PagedIterable list( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ Response getWithResponse( String resourceGroupName, @@ -89,7 +86,6 @@ Response getWithResponse( String username, String serviceFabricName, String name, - String expand, Context context); /** @@ -127,7 +123,7 @@ Schedule createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ Response createOrUpdateWithResponse( String resourceGroupName, @@ -164,7 +160,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, @@ -182,7 +178,7 @@ Response deleteWithResponse( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -204,12 +200,12 @@ Schedule update( * @param username The name of the user profile. * @param serviceFabricName The name of the service fabric. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 schedule. + * @return a schedule along with {@link Response}. */ Response updateWithResponse( String resourceGroupName, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java index d2dd3d08907b..3a5e7a95bbf6 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceFabrics.java @@ -19,7 +19,7 @@ public interface ServiceFabrics { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String username); @@ -30,14 +30,14 @@ public interface ServiceFabrics { * @param labName The name of the lab. * @param username The name of the user profile. * @param expand Specify the $expand query. Example: 'properties($expand=applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of serviceFabrics and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, @@ -75,7 +75,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String labName, String username, String name, String expand, Context context); @@ -132,7 +132,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ Response listApplicableSchedulesWithResponse( String resourceGroupName, String labName, String username, String name, Context context); @@ -198,7 +198,7 @@ Response listApplicableSchedulesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric along with {@link Response}. */ ServiceFabric getById(String id); @@ -211,7 +211,7 @@ Response listApplicableSchedulesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service fabric. + * @return service fabric along with {@link Response}. */ Response getByIdWithResponse(String id, String expand, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java index f6e77c327644..f550e34f171c 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunner.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner; import java.util.Map; @@ -47,11 +48,68 @@ public interface ServiceRunner { Map tags(); /** - * Gets the identity property: The identity of the resource. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the identity value. + * @return the systemData value. */ - IdentityProperties identity(); + SystemData systemData(); + + /** + * Gets the identityUsageType property: The purpose of bringing the identity to the lab. Ex: To use during + * Environment creation or to deploy on the VMs. + * + * @return the identityUsageType value. + */ + String identityUsageType(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the typeIdentityType property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @return the typeIdentityType value. + */ + ManagedIdentityType typeIdentityType(); + + /** + * Gets the principalId property: The principal id of resource identity. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the tenantId property: The tenant identifier of resource. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the clientSecretUrl property: The client secret URL of the identity. + * + * @return the clientSecretUrl value. + */ + String clientSecretUrl(); + + /** + * Gets the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned identities. + * + * @return the userAssignedIdentities value. + */ + Map userAssignedIdentities(); /** * Gets the region of the resource. @@ -119,7 +177,14 @@ interface WithParentResource { * The stage of the ServiceRunner definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity { + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentityUsageType, + DefinitionStages.WithTypeIdentityType, + DefinitionStages.WithPrincipalId, + DefinitionStages.WithTenantId, + DefinitionStages.WithClientSecretUrl, + DefinitionStages.WithUserAssignedIdentities { /** * Executes the create request. * @@ -145,15 +210,68 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the ServiceRunner definition allowing to specify identity. */ - interface WithIdentity { + /** The stage of the ServiceRunner definition allowing to specify identityUsageType. */ + interface WithIdentityUsageType { + /** + * Specifies the identityUsageType property: The purpose of bringing the identity to the lab. Ex: To use + * during Environment creation or to deploy on the VMs.. + * + * @param identityUsageType The purpose of bringing the identity to the lab. Ex: To use during Environment + * creation or to deploy on the VMs. + * @return the next definition stage. + */ + WithCreate withIdentityUsageType(String identityUsageType); + } + /** The stage of the ServiceRunner definition allowing to specify typeIdentityType. */ + interface WithTypeIdentityType { + /** + * Specifies the typeIdentityType property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @param typeIdentityType Type of identity (SystemAssigned, UserAssigned, None). + * @return the next definition stage. + */ + WithCreate withTypeIdentityType(ManagedIdentityType typeIdentityType); + } + /** The stage of the ServiceRunner definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal id of resource identity.. + * + * @param principalId The principal id of resource identity. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + /** The stage of the ServiceRunner definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant identifier of resource.. + * + * @param tenantId The tenant identifier of resource. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the ServiceRunner definition allowing to specify clientSecretUrl. */ + interface WithClientSecretUrl { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the clientSecretUrl property: The client secret URL of the identity.. * - * @param identity The identity of the resource. + * @param clientSecretUrl The client secret URL of the identity. * @return the next definition stage. */ - WithCreate withIdentity(IdentityProperties identity); + WithCreate withClientSecretUrl(String clientSecretUrl); + } + /** The stage of the ServiceRunner definition allowing to specify userAssignedIdentities. */ + interface WithUserAssignedIdentities { + /** + * Specifies the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned + * identities.. + * + * @param userAssignedIdentities If Type is 'UserAssigned': List of user assigned identities. + * @return the next definition stage. + */ + WithCreate withUserAssignedIdentities(Map userAssignedIdentities); } } /** @@ -164,7 +282,14 @@ interface WithIdentity { ServiceRunner.Update update(); /** The template for ServiceRunner update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentityUsageType, + UpdateStages.WithTypeIdentityType, + UpdateStages.WithPrincipalId, + UpdateStages.WithTenantId, + UpdateStages.WithClientSecretUrl, + UpdateStages.WithUserAssignedIdentities { /** * Executes the update request. * @@ -192,15 +317,68 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the ServiceRunner update allowing to specify identity. */ - interface WithIdentity { + /** The stage of the ServiceRunner update allowing to specify identityUsageType. */ + interface WithIdentityUsageType { + /** + * Specifies the identityUsageType property: The purpose of bringing the identity to the lab. Ex: To use + * during Environment creation or to deploy on the VMs.. + * + * @param identityUsageType The purpose of bringing the identity to the lab. Ex: To use during Environment + * creation or to deploy on the VMs. + * @return the next definition stage. + */ + Update withIdentityUsageType(String identityUsageType); + } + /** The stage of the ServiceRunner update allowing to specify typeIdentityType. */ + interface WithTypeIdentityType { + /** + * Specifies the typeIdentityType property: Type of identity (SystemAssigned, UserAssigned, None). + * + * @param typeIdentityType Type of identity (SystemAssigned, UserAssigned, None). + * @return the next definition stage. + */ + Update withTypeIdentityType(ManagedIdentityType typeIdentityType); + } + /** The stage of the ServiceRunner update allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal id of resource identity.. + * + * @param principalId The principal id of resource identity. + * @return the next definition stage. + */ + Update withPrincipalId(String principalId); + } + /** The stage of the ServiceRunner update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant identifier of resource.. + * + * @param tenantId The tenant identifier of resource. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the ServiceRunner update allowing to specify clientSecretUrl. */ + interface WithClientSecretUrl { + /** + * Specifies the clientSecretUrl property: The client secret URL of the identity.. + * + * @param clientSecretUrl The client secret URL of the identity. + * @return the next definition stage. + */ + Update withClientSecretUrl(String clientSecretUrl); + } + /** The stage of the ServiceRunner update allowing to specify userAssignedIdentities. */ + interface WithUserAssignedIdentities { /** - * Specifies the identity property: The identity of the resource.. + * Specifies the userAssignedIdentities property: If Type is 'UserAssigned': List of user assigned + * identities.. * - * @param identity The identity of the resource. + * @param userAssignedIdentities If Type is 'UserAssigned': List of user assigned identities. * @return the next definition stage. */ - Update withIdentity(IdentityProperties identity); + Update withUserAssignedIdentities(Map userAssignedIdentities); } } /** diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunnerList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunnerList.java new file mode 100644 index 000000000000..44cf4aae6836 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunnerList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.ServiceRunnerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains a list of serviceRunners and their properties. */ +@Fluent +public final class ServiceRunnerList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRunnerList.class); + + /* + * List of serviceRunners and their properties + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of serviceRunners and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ServiceRunnerList object itself. + */ + public ServiceRunnerList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java index 03fc9e24f09b..098cbdfca535 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/ServiceRunners.java @@ -4,11 +4,41 @@ package com.azure.resourcemanager.devtestlabs.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; /** Resource collection API of ServiceRunners. */ public interface ServiceRunners { + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List service runners in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of serviceRunners and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + /** * Get service runner. * @@ -32,12 +62,12 @@ public interface ServiceRunners { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -49,7 +79,7 @@ public interface ServiceRunners { void delete(String resourceGroupName, String labName, String name); /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. @@ -58,9 +88,8 @@ public interface ServiceRunners { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); + void delete(String resourceGroupName, String labName, String name, Context context); /** * Get service runner. @@ -69,7 +98,7 @@ public interface ServiceRunners { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner along with {@link Response}. */ ServiceRunner getById(String id); @@ -81,12 +110,12 @@ public interface ServiceRunners { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service runner. + * @return service runner along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -96,16 +125,15 @@ public interface ServiceRunners { void deleteById(String id); /** - * Delete service runner. + * Delete service runner. This operation can take a while to complete. * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new ServiceRunner resource. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleries.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleries.java new file mode 100644 index 000000000000..acd0f3a3b37e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleries.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SharedGalleries. */ +public interface SharedGalleries { + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName); + + /** + * List shared galleries in a given lab. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedGalleries and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery. + */ + SharedGallery get(String resourceGroupName, String labName, String name); + + /** + * Get shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String labName, String name); + + /** + * Delete shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the shared gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String labName, String name, Context context); + + /** + * Get shared gallery. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery along with {@link Response}. + */ + SharedGallery getById(String id); + + /** + * Get shared gallery. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared gallery along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete shared gallery. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete shared gallery. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SharedGallery resource. + * + * @param name resource name. + * @return the first stage of the new SharedGallery definition. + */ + SharedGallery.DefinitionStages.Blank define(String name); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGallery.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGallery.java new file mode 100644 index 000000000000..d3b2c707b231 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGallery.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedGalleryInner; +import java.util.Map; + +/** An immutable client-side representation of SharedGallery. */ +public interface SharedGallery { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the galleryId property: The shared image gallery resource Id. + * + * @return the galleryId value. + */ + String galleryId(); + + /** + * Gets the allowAllImages property: Enables all images in the gallery to be available in the lab for VM creation. + * This will override the EnableState on shared images. + * + * @return the allowAllImages value. + */ + EnableState allowAllImages(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.SharedGalleryInner object. + * + * @return the inner object. + */ + SharedGalleryInner innerModel(); + + /** The entirety of the SharedGallery definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The SharedGallery definition stages. */ + interface DefinitionStages { + /** The first stage of the SharedGallery definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SharedGallery definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the SharedGallery definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, labName. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @return the next definition stage. + */ + WithCreate withExistingLab(String resourceGroupName, String labName); + } + /** + * The stage of the SharedGallery definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithGalleryId, DefinitionStages.WithAllowAllImages { + /** + * Executes the create request. + * + * @return the created resource. + */ + SharedGallery create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SharedGallery create(Context context); + } + /** The stage of the SharedGallery definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SharedGallery definition allowing to specify galleryId. */ + interface WithGalleryId { + /** + * Specifies the galleryId property: The shared image gallery resource Id. + * + * @param galleryId The shared image gallery resource Id. + * @return the next definition stage. + */ + WithCreate withGalleryId(String galleryId); + } + /** The stage of the SharedGallery definition allowing to specify allowAllImages. */ + interface WithAllowAllImages { + /** + * Specifies the allowAllImages property: Enables all images in the gallery to be available in the lab for + * VM creation. This will override the EnableState on shared images. + * + * @param allowAllImages Enables all images in the gallery to be available in the lab for VM creation. This + * will override the EnableState on shared images. + * @return the next definition stage. + */ + WithCreate withAllowAllImages(EnableState allowAllImages); + } + } + /** + * Begins update for the SharedGallery resource. + * + * @return the stage of resource update. + */ + SharedGallery.Update update(); + + /** The template for SharedGallery update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SharedGallery apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SharedGallery apply(Context context); + } + /** The SharedGallery update stages. */ + interface UpdateStages { + /** The stage of the SharedGallery update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SharedGallery refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SharedGallery refresh(Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleryFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleryFragment.java new file mode 100644 index 000000000000..a3132866c87f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleryFragment.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Patch. */ +@Fluent +public final class SharedGalleryFragment extends Tags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryFragment.class); + + /** {@inheritDoc} */ + @Override + public SharedGalleryFragment withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleryList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleryList.java new file mode 100644 index 000000000000..fbb91522dc19 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedGalleryList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedGalleryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains a list of sharedGalleries and their properties. */ +@Fluent +public final class SharedGalleryList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedGalleryList.class); + + /* + * List of sharedGalleries and their properties + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of sharedGalleries and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the SharedGalleryList object itself. + */ + public SharedGalleryList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImage.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImage.java new file mode 100644 index 000000000000..e4b829965c35 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImage.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedImageInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SharedImage. */ +public interface SharedImage { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the definitionName property: Shared Image definition name in shared image gallery. + * + * @return the definitionName value. + */ + String definitionName(); + + /** + * Gets the osType property: The operating system of the image. + * + * @return the osType value. + */ + OsType osType(); + + /** + * Gets the imageType property: The type of image in the gallery (generalized or specialized). + * + * @return the imageType value. + */ + ImageType imageType(); + + /** + * Gets the enableState property: Whether or not the image is enabled. + * + * @return the enableState value. + */ + EnableState enableState(); + + /** + * Gets the displayName property: Display name of the image. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the versions property: List of image versions in definition. + * + * @return the versions value. + */ + List versions(); + + /** + * Gets the provisioningState property: The provisioning status of the resource. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.devtestlabs.fluent.models.SharedImageInner object. + * + * @return the inner object. + */ + SharedImageInner innerModel(); + + /** The entirety of the SharedImage definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The SharedImage definition stages. */ + interface DefinitionStages { + /** The first stage of the SharedImage definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SharedImage definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the SharedImage definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, labName, sharedGalleryName. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @return the next definition stage. + */ + WithCreate withExistingSharedgallery(String resourceGroupName, String labName, String sharedGalleryName); + } + /** + * The stage of the SharedImage definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithDefinitionName, + DefinitionStages.WithOsType, + DefinitionStages.WithImageType, + DefinitionStages.WithEnableState, + DefinitionStages.WithDisplayName, + DefinitionStages.WithVersions { + /** + * Executes the create request. + * + * @return the created resource. + */ + SharedImage create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SharedImage create(Context context); + } + /** The stage of the SharedImage definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SharedImage definition allowing to specify definitionName. */ + interface WithDefinitionName { + /** + * Specifies the definitionName property: Shared Image definition name in shared image gallery. + * + * @param definitionName Shared Image definition name in shared image gallery. + * @return the next definition stage. + */ + WithCreate withDefinitionName(String definitionName); + } + /** The stage of the SharedImage definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: The operating system of the image. + * + * @param osType The operating system of the image. + * @return the next definition stage. + */ + WithCreate withOsType(OsType osType); + } + /** The stage of the SharedImage definition allowing to specify imageType. */ + interface WithImageType { + /** + * Specifies the imageType property: The type of image in the gallery (generalized or specialized). + * + * @param imageType The type of image in the gallery (generalized or specialized). + * @return the next definition stage. + */ + WithCreate withImageType(ImageType imageType); + } + /** The stage of the SharedImage definition allowing to specify enableState. */ + interface WithEnableState { + /** + * Specifies the enableState property: Whether or not the image is enabled.. + * + * @param enableState Whether or not the image is enabled. + * @return the next definition stage. + */ + WithCreate withEnableState(EnableState enableState); + } + /** The stage of the SharedImage definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the image. + * + * @param displayName Display name of the image. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the SharedImage definition allowing to specify versions. */ + interface WithVersions { + /** + * Specifies the versions property: List of image versions in definition. + * + * @param versions List of image versions in definition. + * @return the next definition stage. + */ + WithCreate withVersions(List versions); + } + } + /** + * Begins update for the SharedImage resource. + * + * @return the stage of resource update. + */ + SharedImage.Update update(); + + /** The template for SharedImage update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SharedImage apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SharedImage apply(Context context); + } + /** The SharedImage update stages. */ + interface UpdateStages { + /** The stage of the SharedImage update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SharedImage refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SharedImage refresh(Context context); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImageFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImageFragment.java new file mode 100644 index 000000000000..d70115f4e615 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImageFragment.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Map; + +/** Patch. */ +@Fluent +public final class SharedImageFragment extends Tags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedImageFragment.class); + + /** {@inheritDoc} */ + @Override + public SharedImageFragment withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImageList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImageList.java new file mode 100644 index 000000000000..851e9c1f8cb2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImageList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.SharedImageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains a list of sharedImages and their properties. */ +@Fluent +public final class SharedImageList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedImageList.class); + + /* + * List of sharedImages and their properties + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results if there are any + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of sharedImages and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the SharedImageList object itself. + */ + public SharedImageList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImages.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImages.java new file mode 100644 index 000000000000..d663ef390cf3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SharedImages.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SharedImages. */ +public interface SharedImages { + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String labName, String sharedGalleryName); + + /** + * List shared images in a given shared gallery. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. + * @param top The maximum number of resources to return from the operation. Example: '$top=10'. + * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of sharedImages and their properties as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String labName, + String sharedGalleryName, + String expand, + String filter, + Integer top, + String orderby, + Context context); + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image. + */ + SharedImage get(String resourceGroupName, String labName, String sharedGalleryName, String name); + + /** + * Get shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String labName, + String sharedGalleryName, + String name, + String expand, + Context context); + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String labName, String sharedGalleryName, String name); + + /** + * Delete shared image. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param sharedGalleryName The name of the shared gallery. + * @param name The name of the shared image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String labName, String sharedGalleryName, String name, Context context); + + /** + * Get shared image. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image along with {@link Response}. + */ + SharedImage getById(String id); + + /** + * Get shared image. + * + * @param id the resource ID. + * @param expand Specify the $expand query. Example: 'properties($expand=versions)'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return shared image along with {@link Response}. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * Delete shared image. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete shared image. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SharedImage resource. + * + * @param name resource name. + * @return the first stage of the new SharedImage definition. + */ + SharedImage.DefinitionStages.Blank define(String name); +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Sku.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Sku.java new file mode 100644 index 000000000000..010c1db22200 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Sku.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource model definition representing SKU. */ +@Fluent +public class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The name of the SKU. Ex - P3. It is typically a letter+number code + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * This field is required to be implemented by the Resource Provider if the + * service has more than one tier, but is not required on a PUT. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /* + * The SKU size. When the name field is the combination of tier and some + * other value, this would be the standalone code. + */ + @JsonProperty(value = "size") + private String size; + + /* + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /* + * If the SKU supports scale out/in then the capacity integer should be + * included. If scale out/in is not possible for the resource this may be + * omitted. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @param size the size value to set. + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SkuTier.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SkuTier.java new file mode 100644 index 000000000000..a144d0be00b7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SkuTier.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SkuTier. */ +public enum SkuTier { + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageTypes.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageTypes.java new file mode 100644 index 000000000000..d9c6073ee9a1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/StorageTypes.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageTypes. */ +public final class StorageTypes extends ExpandableStringEnum { + /** Static value Standard for StorageTypes. */ + public static final StorageTypes STANDARD = fromString("Standard"); + + /** Static value Premium for StorageTypes. */ + public static final StorageTypes PREMIUM = fromString("Premium"); + + /** Static value StandardSSD for StorageTypes. */ + public static final StorageTypes STANDARD_SSD = fromString("StandardSSD"); + + /** + * Creates or finds a StorageTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageTypes. + */ + @JsonCreator + public static StorageTypes fromString(String name) { + return fromString(name, StorageTypes.class); + } + + /** @return known StorageTypes values. */ + public static Collection values() { + return values(StorageTypes.class); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java index ca16fd91c0be..ee26372ec289 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/SubnetOverride.java @@ -6,8 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.devtestlabs.fluent.models.SubnetSharedPublicIpAddressConfiguration; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Property overrides on a subnet of a virtual network. */ @Fluent @@ -44,7 +46,7 @@ public final class SubnetOverride { * Properties that virtual machines on this subnet will share. */ @JsonProperty(value = "sharedPublicIpAddressConfiguration") - private SubnetSharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration; + private SubnetSharedPublicIpAddressConfiguration innerSharedPublicIpAddressConfiguration; /* * The virtual network pool associated with this subnet. @@ -137,24 +139,13 @@ public SubnetOverride withUsePublicIpAddressPermission(UsagePermissionType usePu } /** - * Get the sharedPublicIpAddressConfiguration property: Properties that virtual machines on this subnet will share. + * Get the innerSharedPublicIpAddressConfiguration property: Properties that virtual machines on this subnet will + * share. * - * @return the sharedPublicIpAddressConfiguration value. + * @return the innerSharedPublicIpAddressConfiguration value. */ - public SubnetSharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration() { - return this.sharedPublicIpAddressConfiguration; - } - - /** - * Set the sharedPublicIpAddressConfiguration property: Properties that virtual machines on this subnet will share. - * - * @param sharedPublicIpAddressConfiguration the sharedPublicIpAddressConfiguration value to set. - * @return the SubnetOverride object itself. - */ - public SubnetOverride withSharedPublicIpAddressConfiguration( - SubnetSharedPublicIpAddressConfiguration sharedPublicIpAddressConfiguration) { - this.sharedPublicIpAddressConfiguration = sharedPublicIpAddressConfiguration; - return this; + private SubnetSharedPublicIpAddressConfiguration innerSharedPublicIpAddressConfiguration() { + return this.innerSharedPublicIpAddressConfiguration; } /** @@ -177,14 +168,39 @@ public SubnetOverride withVirtualNetworkPoolName(String virtualNetworkPoolName) return this; } + /** + * Get the allowedPorts property: Backend ports that virtual machines on this subnet are allowed to expose. + * + * @return the allowedPorts value. + */ + public List allowedPorts() { + return this.innerSharedPublicIpAddressConfiguration() == null + ? null + : this.innerSharedPublicIpAddressConfiguration().allowedPorts(); + } + + /** + * Set the allowedPorts property: Backend ports that virtual machines on this subnet are allowed to expose. + * + * @param allowedPorts the allowedPorts value to set. + * @return the SubnetOverride object itself. + */ + public SubnetOverride withAllowedPorts(List allowedPorts) { + if (this.innerSharedPublicIpAddressConfiguration() == null) { + this.innerSharedPublicIpAddressConfiguration = new SubnetSharedPublicIpAddressConfiguration(); + } + this.innerSharedPublicIpAddressConfiguration().withAllowedPorts(allowedPorts); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sharedPublicIpAddressConfiguration() != null) { - sharedPublicIpAddressConfiguration().validate(); + if (innerSharedPublicIpAddressConfiguration() != null) { + innerSharedPublicIpAddressConfiguration().validate(); } } } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Tags.java similarity index 71% rename from sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java rename to sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Tags.java index 610fd09c3948..ac9cafdb1db2 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UpdateResource.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Tags.java @@ -7,22 +7,24 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Represents an update resource. */ +/** Resource tags. */ @Fluent -public class UpdateResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateResource.class); +public class Tags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Tags.class); /* - * The tags of the resource. + * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** - * Get the tags property: The tags of the resource. + * Get the tags property: Resource tags. * * @return the tags value. */ @@ -31,12 +33,12 @@ public Map tags() { } /** - * Set the tags property: The tags of the resource. + * Set the tags property: Resource tags. * * @param tags the tags value to set. - * @return the UpdateResource object itself. + * @return the Tags object itself. */ - public UpdateResource withTags(Map tags) { + public Tags withTags(Map tags) { this.tags = tags; return this; } diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java index 3374ce601058..b76c802ec702 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/User.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.UserInner; import java.time.OffsetDateTime; @@ -48,18 +49,11 @@ public interface User { Map tags(); /** - * Gets the identity property: The identity of the user. + * Gets the systemData property: The system metadata relating to this resource. * - * @return the identity value. + * @return the systemData value. */ - UserIdentity identity(); - - /** - * Gets the secretStore property: The secret store of the user. - * - * @return the secretStore value. - */ - UserSecretStore secretStore(); + SystemData systemData(); /** * Gets the createdDate property: The creation date of the user profile. @@ -82,6 +76,57 @@ public interface User { */ String uniqueIdentifier(); + /** + * Gets the principalName property: Set to the principal name / UPN of the client JWT making the request. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the principalId property: Set to the principal Id of the client JWT making the request. Service principal + * will not have the principal Id. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the tenantId property: Set to the tenant ID of the client JWT making the request. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the objectId property: Set to the object Id of the client JWT making the request. Not all users have object + * Id. For CSP (reseller) scenarios for example, object Id is not available. + * + * @return the objectId value. + */ + String objectId(); + + /** + * Gets the appId property: Set to the app Id of the client JWT making the request. + * + * @return the appId value. + */ + String appId(); + + /** + * Gets the keyVaultUri property: The URI of the user's Key vault. + * + * @return the keyVaultUri value. + */ + String keyVaultUri(); + + /** + * Gets the keyVaultId property: The ID of the user's Key vault. + * + * @return the keyVaultId value. + */ + String keyVaultId(); + /** * Gets the region of the resource. * @@ -149,7 +194,14 @@ interface WithParentResource { * created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithSecretStore { + extends DefinitionStages.WithTags, + DefinitionStages.WithPrincipalName, + DefinitionStages.WithPrincipalId, + DefinitionStages.WithTenantId, + DefinitionStages.WithObjectId, + DefinitionStages.WithAppId, + DefinitionStages.WithKeyVaultUri, + DefinitionStages.WithKeyVaultId { /** * Executes the create request. * @@ -175,25 +227,80 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the User definition allowing to specify identity. */ - interface WithIdentity { + /** The stage of the User definition allowing to specify principalName. */ + interface WithPrincipalName { + /** + * Specifies the principalName property: Set to the principal name / UPN of the client JWT making the + * request.. + * + * @param principalName Set to the principal name / UPN of the client JWT making the request. + * @return the next definition stage. + */ + WithCreate withPrincipalName(String principalName); + } + /** The stage of the User definition allowing to specify principalId. */ + interface WithPrincipalId { /** - * Specifies the identity property: The identity of the user.. + * Specifies the principalId property: Set to the principal Id of the client JWT making the request. Service + * principal will not have the principal Id.. * - * @param identity The identity of the user. + * @param principalId Set to the principal Id of the client JWT making the request. Service principal will + * not have the principal Id. * @return the next definition stage. */ - WithCreate withIdentity(UserIdentity identity); + WithCreate withPrincipalId(String principalId); } - /** The stage of the User definition allowing to specify secretStore. */ - interface WithSecretStore { + /** The stage of the User definition allowing to specify tenantId. */ + interface WithTenantId { /** - * Specifies the secretStore property: The secret store of the user.. + * Specifies the tenantId property: Set to the tenant ID of the client JWT making the request.. * - * @param secretStore The secret store of the user. + * @param tenantId Set to the tenant ID of the client JWT making the request. * @return the next definition stage. */ - WithCreate withSecretStore(UserSecretStore secretStore); + WithCreate withTenantId(String tenantId); + } + /** The stage of the User definition allowing to specify objectId. */ + interface WithObjectId { + /** + * Specifies the objectId property: Set to the object Id of the client JWT making the request. Not all users + * have object Id. For CSP (reseller) scenarios for example, object Id is not available.. + * + * @param objectId Set to the object Id of the client JWT making the request. Not all users have object Id. + * For CSP (reseller) scenarios for example, object Id is not available. + * @return the next definition stage. + */ + WithCreate withObjectId(String objectId); + } + /** The stage of the User definition allowing to specify appId. */ + interface WithAppId { + /** + * Specifies the appId property: Set to the app Id of the client JWT making the request.. + * + * @param appId Set to the app Id of the client JWT making the request. + * @return the next definition stage. + */ + WithCreate withAppId(String appId); + } + /** The stage of the User definition allowing to specify keyVaultUri. */ + interface WithKeyVaultUri { + /** + * Specifies the keyVaultUri property: The URI of the user's Key vault.. + * + * @param keyVaultUri The URI of the user's Key vault. + * @return the next definition stage. + */ + WithCreate withKeyVaultUri(String keyVaultUri); + } + /** The stage of the User definition allowing to specify keyVaultId. */ + interface WithKeyVaultId { + /** + * Specifies the keyVaultId property: The ID of the user's Key vault.. + * + * @param keyVaultId The ID of the user's Key vault. + * @return the next definition stage. + */ + WithCreate withKeyVaultId(String keyVaultId); } } /** @@ -225,9 +332,9 @@ interface UpdateStages { /** The stage of the User update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java index e2b92acdcd07..755ce5ff50dc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** Profile of a lab user. */ -@Immutable -public final class UserFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class UserFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(UserFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserList.java index f605804172b3..48419d15ef43 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/UserList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of users and their properties. */ @Fluent public final class UserList { @JsonIgnore private final ClientLogger logger = new ClientLogger(UserList.class); /* - * Results of the list operation. + * List of users and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of users and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the UserList object itself. - */ - public UserList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the UserList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java index 4ed220c5034a..ca8962bfb8f5 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/Users.java @@ -18,7 +18,7 @@ public interface Users { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -27,24 +27,17 @@ public interface Users { * * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of users and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( - String resourceGroupName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + String resourceGroupName, String labName, String filter, Integer top, String orderby, Context context); /** * Get user profile. @@ -65,15 +58,13 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param name The name of the user profile. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String labName, String name, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String name, Context context); /** * Delete user profile. This operation can take a while to complete. @@ -107,7 +98,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile along with {@link Response}. */ User getById(String id); @@ -115,14 +106,13 @@ Response getWithResponse( * Get user profile. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=identity)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user profile. + * @return user profile along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** * Delete user profile. This operation can take a while to complete. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java index eca90c4d6233..b7fbea1330a9 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachineSchedules.java @@ -20,7 +20,7 @@ public interface VirtualMachineSchedules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName, String virtualMachineName); @@ -30,21 +30,19 @@ public interface VirtualMachineSchedules { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of schedules and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, String labName, String virtualMachineName, - String expand, String filter, Integer top, String orderby, @@ -71,20 +69,14 @@ PagedIterable list( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param expand Specify the $expand query. Example: 'properties($select=status)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedule. + * @return schedule along with {@link Response}. */ Response getWithResponse( - String resourceGroupName, - String labName, - String virtualMachineName, - String name, - String expand, - Context context); + String resourceGroupName, String labName, String virtualMachineName, String name, Context context); /** * Create or replace an existing schedule. @@ -114,7 +106,7 @@ Schedule createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a schedule. + * @return a schedule along with {@link Response}. */ Response createOrUpdateWithResponse( String resourceGroupName, @@ -148,7 +140,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String labName, String virtualMachineName, String name, Context context); @@ -160,7 +152,7 @@ Response deleteWithResponse( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -176,12 +168,12 @@ Schedule update( * @param labName The name of the lab. * @param virtualMachineName The name of the virtual machine. * @param name The name of the schedule. - * @param schedule A schedule. + * @param schedule Allows modifying tags of schedules. All other properties will be ignored. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 schedule. + * @return a schedule along with {@link Response}. */ Response updateWithResponse( String resourceGroupName, diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java index 0d5d8797dd50..86d1a66963fc 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualMachines.java @@ -18,7 +18,7 @@ public interface VirtualMachines { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -29,14 +29,14 @@ public interface VirtualMachines { * @param labName The name of the lab. * @param expand Specify the $expand query. Example: * 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualMachines and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, @@ -72,7 +72,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String labName, String name, String expand, Context context); @@ -188,6 +188,33 @@ void applyArtifacts( */ void claim(String resourceGroupName, String labName, String name, Context context); + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void clearArtifactResults(String resourceGroupName, String labName, String name); + + /** + * Clears the artifact results of the virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param labName The name of the lab. + * @param name The name of the virtual machine. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response clearArtifactResultsWithResponse( + String resourceGroupName, String labName, String name, Context context); + /** * Detach the specified disk from the virtual machine. This operation can take a while to complete. * @@ -244,7 +271,8 @@ void detachDataDisk( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 string that represents the contents of the RDP file for the virtual machine. + * @return a string that represents the contents of the RDP file for the virtual machine along with {@link + * Response}. */ Response getRdpFileContentsWithResponse( String resourceGroupName, String labName, String name, Context context); @@ -272,7 +300,7 @@ Response getRdpFileContentsWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schedules applicable to a virtual machine. + * @return schedules applicable to a virtual machine along with {@link Response}. */ Response listApplicableSchedulesWithResponse( String resourceGroupName, String labName, String name, Context context); @@ -472,7 +500,7 @@ void resize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine along with {@link Response}. */ LabVirtualMachine getById(String id); @@ -486,7 +514,7 @@ void resize( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual machine. + * @return virtual machine along with {@link Response}. */ Response getByIdWithResponse(String id, String expand, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java index fe8cba896747..55ad1a160b98 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetwork.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.devtestlabs.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.devtestlabs.fluent.models.VirtualNetworkInner; import java.time.OffsetDateTime; @@ -48,6 +49,13 @@ public interface VirtualNetwork { */ Map tags(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the allowedSubnets property: The allowed subnets of the virtual network. * @@ -272,9 +280,9 @@ interface UpdateStages { /** The stage of the VirtualNetwork update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: The tags of the resource.. + * Specifies the tags property: Resource tags. * - * @param tags The tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java index c428930a8331..5f565ae0d652 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkFragment.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.devtestlabs.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; -/** A virtual network. */ -@Immutable -public final class VirtualNetworkFragment extends UpdateResource { +/** Patch. */ +@Fluent +public final class VirtualNetworkFragment extends Tags { @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkFragment.class); /** {@inheritDoc} */ diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkList.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkList.java index c2ae99b6f30e..9c789f3e058a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkList.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworkList.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ +/** Contains a list of virtualNetworks and their properties. */ @Fluent public final class VirtualNetworkList { @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkList.class); /* - * Results of the list operation. + * List of virtualNetworks and their properties */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * URL to get the next set of operation list results if there are any */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: List of virtualNetworks and their properties. * * @return the value value. */ @@ -38,18 +38,7 @@ public List value() { } /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the VirtualNetworkList object itself. - */ - public VirtualNetworkList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ @@ -58,7 +47,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link for next set of results. + * Set the nextLink property: URL to get the next set of operation list results if there are any. * * @param nextLink the nextLink value to set. * @return the VirtualNetworkList object itself. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java index 454e0143f737..4775b676e12a 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/models/VirtualNetworks.java @@ -18,7 +18,7 @@ public interface VirtualNetworks { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String labName); @@ -28,14 +28,14 @@ public interface VirtualNetworks { * @param resourceGroupName The name of the resource group. * @param labName The name of the lab. * @param expand Specify the $expand query. Example: 'properties($expand=externalSubnets)'. - * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName'). + * @param filter The filter to apply to the operation. Example: '$filter=contains(name,'myName')'. * @param top The maximum number of resources to return from the operation. Example: '$top=10'. * @param orderby The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a list operation. + * @return contains a list of virtualNetworks and their properties as paginated response with {@link PagedIterable}. */ PagedIterable list( String resourceGroupName, @@ -70,7 +70,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String labName, String name, String expand, Context context); @@ -107,7 +107,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network along with {@link Response}. */ VirtualNetwork getById(String id); @@ -120,7 +120,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return virtual network. + * @return virtual network along with {@link Response}. */ Response getByIdWithResponse(String id, String expand, Context context); diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java new file mode 100644 index 000000000000..364506c197f2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArmTemplates Get. */ +public final class ArmTemplatesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArmTemplates_Get.json + */ + /** + * Sample code: ArmTemplates_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .getWithResponse( + "resourceGroupName", "{labName}", "{artifactSourceName}", "{armTemplateName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java new file mode 100644 index 000000000000..0999a3f588e0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArmTemplatesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArmTemplates List. */ +public final class ArmTemplatesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArmTemplates_List.json + */ + /** + * Sample code: ArmTemplates_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void armTemplatesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .armTemplates() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0a2bb48a913b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import com.azure.resourcemanager.devtestlabs.models.SourceControlType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources CreateOrUpdate. */ +public final class ArtifactSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_CreateOrUpdate.json + */ + /** + * Sample code: ArtifactSources_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .define("{artifactSourceName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDisplayName("{displayName}") + .withUri("{artifactSourceUri}") + .withSourceType(SourceControlType.fromString("{VsoGit|GitHub|StorageAccount}")) + .withFolderPath("{folderPath}") + .withArmTemplateFolderPath("{armTemplateFolderPath}") + .withBranchRef("{branchRef}") + .withSecurityToken("{securityToken}") + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java new file mode 100644 index 000000000000..c959427b5fb1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Delete. */ +public final class ArtifactSourcesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_Delete.json + */ + /** + * Sample code: ArtifactSources_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .deleteWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java new file mode 100644 index 000000000000..77da6d9c7f82 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources Get. */ +public final class ArtifactSourcesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_Get.json + */ + /** + * Sample code: ArtifactSources_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java new file mode 100644 index 000000000000..d3af9da1718a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ArtifactSources List. */ +public final class ArtifactSourcesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_List.json + */ + /** + * Sample code: ArtifactSources_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.artifactSources().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java new file mode 100644 index 000000000000..4ebc63c5be30 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactSourcesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ArtifactSource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ArtifactSources Update. */ +public final class ArtifactSourcesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ArtifactSources_Update.json + */ + /** + * Sample code: ArtifactSources_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactSourcesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ArtifactSource resource = + manager + .artifactSources() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java new file mode 100644 index 000000000000..2c4a17721930 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGenerateArmTemplateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.FileUploadOptions; +import com.azure.resourcemanager.devtestlabs.models.GenerateArmTemplateRequest; + +/** Samples for Artifacts GenerateArmTemplate. */ +public final class ArtifactsGenerateArmTemplateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Artifacts_GenerateArmTemplate.json + */ + /** + * Sample code: Artifacts_GenerateArmTemplate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGenerateArmTemplate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .generateArmTemplateWithResponse( + "resourceGroupName", + "{labName}", + "{artifactSourceName}", + "{artifactName}", + new GenerateArmTemplateRequest() + .withVirtualMachineName("{vmName}") + .withLocation("{location}") + .withFileUploadOptions(FileUploadOptions.NONE), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java new file mode 100644 index 000000000000..7cec73090ed5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Artifacts Get. */ +public final class ArtifactsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Artifacts_Get.json + */ + /** + * Sample code: Artifacts_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .getWithResponse("resourceGroupName", "{labName}", "{artifactSourceName}", "{artifactName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java new file mode 100644 index 000000000000..9fb5f79a28be --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ArtifactsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Artifacts List. */ +public final class ArtifactsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Artifacts_List.json + */ + /** + * Sample code: Artifacts_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void artifactsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .artifacts() + .list("resourceGroupName", "{labName}", "{artifactSourceName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2ab77a6e2190 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsCreateOrUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +/** Samples for BastionHosts CreateOrUpdate. */ +public final class BastionHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_CreateOrUpdate.json + */ + /** + * Sample code: BastionHosts_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .define("{bastionHostName}") + .withRegion("{location}") + .withExistingVirtualnetwork("resourceGroupName", "{labName}", "{virtualNetworkName}") + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsDeleteSamples.java new file mode 100644 index 000000000000..be0b6966fcf9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for BastionHosts Delete. */ +public final class BastionHostsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_Delete.json + */ + /** + * Sample code: BastionHosts_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .delete("resourceGroupName", "{labName}", "{virtualNetworkName}", "{bastionHostName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsGetSamples.java new file mode 100644 index 000000000000..8b7726217839 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for BastionHosts Get. */ +public final class BastionHostsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_Get.json + */ + /** + * Sample code: BastionHosts_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .getWithResponse( + "resourceGroupName", "{labName}", "{virtualNetworkName}", "{bastionHostName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsListSamples.java new file mode 100644 index 000000000000..92a758c79489 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for BastionHosts List. */ +public final class BastionHostsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_List.json + */ + /** + * Sample code: BastionHosts_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .bastionHosts() + .list("resourceGroupName", "{labName}", "{virtualNetworkName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsUpdateSamples.java new file mode 100644 index 000000000000..7368de92f828 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/BastionHostsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.BastionHost; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BastionHosts Update. */ +public final class BastionHostsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/BastionHosts_Update.json + */ + /** + * Sample code: BastionHosts_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void bastionHostsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + BastionHost resource = + manager + .bastionHosts() + .getWithResponse( + "resourceGroupName", "{labName}", "{virtualNetworkName}", "{bastionHostName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7228bc208a89 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsCreateOrUpdateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.CostThresholdProperties; +import com.azure.resourcemanager.devtestlabs.models.CostThresholdStatus; +import com.azure.resourcemanager.devtestlabs.models.ReportingCycleType; +import com.azure.resourcemanager.devtestlabs.models.TargetCostStatus; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Costs CreateOrUpdate. */ +public final class CostsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Costs_CreateOrUpdate.json + */ + /** + * Sample code: Costs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .costs() + .define("targetCost") + .withExistingLab("resourceGroupName", "{labName}") + .withCurrencyCode("USD") + .withStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00Z")) + .withEndDateTime(OffsetDateTime.parse("2020-12-31T23:59:59Z")) + .withStatus(TargetCostStatus.ENABLED) + .withTarget(100) + .withCostThresholds( + Arrays + .asList( + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000001") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(25.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000002") + .withDisplayOnChart(CostThresholdStatus.ENABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.ENABLED) + .withThresholdValue(50.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000003") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(75.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000004") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(100.0), + new CostThresholdProperties() + .withThresholdId("00000000-0000-0000-0000-000000000005") + .withDisplayOnChart(CostThresholdStatus.DISABLED) + .withSendNotificationWhenExceeded(CostThresholdStatus.DISABLED) + .withThresholdValue(125.0))) + .withCycleStartDateTime(OffsetDateTime.parse("2020-12-01T00:00:00.000Z")) + .withCycleEndDateTime(OffsetDateTime.parse("2020-12-31T00:00:00.000Z")) + .withCycleType(ReportingCycleType.CALENDAR_MONTH) + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java new file mode 100644 index 000000000000..1e2ed96b3ef4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Costs Get. */ +public final class CostsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Costs_Get.json + */ + /** + * Sample code: Costs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.costs().getWithResponse("resourceGroupName", "{labName}", "targetCost", null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsListSamples.java new file mode 100644 index 000000000000..db74c98ea879 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CostsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Costs List. */ +public final class CostsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Costs_List.json + */ + /** + * Sample code: Costs_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void costsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.costs().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..da11baa47c45 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.LinuxOsState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages CreateOrUpdate. */ +public final class CustomImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_CreateOrUpdate.json + */ + /** + * Sample code: CustomImages_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .customImages() + .define("{customImageName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDescription("My Custom Image") + .withSourceVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}") + .withLinuxOsState(LinuxOsState.NON_DEPROVISIONED) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java new file mode 100644 index 000000000000..af593ca13d10 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomImages Delete. */ +public final class CustomImagesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_Delete.json + */ + /** + * Sample code: CustomImages_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().delete("resourceGroupName", "{labName}", "{customImageName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java new file mode 100644 index 000000000000..aeb88f6ecc2d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomImages Get. */ +public final class CustomImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_Get.json + */ + /** + * Sample code: CustomImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().getWithResponse("resourceGroupName", "{labName}", "{customImageName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java new file mode 100644 index 000000000000..08d073d330c9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomImages List. */ +public final class CustomImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_List.json + */ + /** + * Sample code: CustomImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.customImages().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java new file mode 100644 index 000000000000..e891d80ea69f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/CustomImagesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.CustomImage; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CustomImages Update. */ +public final class CustomImagesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/CustomImages_Update.json + */ + /** + * Sample code: CustomImages_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void customImagesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + CustomImage resource = + manager + .customImages() + .getWithResponse("resourceGroupName", "{labName}", "{customImageName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java new file mode 100644 index 000000000000..9aa261fb8021 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksAttachSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.AttachDiskProperties; + +/** Samples for Disks Attach. */ +public final class DisksAttachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Attach.json + */ + /** + * Sample code: Disks_Attach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksAttach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .attach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new AttachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..13c9c18a22c5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for Disks CreateOrUpdate. */ +public final class DisksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_CreateOrUpdate.json + */ + /** + * Sample code: Disks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .define("{diskName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userId}") + .withDiskType(StorageType.STANDARD) + .withDiskSizeGiB(1023) + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName") + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java new file mode 100644 index 000000000000..59a9b0a279ba --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Disks Delete. */ +public final class DisksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Delete.json + */ + /** + * Sample code: Disks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().delete("resourceGroupName", "{labName}", "{userId}", "{diskName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java new file mode 100644 index 000000000000..e5ccecb4c161 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksDetachSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDiskProperties; + +/** Samples for Disks Detach. */ +public final class DisksDetachSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Detach.json + */ + /** + * Sample code: Disks_Detach. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksDetach(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .disks() + .detach( + "resourceGroupName", + "{labName}", + "{userId}", + "{diskName}", + new DetachDiskProperties() + .withLeasedByLabVmId( + "/subscriptions/{subscriptionId}/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java new file mode 100644 index 000000000000..befa07825c54 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Disks Get. */ +public final class DisksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Get.json + */ + /** + * Sample code: Disks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().getWithResponse("resourceGroupName", "{labName}", "@me", "{diskName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java new file mode 100644 index 000000000000..cc02ec446486 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Disks List. */ +public final class DisksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_List.json + */ + /** + * Sample code: Disks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.disks().list("resourceGroupName", "{labName}", "@me", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java new file mode 100644 index 000000000000..e88d0986499b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/DisksUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Disk; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Disks Update. */ +public final class DisksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Disks_Update.json + */ + /** + * Sample code: Disks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void disksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Disk resource = + manager + .disks() + .getWithResponse("resourceGroupName", "{labName}", "@me", "diskName", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..97860a84207c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsCreateOrUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +/** Samples for Environments CreateOrUpdate. */ +public final class EnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_CreateOrUpdate.json + */ + /** + * Sample code: Environments_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .environments() + .define("{environmentName}") + .withRegion((String) null) + .withExistingUser("resourceGroupName", "{labName}", "@me") + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java new file mode 100644 index 000000000000..25ad64c2840b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Environments Delete. */ +public final class EnvironmentsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_Delete.json + */ + /** + * Sample code: Environments_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().delete("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java new file mode 100644 index 000000000000..09caa5c890ba --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Environments Get. */ +public final class EnvironmentsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_Get.json + */ + /** + * Sample code: Environments_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java new file mode 100644 index 000000000000..99b4840cf865 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Environments List. */ +public final class EnvironmentsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_List.json + */ + /** + * Sample code: Environments_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.environments().list("resourceGroupName", "{labName}", "@me", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java new file mode 100644 index 000000000000..dc694d81920d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/EnvironmentsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DtlEnvironment; + +/** Samples for Environments Update. */ +public final class EnvironmentsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Environments_Update.json + */ + /** + * Sample code: Environments_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void environmentsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + DtlEnvironment resource = + manager + .environments() + .getWithResponse("resourceGroupName", "{labName}", "@me", "{environmentName}", Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f28f704c9ae9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import com.azure.resourcemanager.devtestlabs.models.InboundNatRule; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import com.azure.resourcemanager.devtestlabs.models.TransportProtocol; +import java.util.Arrays; + +/** Samples for Formulas CreateOrUpdate. */ +public final class FormulasCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_CreateOrUpdate.json + */ + /** + * Sample code: Formulas_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .formulas() + .define("{formulaName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withDescription("Formula using a Linux base") + .withLocationPropertiesLocation("{location}") + .withNotes("Ubuntu Server 20.10") + .withSize("Standard_B1ms") + .withUsername("user") + .withIsAuthenticationWithSshKey(false) + .withLabSubnetName("Dtl{labName}Subnet") + .withLabVirtualNetworkId("/virtualnetworks/dtl{labName}") + .withDisallowPublicIpAddress(true) + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs") + .withParameters(Arrays.asList()))) + .withAllowClaim(false) + .withStorageType(StorageType.STANDARD) + .withOffer("0001-com-ubuntu-server-groovy") + .withPublisher("canonical") + .withSku("20_10") + .withOsTypeGalleryImageReferenceOsType("Linux") + .withVersion("latest") + .withInboundNatRules( + Arrays.asList(new InboundNatRule().withTransportProtocol(TransportProtocol.TCP).withBackendPort(22))) + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java new file mode 100644 index 000000000000..fd5a429f1450 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Formulas Delete. */ +public final class FormulasDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_Delete.json + */ + /** + * Sample code: Formulas_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().deleteWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java new file mode 100644 index 000000000000..0e56f7d68af1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Formulas Get. */ +public final class FormulasGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_Get.json + */ + /** + * Sample code: Formulas_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().getWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java new file mode 100644 index 000000000000..efefc254836f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Formulas List. */ +public final class FormulasListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_List.json + */ + /** + * Sample code: Formulas_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.formulas().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java new file mode 100644 index 000000000000..ada433c06e60 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Formula; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Formulas Update. */ +public final class FormulasUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Formulas_Update.json + */ + /** + * Sample code: Formulas_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void formulasUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Formula resource = + manager + .formulas() + .getWithResponse("resourceGroupName", "{labName}", "{formulaName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesGetSamples.java new file mode 100644 index 000000000000..6b8a349d4aff --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GalleryImages Get. */ +public final class GalleryImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GalleryImages_Get.json + */ + /** + * Sample code: GalleryImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void galleryImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.galleryImages().getWithResponse("resourceGroupName", "{labName}", "{name}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java new file mode 100644 index 000000000000..aae38e1d9adf --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GalleryImagesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GalleryImages List. */ +public final class GalleryImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GalleryImages_List.json + */ + /** + * Sample code: GalleryImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void galleryImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.galleryImages().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e180185f1f77 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; + +/** Samples for GlobalSchedules CreateOrUpdate. */ +public final class GlobalSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_CreateOrUpdate.json + */ + /** + * Sample code: GlobalSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .define("labvmautostart") + .withRegion("southeastasia") + .withExistingResourceGroup("resourceGroupName") + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsStartupTask") + .withTimeZoneId("Hawaiian Standard Time") + .withWeekdays(Arrays.asList("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")) + .withTime("0700") + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java new file mode 100644 index 000000000000..bc51d072b5fc --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Delete. */ +public final class GlobalSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Delete.json + */ + /** + * Sample code: GlobalSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().deleteWithResponse("resourceGroupName", "labvmautostart", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java new file mode 100644 index 000000000000..0a45f250d6b8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesExecuteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules Execute. */ +public final class GlobalSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Execute.json + */ + /** + * Sample code: GlobalSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().execute("resourceGroupName", "labvmautostart", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3d2821075c2b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules GetByResourceGroup. */ +public final class GlobalSchedulesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Get.json + */ + /** + * Sample code: GlobalSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java new file mode 100644 index 000000000000..00abdf1d0513 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules ListByResourceGroup. */ +public final class GlobalSchedulesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_ListByResourceGroup.json + */ + /** + * Sample code: GlobalSchedules_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListByResourceGroup( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().listByResourceGroup("resourceGroupName", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java new file mode 100644 index 000000000000..17a56991adce --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for GlobalSchedules List. */ +public final class GlobalSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_ListBySubscription.json + */ + /** + * Sample code: GlobalSchedules_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesListBySubscription( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.globalSchedules().list(null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java new file mode 100644 index 000000000000..49ec52da0384 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesRetargetSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.RetargetScheduleProperties; + +/** Samples for GlobalSchedules Retarget. */ +public final class GlobalSchedulesRetargetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Retarget.json + */ + /** + * Sample code: GlobalSchedules_Retarget. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesRetarget(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .globalSchedules() + .retarget( + "resourceGroupName", + "{scheduleName}", + new RetargetScheduleProperties() + .withCurrentResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{targetLab}") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{currentLab}"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java new file mode 100644 index 000000000000..1b1d50057dcb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/GlobalSchedulesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Schedule; +import java.util.HashMap; +import java.util.Map; + +/** Samples for GlobalSchedules Update. */ +public final class GlobalSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/GlobalSchedules_Update.json + */ + /** + * Sample code: GlobalSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void globalSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Schedule resource = + manager + .globalSchedules() + .getByResourceGroupWithResponse("resourceGroupName", "labvmautostart", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b07a6e4d6bd6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +/** Samples for LabSecrets CreateOrUpdate. */ +public final class LabSecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_CreateOrUpdate.json + */ + /** + * Sample code: LabSecrets_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labSecrets() + .define("{secretName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withValue("{secretValue}") + .withEnabledForArtifacts(true) + .withEnabledForVmCreation(true) + .withEnabledForArmEnvironments(true) + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsDeleteSamples.java new file mode 100644 index 000000000000..a0e91420d5ac --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for LabSecrets Delete. */ +public final class LabSecretsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_Delete.json + */ + /** + * Sample code: LabSecrets_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labSecrets().delete("resourceGroupName", "{labName}", "{secretName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsGetSamples.java new file mode 100644 index 000000000000..78dc696d320b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for LabSecrets Get. */ +public final class LabSecretsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_Get.json + */ + /** + * Sample code: LabSecrets_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labSecrets().getWithResponse("resourceGroupName", "{labName}", "{secretName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsListSamples.java new file mode 100644 index 000000000000..f755c8509d71 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for LabSecrets List. */ +public final class LabSecretsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_List.json + */ + /** + * Sample code: LabSecrets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labSecrets().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsUpdateSamples.java new file mode 100644 index 000000000000..378f5271d4de --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabSecretsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.LabSecret; +import java.util.HashMap; +import java.util.Map; + +/** Samples for LabSecrets Update. */ +public final class LabSecretsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/LabSecrets_Update.json + */ + /** + * Sample code: LabSecrets_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labSecretsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + LabSecret resource = + manager + .labSecrets() + .getWithResponse("resourceGroupName", "{labName}", "{secretName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java new file mode 100644 index 000000000000..46a12c08d9c2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsClaimAnyVmSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs ClaimAnyVm. */ +public final class LabsClaimAnyVmSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ClaimAnyVm.json + */ + /** + * Sample code: Labs_ClaimAnyVm. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsClaimAnyVm(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().claimAnyVm("resourceGroupName", "{labName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java new file mode 100644 index 000000000000..bd9b645a3807 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateEnvironmentSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.LabVirtualMachineCreationParameterInner; +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateEnvironment. */ +public final class LabsCreateEnvironmentSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_CreateEnvironment.json + */ + /** + * Sample code: Labs_CreateEnvironment. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateEnvironment(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .createEnvironment( + "resourceGroupName", + "{labName}", + new LabVirtualMachineCreationParameterInner() + .withName("{vmName}") + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withSize("Standard_A2_v2") + .withUsername("{userName}") + .withPassword("{userPassword}") + .withLabSubnetName("{virtualnetwork-subnet-name}") + .withLabVirtualNetworkId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}") + .withDisallowPublicIpAddress(true) + .withAllowClaim(true) + .withStorageType(StorageType.STANDARD) + .withOffer("UbuntuServer") + .withPublisher("Canonical") + .withSku("16.04-LTS") + .withOsTypeGalleryImageReferenceOsType("Linux") + .withVersion("Latest"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..148543f010f6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsCreateOrUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.StorageType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Labs CreateOrUpdate. */ +public final class LabsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_CreateOrUpdate.json + */ + /** + * Sample code: Labs_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .define("{labName}") + .withRegion("{location}") + .withExistingResourceGroup("resourceGroupName") + .withTags(mapOf("tagName1", "tagValue1")) + .withLabStorageType(StorageType.fromString("{Standard|Premium}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java new file mode 100644 index 000000000000..03e5a0000be6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs Delete. */ +public final class LabsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_Delete.json + */ + /** + * Sample code: Labs_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().delete("resourceGroupName", "{labName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsEnsureCurrentUserProfileSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsEnsureCurrentUserProfileSamples.java new file mode 100644 index 000000000000..743a8cdfaa3b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsEnsureCurrentUserProfileSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs EnsureCurrentUserProfile. */ +public final class LabsEnsureCurrentUserProfileSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_EnsureCurrentUserProfile.json + */ + /** + * Sample code: Labs_EnsureCurrentUserProfile. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsEnsureCurrentUserProfile(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().ensureCurrentUserProfileWithResponse("resourceGroupName", "{labName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java new file mode 100644 index 000000000000..866c3fe7519a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsExportResourceUsageSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ExportResourceUsageParameters; +import java.time.OffsetDateTime; + +/** Samples for Labs ExportResourceUsage. */ +public final class LabsExportResourceUsageSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ExportResourceUsage.json + */ + /** + * Sample code: Labs_ExportResourceUsage. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsExportResourceUsage(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .exportResourceUsage( + "resourceGroupName", + "{labName}", + new ExportResourceUsageParameters() + .withBlobStorageAbsoluteSasUri( + "https://invalid.blob.core.windows.net/export.blob?sv=2015-07-08&sig={sas}&sp=rcw") + .withUsageStartDate(OffsetDateTime.parse("2020-12-01T00:00:00Z")), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java new file mode 100644 index 000000000000..37310faa5b3e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGenerateUploadUriSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.GenerateUploadUriParameter; + +/** Samples for Labs GenerateUploadUri. */ +public final class LabsGenerateUploadUriSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_GenerateUploadUri.json + */ + /** + * Sample code: Labs_GenerateUploadUri. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGenerateUploadUri(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .generateUploadUriWithResponse( + "resourceGroupName", + "{labName}", + new GenerateUploadUriParameter().withBlobName("{blob-name}"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6fa60db775c7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs GetByResourceGroup. */ +public final class LabsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_Get.json + */ + /** + * Sample code: Labs_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().getByResourceGroupWithResponse("resourceGroupName", "{labName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java new file mode 100644 index 000000000000..90952194e6c2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsImportVirtualMachineSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ImportLabVirtualMachineRequest; + +/** Samples for Labs ImportVirtualMachine. */ +public final class LabsImportVirtualMachineSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ImportVirtualMachine.json + */ + /** + * Sample code: Labs_ImportVirtualMachine. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsImportVirtualMachine(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .labs() + .importVirtualMachine( + "resourceGroupName", + "{labName}", + new ImportLabVirtualMachineRequest() + .withSourceVirtualMachineResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{otherResourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}") + .withDestinationVirtualMachineName("{vmName}"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java new file mode 100644 index 000000000000..e83f05ad72ea --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs ListByResourceGroup. */ +public final class LabsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ListByResourceGroup.json + */ + /** + * Sample code: Labs_ListByResourceGroup. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListByResourceGroup(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listByResourceGroup("resourceGroupName", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java new file mode 100644 index 000000000000..e7bf41113f55 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs List. */ +public final class LabsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ListBySubscription.json + */ + /** + * Sample code: Labs_ListBySubscription. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListBySubscription(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().list(null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java new file mode 100644 index 000000000000..6e8c62668ccf --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsListVhdsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs ListVhds. */ +public final class LabsListVhdsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_ListVhds.json + */ + /** + * Sample code: Labs_ListVhds. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsListVhds(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.labs().listVhds("resourceGroupName", "{labName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java new file mode 100644 index 000000000000..08a31bc2e5d2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/LabsUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Lab; + +/** Samples for Labs Update. */ +public final class LabsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Labs_Update.json + */ + /** + * Sample code: Labs_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void labsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Lab resource = + manager.labs().getByResourceGroupWithResponse("resourceGroupName", "{labName}", Context.NONE).getValue(); + resource.update().apply(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..65f8576ae97f --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.Event; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import java.util.Arrays; + +/** Samples for NotificationChannels CreateOrUpdate. */ +public final class NotificationChannelsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_CreateOrUpdate.json + */ + /** + * Sample code: NotificationChannels_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .define("{notificationChannelName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("en") + .withDescription("Integration configured for auto-shutdown") + .withEvents(Arrays.asList(new Event().withEventName(NotificationChannelEventType.AUTO_SHUTDOWN))) + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java new file mode 100644 index 000000000000..11edc39b1414 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Delete. */ +public final class NotificationChannelsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Delete.json + */ + /** + * Sample code: NotificationChannels_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .deleteWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java new file mode 100644 index 000000000000..7c43f28a65ac --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for NotificationChannels Get. */ +public final class NotificationChannelsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Get.json + */ + /** + * Sample code: NotificationChannels_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java new file mode 100644 index 000000000000..ac2c829bfbd1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for NotificationChannels List. */ +public final class NotificationChannelsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_List.json + */ + /** + * Sample code: NotificationChannels_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.notificationChannels().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java new file mode 100644 index 000000000000..11e0b94f969a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsNotifySamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannelEventType; +import com.azure.resourcemanager.devtestlabs.models.NotifyParameters; + +/** Samples for NotificationChannels Notify. */ +public final class NotificationChannelsNotifySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Notify.json + */ + /** + * Sample code: NotificationChannels_Notify. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsNotify(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .notificationChannels() + .notifyWithResponse( + "resourceGroupName", + "{labName}", + "{notificationChannelName}", + new NotifyParameters() + .withEventName(NotificationChannelEventType.AUTO_SHUTDOWN) + .withJsonPayload( + "{\"eventType\":\"AutoShutdown\",\"subscriptionId\":\"{subscriptionId}\",\"resourceGroupName\":\"resourceGroupName\",\"labName\":\"{labName}\"}"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java new file mode 100644 index 000000000000..939b96dc4540 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/NotificationChannelsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.NotificationChannel; + +/** Samples for NotificationChannels Update. */ +public final class NotificationChannelsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/NotificationChannels_Update.json + */ + /** + * Sample code: NotificationChannels_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void notificationChannelsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + NotificationChannel resource = + manager + .notificationChannels() + .getWithResponse("resourceGroupName", "{labName}", "{notificationChannelName}", Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java new file mode 100644 index 000000000000..e48fa0c94fa2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/OperationsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations Get. */ +public final class OperationsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Operations_Get.json + */ + /** + * Sample code: Operations_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void operationsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.operations().getWithResponse(null, "{operationName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b40d1c5cec8b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.PolicyEvaluatorType; +import com.azure.resourcemanager.devtestlabs.models.PolicyFactName; +import com.azure.resourcemanager.devtestlabs.models.PolicyStatus; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies CreateOrUpdate. */ +public final class PoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_CreateOrUpdate.json + */ + /** + * Sample code: Policies_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .define("{policyName}") + .withRegion("{location}") + .withExistingPolicyset("resourceGroupName", "{labName}", "{policySetName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDescription("{policyDescription}") + .withStatus(PolicyStatus.fromString("{policyStatus}")) + .withFactName(PolicyFactName.fromString("{policyFactName}")) + .withFactData("{policyFactData}") + .withThreshold("{policyThreshold}") + .withEvaluatorType(PolicyEvaluatorType.fromString("{policyEvaluatorType}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java new file mode 100644 index 000000000000..635deedb3af1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies Delete. */ +public final class PoliciesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_Delete.json + */ + /** + * Sample code: Policies_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .deleteWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java new file mode 100644 index 000000000000..4d1beff407e0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies Get. */ +public final class PoliciesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_Get.json + */ + /** + * Sample code: Policies_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policies() + .getWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java new file mode 100644 index 000000000000..0d2b38404d32 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Policies List. */ +public final class PoliciesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_List.json + */ + /** + * Sample code: Policies_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.policies().list("resourceGroupName", "{labName}", "{policySetName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java new file mode 100644 index 000000000000..eba37f7c1d26 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PoliciesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Policy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Policies Update. */ +public final class PoliciesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Policies_Update.json + */ + /** + * Sample code: Policies_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policiesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Policy resource = + manager + .policies() + .getWithResponse("resourceGroupName", "{labName}", "{policySetName}", "{policyName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java new file mode 100644 index 000000000000..4971a6801509 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsEvaluatePoliciesSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesProperties; +import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; +import java.util.Arrays; + +/** Samples for PolicySets EvaluatePolicies. */ +public final class PolicySetsEvaluatePoliciesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/PolicySets_EvaluatePolicies.json + */ + /** + * Sample code: PolicySets_EvaluatePolicies. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policySetsEvaluatePolicies(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .policySets() + .evaluatePoliciesWithResponse( + "resourceGroupName", + "{labName}", + "{policySetName}", + new EvaluatePoliciesRequest() + .withPolicies( + Arrays + .asList(new EvaluatePoliciesProperties().withFactName("LabVmCount").withValueOffset("1"))), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsListSamples.java new file mode 100644 index 000000000000..2edb24c1cdf5 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/PolicySetsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for PolicySets List. */ +public final class PolicySetsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/PolicySets_List.json + */ + /** + * Sample code: PolicySets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void policySetsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.policySets().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java new file mode 100644 index 000000000000..e355d68ca91a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ProviderOperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ProviderOperations List. */ +public final class ProviderOperationsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ProviderOperations_List.json + */ + /** + * Sample code: ProviderOperations_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void providerOperationsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.providerOperations().list(Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3f46ba48dfad --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesCreateOrUpdateSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Schedules CreateOrUpdate. */ +public final class SchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_CreateOrUpdate.json + */ + /** + * Sample code: Schedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType("{myLabVmTaskType}") + .withTimeZoneId("Pacific Standard Time") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}") + .withWeekdays(Arrays.asList("Monday", "Wednesday", "Friday")) + .withTime("{timeOfTheDayTheScheduleWillOccurOnThoseDays}") + .withMinute(30) + .withStatusNotificationSettingsStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java new file mode 100644 index 000000000000..36f906e3c163 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Delete. */ +public final class SchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Delete.json + */ + /** + * Sample code: Schedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().deleteWithResponse("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java new file mode 100644 index 000000000000..1958f1f6436a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesExecuteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Execute. */ +public final class SchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Execute.json + */ + /** + * Sample code: Schedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().execute("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java new file mode 100644 index 000000000000..4112db1e66d6 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Get. */ +public final class SchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Get.json + */ + /** + * Sample code: Schedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().getWithResponse("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java new file mode 100644 index 000000000000..c77d0c1aa852 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListApplicableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules ListApplicable. */ +public final class SchedulesListApplicableSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_ListApplicable.json + */ + /** + * Sample code: Schedules_ListApplicable. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesListApplicable(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().listApplicable("resourceGroupName", "{labName}", "{scheduleName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java new file mode 100644 index 000000000000..84ac54152d4d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules List. */ +public final class SchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_List.json + */ + /** + * Sample code: Schedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.schedules().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java new file mode 100644 index 000000000000..28a5b43fe49d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SchedulesUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Schedules Update. */ +public final class SchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Schedules_Update.json + */ + /** + * Sample code: Schedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void schedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .schedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7faa44fa4634 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsCreateOrUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +/** Samples for Secrets CreateOrUpdate. */ +public final class SecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_CreateOrUpdate.json + */ + /** + * Sample code: Secrets_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .define("{secretName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withValue("{secret}") + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java new file mode 100644 index 000000000000..51ca89024854 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets Delete. */ +public final class SecretsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_Delete.json + */ + /** + * Sample code: Secrets_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .secrets() + .deleteWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java new file mode 100644 index 000000000000..710dbe7b18cb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_Get.json + */ + /** + * Sample code: Secrets_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.secrets().getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java new file mode 100644 index 000000000000..063e8a59ab7b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets List. */ +public final class SecretsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_List.json + */ + /** + * Sample code: Secrets_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.secrets().list("resourceGroupName", "{labName}", "{userName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java new file mode 100644 index 000000000000..3058f880d12a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SecretsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.Secret; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Secrets Update. */ +public final class SecretsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Secrets_Update.json + */ + /** + * Sample code: Secrets_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void secretsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + Secret resource = + manager + .secrets() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{secretName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..dcbf57dcfdd2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesCreateOrUpdateSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabricSchedules CreateOrUpdate. */ +public final class ServiceFabricSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabricSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTaskType( + "{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}") + .withTimeZoneId("Pacific Standard Time") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}") + .withWeekdays( + Arrays.asList("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")) + .withTime("19:00") + .withMinute(0) + .withStatusNotificationSettingsStatus(EnableStatus.fromString("{Enabled|Disabled}")) + .withTimeInMinutes(15) + .withWebhookUrl("{webhoolUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java new file mode 100644 index 000000000000..8db18c8700e7 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Delete. */ +public final class ServiceFabricSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Delete.json + */ + /** + * Sample code: ServiceFabricSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .deleteWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java new file mode 100644 index 000000000000..f732fa94bfcc --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesExecuteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Execute. */ +public final class ServiceFabricSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Execute.json + */ + /** + * Sample code: ServiceFabricSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesExecute(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .execute("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java new file mode 100644 index 000000000000..6b8c3fb09ea0 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules Get. */ +public final class ServiceFabricSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Get.json + */ + /** + * Sample code: ServiceFabricSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .getWithResponse( + "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java new file mode 100644 index 000000000000..3e18b1ddd75c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabricSchedules List. */ +public final class ServiceFabricSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_List.json + */ + /** + * Sample code: ServiceFabricSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .list("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java new file mode 100644 index 000000000000..996f2aee86f8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricSchedulesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabricSchedules Update. */ +public final class ServiceFabricSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabricSchedules_Update.json + */ + /** + * Sample code: ServiceFabricSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabricSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "@me", + "{serviceFrabicName}", + "{scheduleName}", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6e49eb63baf9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsCreateOrUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics CreateOrUpdate. */ +public final class ServiceFabricsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_CreateOrUpdate.json + */ + /** + * Sample code: ServiceFabrics_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .define("{serviceFabricName}") + .withRegion("{location}") + .withExistingUser("resourceGroupName", "{labName}", "{userName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withExternalServiceFabricId("{serviceFabricId}") + .withEnvironmentId("{environmentId}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java new file mode 100644 index 000000000000..627f201b7cb4 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Delete. */ +public final class ServiceFabricsDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Delete.json + */ + /** + * Sample code: ServiceFabrics_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .delete("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java new file mode 100644 index 000000000000..a234907c8305 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Get. */ +public final class ServiceFabricsGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Get.json + */ + /** + * Sample code: ServiceFabrics_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .getWithResponse("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java new file mode 100644 index 000000000000..3c570dd9f1d8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListApplicableSchedulesSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics ListApplicableSchedules. */ +public final class ServiceFabricsListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_ListApplicableSchedules.json + */ + /** + * Sample code: ServiceFabrics_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .listApplicableSchedulesWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java new file mode 100644 index 000000000000..b4936b2c647b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics List. */ +public final class ServiceFabricsListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_List.json + */ + /** + * Sample code: ServiceFabrics_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .list("resourceGroupName", "{labName}", "{userName}", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java new file mode 100644 index 000000000000..b21d7053af8b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStartSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Start. */ +public final class ServiceFabricsStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Start.json + */ + /** + * Sample code: ServiceFabrics_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .start("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java new file mode 100644 index 000000000000..a82a00430a5a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsStopSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceFabrics Stop. */ +public final class ServiceFabricsStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Stop.json + */ + /** + * Sample code: ServiceFabrics_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceFabrics() + .stop("resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java new file mode 100644 index 000000000000..dd458ee684e2 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceFabricsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ServiceFabric; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceFabrics Update. */ +public final class ServiceFabricsUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceFabrics_Update.json + */ + /** + * Sample code: ServiceFabrics_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceFabricsUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + ServiceFabric resource = + manager + .serviceFabrics() + .getWithResponse( + "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8dad20efc4cc --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.ManagedIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ServiceRunners CreateOrUpdate. */ +public final class ServiceRunnersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_CreateOrUpdate.json + */ + /** + * Sample code: ServiceRunners_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .define("{servicerunnerName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withTypeIdentityType(ManagedIdentityType.fromString("{identityType}")) + .withPrincipalId("{identityPrincipalId}") + .withTenantId("{identityTenantId}") + .withClientSecretUrl("{identityClientSecretUrl}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java new file mode 100644 index 000000000000..e5d1e15bed62 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Delete. */ +public final class ServiceRunnersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_Delete.json + */ + /** + * Sample code: ServiceRunners_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.serviceRunners().delete("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java new file mode 100644 index 000000000000..83c66e5d8831 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceRunners Get. */ +public final class ServiceRunnersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_Get.json + */ + /** + * Sample code: ServiceRunners_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .serviceRunners() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{servicerunnerName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersListSamples.java new file mode 100644 index 000000000000..e71a816eaa39 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/ServiceRunnersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceRunners List. */ +public final class ServiceRunnersListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/ServiceRunners_List.json + */ + /** + * Sample code: ServiceRunners_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void serviceRunnersList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.serviceRunners().list("resourceGroupName", "{devtestlabName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0a9f0e8c0823 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesCreateOrUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedGalleries CreateOrUpdate. */ +public final class SharedGalleriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_CreateOrUpdate.json + */ + /** + * Sample code: SharedGalleries_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedGalleries() + .define("{sharedGalleryName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withGalleryId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.compute/galleries/{sharedGalleryName}") + .withAllowAllImages(EnableState.fromString("{Enabled|Disabled}")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesDeleteSamples.java new file mode 100644 index 000000000000..5c285a4e82be --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedGalleries Delete. */ +public final class SharedGalleriesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_Delete.json + */ + /** + * Sample code: SharedGalleries_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedGalleries() + .deleteWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesGetSamples.java new file mode 100644 index 000000000000..0c37220bc331 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedGalleries Get. */ +public final class SharedGalleriesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_Get.json + */ + /** + * Sample code: SharedGalleries_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedGalleries() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesListSamples.java new file mode 100644 index 000000000000..fd43cfcdf7d3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedGalleries List. */ +public final class SharedGalleriesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_List.json + */ + /** + * Sample code: SharedGalleries_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.sharedGalleries().list("resourceGroupName", "{labName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesUpdateSamples.java new file mode 100644 index 000000000000..2892034687b1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedGalleriesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.SharedGallery; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedGalleries Update. */ +public final class SharedGalleriesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedGalleries_Update.json + */ + /** + * Sample code: SharedGalleries_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedGalleriesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + SharedGallery resource = + manager + .sharedGalleries() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c221c93fc54e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesCreateOrUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.resourcemanager.devtestlabs.models.EnableState; +import com.azure.resourcemanager.devtestlabs.models.ImageType; +import com.azure.resourcemanager.devtestlabs.models.OsType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedImages CreateOrUpdate. */ +public final class SharedImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_CreateOrUpdate.json + */ + /** + * Sample code: SharedImages_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .define("{name}") + .withRegion("{location}") + .withExistingSharedgallery("resourceGroupName", "{labName}", "{sharedGalleryName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withDefinitionName("{definitionName}") + .withOsType(OsType.fromString("{osType}")) + .withImageType(ImageType.fromString("{imageType}")) + .withEnableState(EnableState.fromString("{enabledState}")) + .withDisplayName("{displayName}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesDeleteSamples.java new file mode 100644 index 000000000000..87c8df2923b8 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedImages Delete. */ +public final class SharedImagesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_Delete.json + */ + /** + * Sample code: SharedImages_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .deleteWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", "{name}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesGetSamples.java new file mode 100644 index 000000000000..d3a6ed42079b --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedImages Get. */ +public final class SharedImagesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_Get.json + */ + /** + * Sample code: SharedImages_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", "{name}", null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesListSamples.java new file mode 100644 index 000000000000..7f8e556305f9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for SharedImages List. */ +public final class SharedImagesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_List.json + */ + /** + * Sample code: SharedImages_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .sharedImages() + .list("resourceGroupName", "{labName}", "{sharedGalleryName}", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesUpdateSamples.java new file mode 100644 index 000000000000..3465cf8d66dc --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/SharedImagesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.SharedImage; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SharedImages Update. */ +public final class SharedImagesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/SharedImages_Update.json + */ + /** + * Sample code: SharedImages_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void sharedImagesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + SharedImage resource = + manager + .sharedImages() + .getWithResponse("resourceGroupName", "{labName}", "{sharedGalleryName}", "{name}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3b1314ab83f3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users CreateOrUpdate. */ +public final class UsersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_CreateOrUpdate.json + */ + /** + * Sample code: Users_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .users() + .define("{userName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{devtestlabName}") + .withTags(mapOf("tagName1", "tagValue1")) + .withPrincipalName("{principalName}") + .withPrincipalId("{principalId}") + .withTenantId("{tenantId}") + .withObjectId("{objectId}") + .withAppId("{appId}") + .withKeyVaultUri("{keyVaultUri}") + .withKeyVaultId("{keyVaultId}") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java new file mode 100644 index 000000000000..0c2c8761021e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Users Delete. */ +public final class UsersDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_Delete.json + */ + /** + * Sample code: Users_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().delete("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java new file mode 100644 index 000000000000..e526458278ab --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Users Get. */ +public final class UsersGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_Get.json + */ + /** + * Sample code: Users_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java new file mode 100644 index 000000000000..336767bd1ce9 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for Users List. */ +public final class UsersListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_List.json + */ + /** + * Sample code: Users_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.users().list("resourceGroupName", "{devtestlabName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java new file mode 100644 index 000000000000..b28b74993079 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/UsersUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.User; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Users Update. */ +public final class UsersUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/Users_Update.json + */ + /** + * Sample code: Users_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void usersUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + User resource = + manager + .users() + .getWithResponse("resourceGroupName", "{devtestlabName}", "{userName}", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2a72fa53f603 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesCreateOrUpdateSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.fluent.models.ScheduleInner; +import com.azure.resourcemanager.devtestlabs.models.EnableStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineSchedules CreateOrUpdate. */ +public final class VirtualMachineSchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachineSchedules_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesCreateOrUpdate( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .createOrUpdateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleInner() + .withLocation("{location}") + .withTags(mapOf("tagName1", "tagValue1")) + .withStatus(EnableStatus.ENABLED) + .withTaskType("LabVmsShutdownTask") + .withTimeZoneId("Pacific Standard Time") + .withTargetResourceId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}") + .withWeekdays(Arrays.asList("Friday", "Saturday", "Sunday")) + .withTime("1700") + .withMinute(30) + .withStatusNotificationSettingsStatus(EnableStatus.ENABLED) + .withTimeInMinutes(30) + .withWebhookUrl("{webhookUrl}") + .withEmailRecipient("{email}") + .withNotificationLocale("EN"), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java new file mode 100644 index 000000000000..eeefdb57d084 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Delete. */ +public final class VirtualMachineSchedulesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Delete.json + */ + /** + * Sample code: VirtualMachineSchedules_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .deleteWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java new file mode 100644 index 000000000000..fe623c12b20d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesExecuteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Execute. */ +public final class VirtualMachineSchedulesExecuteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Execute.json + */ + /** + * Sample code: VirtualMachineSchedules_Execute. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesExecute( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .execute("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java new file mode 100644 index 000000000000..5e831b0fb574 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules Get. */ +public final class VirtualMachineSchedulesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Get.json + */ + /** + * Sample code: VirtualMachineSchedules_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java new file mode 100644 index 000000000000..b4043207b783 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachineSchedules List. */ +public final class VirtualMachineSchedulesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_List.json + */ + /** + * Sample code: VirtualMachineSchedules_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .list("resourceGroupName", "{labName}", "{vmName}", null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java new file mode 100644 index 000000000000..cf6f96d02312 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachineSchedulesUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ScheduleFragment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachineSchedules Update. */ +public final class VirtualMachineSchedulesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachineSchedules_Update.json + */ + /** + * Sample code: VirtualMachineSchedules_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachineSchedulesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachineSchedules() + .updateWithResponse( + "resourceGroupName", + "{labName}", + "{vmName}", + "LabVmsShutdown", + new ScheduleFragment().withTags(mapOf("tagName1", "tagValue1")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java new file mode 100644 index 000000000000..7d323085d675 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesAddDataDiskSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DataDiskProperties; +import com.azure.resourcemanager.devtestlabs.models.StorageType; + +/** Samples for VirtualMachines AddDataDisk. */ +public final class VirtualMachinesAddDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_AddDataDisk.json + */ + /** + * Sample code: VirtualMachines_AddDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesAddDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .addDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DataDiskProperties() + .withDiskSizeGiB(127) + .withDiskName("{diskName}") + .withDiskType(StorageType.fromString("{diskType}")), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java new file mode 100644 index 000000000000..d8d3409d8074 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesApplyArtifactsSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ApplyArtifactsRequest; +import com.azure.resourcemanager.devtestlabs.models.ArtifactInstallProperties; +import java.util.Arrays; + +/** Samples for VirtualMachines ApplyArtifacts. */ +public final class VirtualMachinesApplyArtifactsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_ApplyArtifacts.json + */ + /** + * Sample code: VirtualMachines_ApplyArtifacts. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesApplyArtifacts(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .applyArtifacts( + "resourceGroupName", + "{labName}", + "{vmName}", + new ApplyArtifactsRequest() + .withArtifacts( + Arrays + .asList( + new ArtifactInstallProperties() + .withArtifactId( + "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/public" + + " repo/artifacts/windows-restart"))), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java new file mode 100644 index 000000000000..e13e0e47ee68 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClaimSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Claim. */ +public final class VirtualMachinesClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Claim.json + */ + /** + * Sample code: VirtualMachines_Claim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().claim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClearArtifactResultsSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClearArtifactResultsSamples.java new file mode 100644 index 000000000000..27defe755ced --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesClearArtifactResultsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ClearArtifactResults. */ +public final class VirtualMachinesClearArtifactResultsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_ClearArtifactResults.json + */ + /** + * Sample code: VirtualMachines_ClearArtifactResults. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesClearArtifactResults( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .clearArtifactResultsWithResponse("resourceGroupName", "{labName}", "{vmNname}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8b729930d2c3 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesCreateOrUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_CreateOrUpdate.json + */ + /** + * Sample code: VirtualMachines_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .define("{vmName}") + .withRegion((String) null) + .withExistingLab("resourceGroupName", "{labName}") + .create(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java new file mode 100644 index 000000000000..e75b51f7d699 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Delete.json + */ + /** + * Sample code: VirtualMachines_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().delete("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java new file mode 100644 index 000000000000..f542e225f163 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesDetachDataDiskSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.DetachDataDiskProperties; + +/** Samples for VirtualMachines DetachDataDisk. */ +public final class VirtualMachinesDetachDataDiskSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_DetachDataDisk.json + */ + /** + * Sample code: VirtualMachines_DetachDataDisk. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesDetachDataDisk(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .detachDataDisk( + "resourceGroupName", + "{labName}", + "{virtualMachineName}", + new DetachDataDiskProperties() + .withExistingLabDiskId( + "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{virtualMachineName}"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java new file mode 100644 index 000000000000..e8c4bba1b810 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetRdpFileContentsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines GetRdpFileContents. */ +public final class VirtualMachinesGetRdpFileContentsSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_GetRdpFileContents.json + */ + /** + * Sample code: VirtualMachines_GetRdpFileContents. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGetRdpFileContents( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .getRdpFileContentsWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java new file mode 100644 index 000000000000..cf5437c6aacc --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Get. */ +public final class VirtualMachinesGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Get.json + */ + /** + * Sample code: VirtualMachines_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java new file mode 100644 index 000000000000..153838174a4d --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListApplicableSchedulesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ListApplicableSchedules. */ +public final class VirtualMachinesListApplicableSchedulesSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_ListApplicableSchedules.json + */ + /** + * Sample code: VirtualMachines_ListApplicableSchedules. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesListApplicableSchedules( + com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .listApplicableSchedulesWithResponse("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java new file mode 100644 index 000000000000..0a946bbd55f1 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_List.json + */ + /** + * Sample code: VirtualMachines_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java new file mode 100644 index 000000000000..111bddc38dfe --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRedeploySamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Redeploy.json + */ + /** + * Sample code: VirtualMachines_Redeploy. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRedeploy(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().redeploy("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java new file mode 100644 index 000000000000..cc480b93405c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesResizeSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.ResizeLabVirtualMachineProperties; + +/** Samples for VirtualMachines Resize. */ +public final class VirtualMachinesResizeSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Resize.json + */ + /** + * Sample code: VirtualMachines_Resize. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesResize(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualMachines() + .resize( + "resourceGroupName", + "{labName}", + "{vmName}", + new ResizeLabVirtualMachineProperties().withSize("Standard_A4_v2"), + Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java new file mode 100644 index 000000000000..a9739f84b54c --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesRestartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Restart.json + */ + /** + * Sample code: VirtualMachines_Restart. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesRestart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().restart("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java new file mode 100644 index 000000000000..07389dc5f92a --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Start.json + */ + /** + * Sample code: VirtualMachines_Start. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStart(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().start("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java new file mode 100644 index 000000000000..7f9988196901 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesStopSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Stop. */ +public final class VirtualMachinesStopSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Stop.json + */ + /** + * Sample code: VirtualMachines_Stop. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesStop(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().stop("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java new file mode 100644 index 000000000000..453336856c60 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesTransferDisksSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines TransferDisks. */ +public final class VirtualMachinesTransferDisksSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_TransferDisks.json + */ + /** + * Sample code: VirtualMachines_TransferDisks. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesTransferDisks(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().transferDisks("resourceGroupName", "{labName}", "{virtualmachineName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java new file mode 100644 index 000000000000..f067f4f627da --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUnClaimSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines UnClaim. */ +public final class VirtualMachinesUnClaimSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_UnClaim.json + */ + /** + * Sample code: VirtualMachines_UnClaim. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUnClaim(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualMachines().unClaim("resourceGroupName", "{labName}", "{vmName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java new file mode 100644 index 000000000000..91b8c3960e44 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualMachinesUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachine; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualMachines_Update.json + */ + /** + * Sample code: VirtualMachines_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualMachinesUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + LabVirtualMachine resource = + manager + .virtualMachines() + .getWithResponse("resourceGroupName", "{labName}", "{vmName}", null, Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..00a8b9d72afb --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks CreateOrUpdate. */ +public final class VirtualNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_CreateOrUpdate.json + */ + /** + * Sample code: VirtualNetworks_CreateOrUpdate. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksCreateOrUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .define("{virtualNetworkName}") + .withRegion("{location}") + .withExistingLab("resourceGroupName", "{labName}") + .withTags(mapOf("tagName1", "tagValue1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java new file mode 100644 index 000000000000..215aad613133 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Delete. */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_Delete.json + */ + /** + * Sample code: VirtualNetworks_Delete. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksDelete(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().delete("resourceGroupName", "{labName}", "{virtualNetworkName}", Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java new file mode 100644 index 000000000000..3664504cd15e --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Get. */ +public final class VirtualNetworksGetSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_Get.json + */ + /** + * Sample code: VirtualNetworks_Get. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksGet(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java new file mode 100644 index 000000000000..c89bcaacf397 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks List. */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_List.json + */ + /** + * Sample code: VirtualNetworks_List. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksList(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + manager.virtualNetworks().list("resourceGroupName", "{labName}", null, null, null, null, Context.NONE); + } +} diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java new file mode 100644 index 000000000000..116e9e5bcd18 --- /dev/null +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/VirtualNetworksUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.devtestlabs.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.devtestlabs.models.VirtualNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualNetworks Update. */ +public final class VirtualNetworksUpdateSamples { + /* + * x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2021-09-01/examples/VirtualNetworks_Update.json + */ + /** + * Sample code: VirtualNetworks_Update. + * + * @param manager Entry point to DevTestLabsManager. + */ + public static void virtualNetworksUpdate(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) { + VirtualNetwork resource = + manager + .virtualNetworks() + .getWithResponse("resourceGroupName", "{labName}", "{virtualNetworkName}", null, Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tagName1", "tagValue1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +}