From 79558e0044f2908fdbf695139c8d0defecc995ce Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Sun, 16 Jan 2022 20:05:18 -0800 Subject: [PATCH] [Automation] Generate Fluent Lite from labservices#package-preview-2021-11 (#26530) --- .../CHANGELOG.md | 581 ++- .../README.md | 13 +- .../SAMPLE.md | 1118 ++++++ .../azure-resourcemanager-labservices/pom.xml | 98 +- ...bsManager.java => LabServicesManager.java} | 199 +- .../fluent/EnvironmentSettingsClient.java | 530 --- .../fluent/EnvironmentsClient.java | 609 ---- .../fluent/GalleryImagesClient.java | 188 - .../labservices/fluent/GlobalUsersClient.java | 404 --- .../labservices/fluent/ImagesClient.java | 147 + .../labservices/fluent/LabAccountsClient.java | 274 -- .../labservices/fluent/LabPlansClient.java | 351 ++ ...LabsClient.java => LabServicesClient.java} | 65 +- .../labservices/fluent/LabsClient.java | 362 +- .../fluent/OperationResultsClient.java | 39 + .../labservices/fluent/OperationsClient.java | 25 +- .../labservices/fluent/SchedulesClient.java | 223 ++ ...rOperationsClient.java => SkusClient.java} | 19 +- .../labservices/fluent/UsagesClient.java | 40 + .../labservices/fluent/UsersClient.java | 346 +- .../fluent/VirtualMachinesClient.java | 421 +++ .../fluent/models/EnvironmentInner.java | 269 -- .../models/EnvironmentSettingInner.java | 269 -- .../fluent/models/GalleryImageInner.java | 286 -- .../models/GetEnvironmentResponseInner.java | 43 - .../GetPersonalPreferencesResponseInner.java | 77 - .../GetRegionalAvailabilityResponseInner.java | 56 - .../labservices/fluent/models/ImageInner.java | 240 ++ .../fluent/models/ImageProperties.java | 275 ++ .../fluent/models/ImageUpdateProperties.java | 51 + .../fluent/models/LabAccountInner.java | 158 - .../labservices/fluent/models/LabInner.java | 321 +- .../fluent/models/LabPlanInner.java | 271 ++ .../fluent/models/LabPlanProperties.java | 96 + .../models/LabPlanUpdateProperties.java | 247 ++ .../fluent/models/LabProperties.java | 152 + .../fluent/models/LabServicesSkuInner.java | 203 ++ .../fluent/models/LabUpdateProperties.java | 265 ++ .../models/ListEnvironmentsResponseInner.java | 55 - .../fluent/models/ListLabsResponseInner.java | 55 - .../OperationBatchStatusResponseInner.java | 44 - .../fluent/models/OperationInner.java | 125 + .../fluent/models/OperationMetadataInner.java | 80 - .../fluent/models/OperationResultInner.java | 144 +- .../models/OperationStatusResponseInner.java | 39 - .../fluent/models/ScheduleInner.java | 194 + .../fluent/models/ScheduleProperties.java | 79 + .../models/ScheduleUpdateProperties.java | 165 + .../labservices/fluent/models/UsageInner.java | 159 + .../labservices/fluent/models/UserInner.java | 190 +- .../fluent/models/UserProperties.java | 159 + .../fluent/models/UserUpdateProperties.java | 54 + .../fluent/models/VirtualMachineInner.java | 113 + .../models/VirtualMachineProperties.java | 106 + .../fluent/models/package-info.java | 2 +- .../labservices/fluent/package-info.java | 2 +- .../implementation/EnvironmentImpl.java | 379 -- .../EnvironmentSettingImpl.java | 357 -- .../EnvironmentSettingsClientImpl.java | 2731 -------------- .../EnvironmentSettingsImpl.java | 323 -- .../EnvironmentsClientImpl.java | 3144 ----------------- .../implementation/EnvironmentsImpl.java | 428 --- .../implementation/GalleryImageImpl.java | 284 -- .../implementation/GalleryImagesImpl.java | 200 -- .../GetEnvironmentResponseImpl.java | 34 - .../GetPersonalPreferencesResponseImpl.java | 44 - .../GetRegionalAvailabilityResponseImpl.java | 41 - .../implementation/GlobalUsersClientImpl.java | 1908 ---------- .../implementation/GlobalUsersImpl.java | 237 -- .../labservices/implementation/ImageImpl.java | 228 ++ .../implementation/ImagesClientImpl.java | 966 +++++ .../implementation/ImagesImpl.java | 130 + .../implementation/LabAccountImpl.java | 251 -- .../implementation/LabAccountsImpl.java | 214 -- .../labservices/implementation/LabImpl.java | 195 +- .../implementation/LabPlanImpl.java | 293 ++ ...lientImpl.java => LabPlansClientImpl.java} | 1415 ++++---- .../implementation/LabPlansImpl.java | 179 + ...der.java => LabServicesClientBuilder.java} | 44 +- ...ntImpl.java => LabServicesClientImpl.java} | 156 +- .../implementation/LabServicesSkuImpl.java | 95 + .../implementation/LabsClientImpl.java | 1667 +++++---- .../labservices/implementation/LabsImpl.java | 114 +- .../ListEnvironmentsResponseImpl.java | 41 - .../implementation/ListLabsResponseImpl.java | 40 - .../OperationBatchStatusResponseImpl.java | 41 - .../implementation/OperationImpl.java | 50 + .../implementation/OperationMetadataImpl.java | 37 - .../implementation/OperationResultImpl.java | 34 +- .../OperationResultsClientImpl.java | 202 ++ .../implementation/OperationResultsImpl.java | 59 + .../OperationStatusResponseImpl.java | 33 - .../implementation/OperationsClientImpl.java | 242 +- .../implementation/OperationsImpl.java | 38 +- .../ProviderOperationsImpl.java | 46 - .../implementation/ScheduleImpl.java | 215 ++ ...ientImpl.java => SchedulesClientImpl.java} | 1010 +++--- .../implementation/SchedulesImpl.java | 189 + ...onsClientImpl.java => SkusClientImpl.java} | 150 +- .../labservices/implementation/SkusImpl.java | 45 + .../labservices/implementation/UsageImpl.java | 49 + .../implementation/UsagesClientImpl.java | 341 ++ .../implementation/UsagesImpl.java | 46 + .../labservices/implementation/UserImpl.java | 139 +- .../implementation/UsersClientImpl.java | 1402 +++++--- .../labservices/implementation/UsersImpl.java | 99 +- .../implementation/VirtualMachineImpl.java | 69 + .../VirtualMachinesClientImpl.java | 2062 +++++++++++ .../implementation/VirtualMachinesImpl.java | 117 + .../implementation/package-info.java | 2 +- .../labservices/models/ActionType.java | 31 + .../labservices/models/AddRemove.java | 34 - .../labservices/models/AddUsersPayload.java | 56 - .../models/AutoShutdownProfile.java | 191 + .../models/ConfigurationState.java | 34 - .../labservices/models/ConnectionProfile.java | 128 + .../labservices/models/ConnectionType.java | 50 + .../models/CreateLabProperties.java | 172 - .../labservices/models/CreateOption.java | 47 + ...erenceVmFragment.java => Credentials.java} | 35 +- .../labservices/models/EnableState.java | 47 + .../labservices/models/Environment.java | 431 --- .../models/EnvironmentDetails.java | 171 - .../models/EnvironmentFragment.java | 123 - .../models/EnvironmentOperationsPayload.java | 56 - .../models/EnvironmentSetting.java | 481 --- .../EnvironmentSettingCreationParameters.java | 60 - .../models/EnvironmentSettingFragment.java | 201 -- .../models/EnvironmentSettings.java | 313 -- .../labservices/models/EnvironmentSize.java | 134 - .../models/EnvironmentSizeFragment.java | 80 - .../labservices/models/Environments.java | 361 -- .../labservices/models/GalleryImage.java | 394 --- .../models/GalleryImageFragment.java | 172 - .../models/GetEnvironmentResponse.java | 24 - .../GetPersonalPreferencesResponse.java | 32 - .../GetRegionalAvailabilityResponse.java | 25 - .../labservices/models/GlobalUsers.java | 272 -- .../labservices/models/Image.java | 274 ++ ...mageReference.java => ImageReference.java} | 111 +- .../labservices/models/ImageUpdate.java | 66 + .../labservices/models/Images.java | 100 + .../labservices/models/InvitationState.java | 53 + ...vironmentsPayload.java => InviteBody.java} | 30 +- .../labservices/models/Lab.java | 338 +- .../labservices/models/LabAccount.java | 338 -- .../models/LabAccountFragment.java | 120 - .../labservices/models/LabAccounts.java | 220 -- .../models/LabCreationParameters.java | 50 - .../labservices/models/LabDetails.java | 118 - .../labservices/models/LabFragment.java | 174 - .../labservices/models/LabNetworkProfile.java | 102 + .../labservices/models/LabPlan.java | 475 +++ .../models/LabPlanNetworkProfile.java | 50 + .../labservices/models/LabPlanUpdate.java | 228 ++ .../labservices/models/LabPlans.java | 191 + .../labservices/models/LabServicesSku.java | 88 + .../models/LabServicesSkuCapabilities.java | 54 + .../models/LabServicesSkuCapacity.java | 84 + .../models/LabServicesSkuCost.java | 69 + .../models/LabServicesSkuRestrictions.java | 70 + .../models/LabServicesSkuTier.java | 34 + .../labservices/models/LabState.java | 56 + .../labservices/models/LabUpdate.java | 245 ++ .../labservices/models/LabUserAccessMode.java | 34 - .../labservices/models/Labs.java | 161 +- .../models/LatestOperationResult.java | 114 - .../models/ListEnvironmentsResponse.java | 25 - .../labservices/models/ListLabsResponse.java | 25 - .../labservices/models/ListUsagesResult.java | 59 + .../labservices/models/ManagedLabVmSize.java | 37 - .../labservices/models/NetworkInterface.java | 84 - .../labservices/models/Operation.java | 56 + .../models/OperationBatchStatusPayload.java | 57 - .../models/OperationBatchStatusResponse.java | 25 - .../OperationBatchStatusResponseItem.java | 54 - .../labservices/models/OperationDisplay.java | 93 + .../labservices/models/OperationError.java | 76 - ...onResult.java => OperationListResult.java} | 38 +- .../labservices/models/OperationMetadata.java | 31 - .../models/OperationMetadataDisplay.java | 128 - .../labservices/models/OperationResult.java | 44 +- .../labservices/models/OperationResults.java | 34 + .../labservices/models/OperationStatus.java | 56 + .../models/OperationStatusPayload.java | 56 - .../models/OperationStatusResponse.java | 24 - .../labservices/models/Operations.java | 19 +- .../labservices/models/Origin.java | 37 + .../labservices/models/OsState.java | 47 + .../labservices/models/OsType.java | 47 + .../labservices/models/PagedImages.java | 59 + .../labservices/models/PagedLabPlans.java | 59 + .../models/PagedLabServicesSkus.java | 59 + ...ithContinuationLab.java => PagedLabs.java} | 44 +- .../labservices/models/PagedSchedules.java | 59 + ...hContinuationUser.java => PagedUsers.java} | 44 +- .../models/PagedVirtualMachines.java | 59 + .../PersonalPreferencesOperationsPayload.java | 102 - .../labservices/models/ProvisioningState.java | 59 + .../labservices/models/PublishPayload.java | 50 - .../labservices/models/PublishingState.java | 43 - .../models/RecurrenceFrequency.java | 47 + .../labservices/models/RecurrencePattern.java | 146 + .../labservices/models/ReferenceVm.java | 115 - .../models/RegionalAvailability.java | 80 - .../labservices/models/RegistrationState.java | 47 + ...Parameters.java => ResetPasswordBody.java} | 34 +- .../models/ResetPasswordPayload.java | 108 - .../labservices/models/ResourceSet.java | 76 - .../models/ResourceSetFragment.java | 76 - .../ResourceSettingCreationParameters.java | 173 - .../labservices/models/ResourceSettings.java | 157 - .../models/ResourceSettingsFragment.java | 108 - .../ResponseWithContinuationEnvironment.java | 81 - ...nseWithContinuationEnvironmentSetting.java | 81 - .../ResponseWithContinuationGalleryImage.java | 81 - .../ResponseWithContinuationLabAccount.java | 81 - .../models/RestrictionReasonCode.java | 35 + .../labservices/models/RestrictionType.java | 31 + .../labservices/models/RosterProfile.java | 160 + .../labservices/models/SaveImageBody.java | 76 + .../labservices/models/ScaleType.java | 37 + .../labservices/models/Schedule.java | 294 ++ .../labservices/models/ScheduleUpdate.java | 163 + .../{GalleryImages.java => Schedules.java} | 121 +- ...isterPayload.java => SecurityProfile.java} | 37 +- .../models/ShutdownOnIdleMode.java | 50 + .../labservices/models/SizeAvailability.java | 76 - .../models/SizeConfigurationProperties.java | 57 - .../labservices/models/SizeInfo.java | 133 - .../labservices/models/SizeInfoFragment.java | 133 - .../labservices/models/Sku.java | 171 + .../labservices/models/SkuTier.java | 53 + .../{ProviderOperations.java => Skus.java} | 17 +- .../labservices/models/SupportInfo.java | 128 + .../models/TrackedResourceUpdate.java | 51 + .../labservices/models/Usage.java | 52 + .../labservices/models/UsageName.java | 76 + .../labservices/models/UsageUnit.java | 31 + .../labservices/models/Usages.java | 35 + .../labservices/models/User.java | 209 +- .../labservices/models/UserFragment.java | 94 - .../labservices/models/UserUpdate.java | 69 + .../labservices/models/Users.java | 138 +- .../labservices/models/VirtualMachine.java | 81 + .../VirtualMachineAdditionalCapabilities.java | 50 + .../VirtualMachineConnectionProfile.java | 135 + .../models/VirtualMachineDetails.java | 114 - .../models/VirtualMachineProfile.java | 293 ++ .../models/VirtualMachineState.java | 62 + .../models/VirtualMachineType.java | 47 + .../labservices/models/VirtualMachines.java | 222 ++ .../labservices/models/VmStateDetails.java | 88 - .../labservices/models/WeekDay.java | 62 + .../labservices/models/package-info.java | 2 +- .../labservices/package-info.java | 2 +- .../ImagesCreateOrUpdateSamples.java | 27 + .../generated/ImagesGetSamples.java | 22 + .../generated/ImagesListByLabPlanSamples.java | 22 + .../generated/ImagesUpdateSamples.java | 26 + .../LabPlansCreateOrUpdateSamples.java | 60 + .../generated/LabPlansDeleteSamples.java | 22 + .../LabPlansGetByResourceGroupSamples.java | 22 + .../LabPlansListByResourceGroupSamples.java | 22 + .../generated/LabPlansListSamples.java | 22 + .../generated/LabPlansSaveImageSamples.java | 32 + .../generated/LabPlansUpdateSamples.java | 35 + .../generated/LabsCreateOrUpdateSamples.java | 78 + .../generated/LabsDeleteSamples.java | 22 + .../LabsGetByResourceGroupSamples.java | 22 + .../LabsListByResourceGroupSamples.java | 22 + .../generated/LabsListSamples.java | 22 + .../generated/LabsPublishSamples.java | 22 + .../generated/LabsSyncGroupSamples.java | 22 + .../generated/LabsUpdateSamples.java | 26 + .../generated/OperationResultsGetSamples.java | 22 + .../generated/OperationsListSamples.java | 22 + .../SchedulesCreateOrUpdateSamples.java | 38 + .../generated/SchedulesDeleteSamples.java | 22 + .../generated/SchedulesGetSamples.java | 22 + .../generated/SchedulesListByLabSamples.java | 22 + .../generated/SchedulesUpdateSamples.java | 35 + .../generated/SkusListSamples.java | 22 + .../UsagesListByLocationSamples.java | 22 + .../generated/UsersCreateOrUpdateSamples.java | 28 + .../generated/UsersDeleteSamples.java | 22 + .../generated/UsersGetSamples.java | 22 + .../generated/UsersInviteSamples.java | 30 + .../generated/UsersListByLabSamples.java | 22 + .../generated/UsersUpdateSamples.java | 25 + .../generated/VirtualMachinesGetSamples.java | 22 + .../VirtualMachinesListByLabSamples.java | 22 + .../VirtualMachinesRedeploySamples.java | 22 + .../VirtualMachinesReimageSamples.java | 22 + .../VirtualMachinesResetPasswordSamples.java | 30 + .../VirtualMachinesStartSamples.java | 22 + .../generated/VirtualMachinesStopSamples.java | 22 + 297 files changed, 24166 insertions(+), 26038 deletions(-) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/SAMPLE.md rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/{ManagedLabsManager.java => LabServicesManager.java} (60%) delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentSettingsClient.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentsClient.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GalleryImagesClient.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GlobalUsersClient.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ImagesClient.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabAccountsClient.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabPlansClient.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/{ManagedLabsClient.java => LabServicesClient.java} (57%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationResultsClient.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SchedulesClient.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/{ProviderOperationsClient.java => SkusClient.java} (68%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsagesClient.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/VirtualMachinesClient.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentSettingInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GalleryImageInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetEnvironmentResponseInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetPersonalPreferencesResponseInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetRegionalAvailabilityResponseInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageUpdateProperties.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabAccountInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanUpdateProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabServicesSkuInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabUpdateProperties.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListEnvironmentsResponseInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListLabsResponseInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationBatchStatusResponseInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationMetadataInner.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationStatusResponseInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleUpdateProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UsageInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserUpdateProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineInner.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineProperties.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsClientImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsClientImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImageImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImagesImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetEnvironmentResponseImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetPersonalPreferencesResponseImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetRegionalAvailabilityResponseImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersClientImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImageImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesClientImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountsImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlanImpl.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/{LabAccountsClientImpl.java => LabPlansClientImpl.java} (53%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansImpl.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/{ManagedLabsClientBuilder.java => LabServicesClientBuilder.java} (74%) rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/{ManagedLabsClientImpl.java => LabServicesClientImpl.java} (74%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesSkuImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListEnvironmentsResponseImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListLabsResponseImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationBatchStatusResponseImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationMetadataImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsClientImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationStatusResponseImpl.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ProviderOperationsImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ScheduleImpl.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/{GalleryImagesClientImpl.java => SchedulesClientImpl.java} (51%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesImpl.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/{ProviderOperationsClientImpl.java => SkusClientImpl.java} (60%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsageImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachineImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesClientImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesImpl.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ActionType.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddRemove.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddUsersPayload.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AutoShutdownProfile.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConfigurationState.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionProfile.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionType.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateLabProperties.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateOption.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{ReferenceVmFragment.java => Credentials.java} (54%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnableState.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentDetails.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentFragment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentOperationsPayload.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSetting.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingCreationParameters.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingFragment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettings.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSize.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSizeFragment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environments.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImage.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImageFragment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetEnvironmentResponse.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetPersonalPreferencesResponse.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetRegionalAvailabilityResponse.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GlobalUsers.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Image.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{GalleryImageReference.java => ImageReference.java} (51%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageUpdate.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Images.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InvitationState.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{ListEnvironmentsPayload.java => InviteBody.java} (53%) delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccount.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccountFragment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccounts.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabCreationParameters.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabDetails.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabFragment.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabNetworkProfile.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlan.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanNetworkProfile.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanUpdate.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlans.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSku.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapabilities.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapacity.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCost.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuRestrictions.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuTier.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabState.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUpdate.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUserAccessMode.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LatestOperationResult.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListEnvironmentsResponse.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListLabsResponse.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListUsagesResult.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ManagedLabVmSize.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/NetworkInterface.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operation.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusPayload.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponse.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponseItem.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationDisplay.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationError.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{ProviderOperationResult.java => OperationListResult.java} (59%) delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadata.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadataDisplay.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResults.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatus.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusPayload.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusResponse.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Origin.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsState.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsType.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedImages.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabPlans.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabServicesSkus.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{ResponseWithContinuationLab.java => PagedLabs.java} (50%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedSchedules.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{ResponseWithContinuationUser.java => PagedUsers.java} (50%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedVirtualMachines.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PersonalPreferencesOperationsPayload.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProvisioningState.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishPayload.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishingState.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrenceFrequency.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrencePattern.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVm.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegionalAvailability.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegistrationState.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{ReferenceVmCreationParameters.java => ResetPasswordBody.java} (57%) delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordPayload.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSet.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSetFragment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingCreationParameters.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettings.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingsFragment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironment.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironmentSetting.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationGalleryImage.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationLabAccount.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionReasonCode.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionType.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RosterProfile.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SaveImageBody.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScaleType.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedule.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScheduleUpdate.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{GalleryImages.java => Schedules.java} (51%) rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{RegisterPayload.java => SecurityProfile.java} (50%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ShutdownOnIdleMode.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeAvailability.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeConfigurationProperties.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfo.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfoFragment.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Sku.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SkuTier.java rename sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/{ProviderOperations.java => Skus.java} (66%) create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SupportInfo.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/TrackedResourceUpdate.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usage.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageName.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageUnit.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usages.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserFragment.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserUpdate.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachine.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineAdditionalCapabilities.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineConnectionProfile.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineDetails.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineProfile.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineState.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineType.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachines.java delete mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VmStateDetails.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/WeekDay.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesCreateOrUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesGetSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesListByLabPlanSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansCreateOrUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansDeleteSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansGetByResourceGroupSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListByResourceGroupSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansSaveImageSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsCreateOrUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsDeleteSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsGetByResourceGroupSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListByResourceGroupSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsPublishSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsSyncGroupSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationResultsGetSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationsListSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesCreateOrUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesDeleteSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesGetSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesListByLabSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SkusListSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsagesListByLocationSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersCreateOrUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersDeleteSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersGetSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersInviteSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersListByLabSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersUpdateSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesGetSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesListByLabSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesRedeploySamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesReimageSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesResetPasswordSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStartSamples.java create mode 100644 sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStopSamples.java diff --git a/sdk/labservices/azure-resourcemanager-labservices/CHANGELOG.md b/sdk/labservices/azure-resourcemanager-labservices/CHANGELOG.md index 2f20902d274ed..5acad6d96d299 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/CHANGELOG.md +++ b/sdk/labservices/azure-resourcemanager-labservices/CHANGELOG.md @@ -1,7 +1,586 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2022-01-17) +- Azure Resource Manager LabServices client library for Java. This package contains Microsoft Azure SDK for LabServices Management SDK. REST API for managing Azure Lab Services images. Package tag package-preview-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +* `models.GalleryImage$DefinitionStages` was removed + +* `ManagedLabsManager` was removed + +* `models.LabAccount$UpdateStages` was removed + +* `models.SizeInfoFragment` was removed + +* `models.EnvironmentFragment` was removed + +* `models.UserFragment` was removed + +* `models.ResponseWithContinuationUser` was removed + +* `models.ResourceSettingsFragment` was removed + +* `models.EnvironmentSettings` was removed + +* `models.GetPersonalPreferencesResponse` was removed + +* `models.ConfigurationState` was removed + +* `models.EnvironmentOperationsPayload` was removed + +* `models.EnvironmentSettingCreationParameters` was removed + +* `models.CreateLabProperties` was removed + +* `models.EnvironmentDetails` was removed + +* `models.SizeAvailability` was removed + +* `models.LabUserAccessMode` was removed + +* `models.ResponseWithContinuationLab` was removed + +* `models.EnvironmentSetting$Definition` was removed + +* `models.ProviderOperationResult` was removed + +* `models.ListLabsResponse` was removed + +* `models.LabAccounts` was removed + +* `models.Environments` was removed + +* `models.ResourceSettingCreationParameters` was removed + +* `models.GalleryImageFragment` was removed + +* `models.Environment$Update` was removed + +* `models.AddUsersPayload` was removed + +* `models.LabAccount` was removed + +* `models.Environment$DefinitionStages` was removed + +* `models.ManagedLabVmSize` was removed + +* `models.GalleryImages` was removed + +* `models.RegisterPayload` was removed + +* `models.EnvironmentSetting$Update` was removed + +* `models.ResponseWithContinuationEnvironment` was removed + +* `models.GetRegionalAvailabilityResponse` was removed + +* `models.ProviderOperations` was removed + +* `models.EnvironmentSetting` was removed + +* `models.Environment$Definition` was removed + +* `models.LabAccountFragment` was removed + +* `models.OperationStatusPayload` was removed + +* `models.OperationMetadata` was removed + +* `ManagedLabsManager$Configurable` was removed + +* `models.LabAccount$Update` was removed + +* `models.PublishPayload` was removed + +* `models.GalleryImageReference` was removed + +* `models.ResourceSettings` was removed + +* `models.GalleryImage$Update` was removed + +* `models.GetEnvironmentResponse` was removed + +* `models.SizeInfo` was removed + +* `models.EnvironmentSizeFragment` was removed + +* `models.PersonalPreferencesOperationsPayload` was removed + +* `models.AddRemove` was removed + +* `models.LabAccount$Definition` was removed + +* `models.OperationBatchStatusResponse` was removed + +* `models.EnvironmentSize` was removed + +* `models.OperationStatusResponse` was removed + +* `models.ResetPasswordPayload` was removed + +* `models.GlobalUsers` was removed + +* `models.ReferenceVm` was removed + +* `models.VirtualMachineDetails` was removed + +* `models.ListEnvironmentsResponse` was removed + +* `models.Environment$UpdateStages` was removed + +* `models.GalleryImage$Definition` was removed + +* `models.OperationError` was removed + +* `models.EnvironmentSettingFragment` was removed + +* `models.ReferenceVmCreationParameters` was removed + +* `models.PublishingState` was removed + +* `models.EnvironmentSetting$UpdateStages` was removed + +* `models.RegionalAvailability` was removed + +* `models.LatestOperationResult` was removed + +* `models.EnvironmentSetting$DefinitionStages` was removed + +* `models.ResponseWithContinuationGalleryImage` was removed + +* `models.OperationBatchStatusPayload` was removed + +* `models.GalleryImage$UpdateStages` was removed + +* `models.OperationBatchStatusResponseItem` was removed + +* `models.GalleryImage` was removed + +* `models.NetworkInterface` was removed + +* `models.LabDetails` was removed + +* `models.ListEnvironmentsPayload` was removed + +* `models.ResponseWithContinuationLabAccount` was removed + +* `models.ResponseWithContinuationEnvironmentSetting` was removed + +* `models.VmStateDetails` was removed + +* `models.LabCreationParameters` was removed + +* `models.LabAccount$DefinitionStages` was removed + +* `models.ResourceSetFragment` was removed + +* `models.SizeConfigurationProperties` was removed + +* `models.Environment` was removed + +* `models.LabFragment` was removed + +* `models.OperationMetadataDisplay` was removed + +* `models.ReferenceVmFragment` was removed + +* `models.ResourceSet` was removed + +#### `models.Lab$DefinitionStages` was modified + +* `withExistingLabaccount(java.lang.String,java.lang.String)` was removed in stage 2 + +#### `models.User$DefinitionStages` was modified + +* `withRegion(java.lang.String)` was removed in stage 1 +* `withExistingLab(java.lang.String,java.lang.String,java.lang.String)` was removed in stage 1 +* `withRegion(com.azure.core.management.Region)` was removed in stage 1 +* Stage 2 was added + +#### `models.Lab$Update` was modified + +* `withTags(java.util.Map)` was removed +* `withMaxUsersInLab(java.lang.Integer)` was removed +* `withUsageQuota(java.time.Duration)` was removed +* `withUserAccessMode(models.LabUserAccessMode)` was removed +* `withUniqueIdentifier(java.lang.String)` was removed +* `withProvisioningState(java.lang.String)` was removed + +#### `models.User$Update` was modified + +* `withUniqueIdentifier(java.lang.String)` was removed +* `withProvisioningState(java.lang.String)` was removed +* `withTags(java.util.Map)` was removed + +#### `models.OperationResult` was modified + +* `models.OperationError error()` -> `com.azure.core.management.exception.ManagementError error()` +* `java.lang.String status()` -> `models.OperationStatus status()` + +#### `models.Users` was modified + +* `getByIdWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `get(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `delete(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `list(java.lang.String,java.lang.String,java.lang.String)` was removed +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,com.azure.core.util.Context)` was removed +* `delete(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.Operations` was modified + +* `get(java.lang.String,java.lang.String)` was removed +* `getWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.Lab$Definition` was modified + +* `withUserAccessMode(models.LabUserAccessMode)` was removed +* `withExistingLabaccount(java.lang.String,java.lang.String)` was removed +* `withMaxUsersInLab(java.lang.Integer)` was removed +* `withUsageQuota(java.time.Duration)` was removed +* `withProvisioningState(java.lang.String)` was removed +* `withUniqueIdentifier(java.lang.String)` was removed + +#### `models.User` was modified + +* `tags()` was removed +* `familyName()` was removed +* `regionName()` was removed +* `java.lang.String provisioningState()` -> `models.ProvisioningState provisioningState()` +* `tenantId()` was removed +* `latestOperationResult()` was removed +* `uniqueIdentifier()` was removed +* `location()` was removed +* `givenName()` was removed +* `region()` was removed + +#### `models.Lab` was modified + +* `register()` was removed +* `createdDate()` was removed +* `createdByObjectId()` was removed +* `java.lang.String provisioningState()` -> `models.ProvisioningState provisioningState()` +* `maxUsersInLab()` was removed +* `userQuota()` was removed +* `registerWithResponse(com.azure.core.util.Context)` was removed +* `usageQuota()` was removed +* `userAccessMode()` was removed +* `createdByUserPrincipalName()` was removed +* `uniqueIdentifier()` was removed +* `latestOperationResult()` was removed +* `invitationCode()` was removed +* `addUsersWithResponse(models.AddUsersPayload,com.azure.core.util.Context)` was removed +* `addUsers(models.AddUsersPayload)` was removed + +#### `models.Labs` was modified + +* `addUsersWithResponse(java.lang.String,java.lang.String,java.lang.String,models.AddUsersPayload,com.azure.core.util.Context)` was removed +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,com.azure.core.util.Context)` was removed +* `register(java.lang.String,java.lang.String,java.lang.String)` was removed +* `addUsers(java.lang.String,java.lang.String,java.lang.String,models.AddUsersPayload)` was removed +* `delete(java.lang.String,java.lang.String,java.lang.String)` was removed +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `registerWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `list(java.lang.String,java.lang.String)` was removed +* `get(java.lang.String,java.lang.String,java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.User$Definition` was modified + +* `withTags(java.util.Map)` was removed +* `withRegion(java.lang.String)` was removed +* `withProvisioningState(java.lang.String)` was removed +* `withUniqueIdentifier(java.lang.String)` was removed +* `withExistingLab(java.lang.String,java.lang.String,java.lang.String)` was removed +* `withRegion(com.azure.core.management.Region)` was removed + +### Features Added + +* `models.VirtualMachineAdditionalCapabilities` was added + +* `models.Usages` was added + +* `models.LabServicesSku` was added + +* `models.LabPlanNetworkProfile` was added + +* `models.InviteBody` was added + +* `models.LabPlan$UpdateStages` was added + +* `models.OperationResults` was added + +* `models.LabState` was added + +* `models.PagedVirtualMachines` was added + +* `models.SupportInfo` was added + +* `models.UsageName` was added + +* `models.LabUpdate` was added + +* `models.ResetPasswordBody` was added + +* `LabServicesManager` was added + +* `models.Schedule$Update` was added + +* `models.RestrictionReasonCode` was added + +* `models.LabPlan$Update` was added + +* `models.Image$UpdateStages` was added + +* `models.Images` was added + +* `models.PagedUsers` was added + +* `LabServicesManager$Configurable` was added + +* `models.Schedules` was added + +* `models.Operation` was added + +* `models.LabServicesSkuCapabilities` was added + +* `models.OperationDisplay` was added + +* `models.LabPlanUpdate` was added + +* `models.Schedule$UpdateStages` was added + +* `models.OperationListResult` was added + +* `models.VirtualMachineType` was added + +* `models.Sku` was added + +* `models.LabServicesSkuCost` was added + +* `models.UsageUnit` was added + +* `models.Credentials` was added + +* `models.RecurrenceFrequency` was added + +* `models.VirtualMachine` was added + +* `models.LabServicesSkuTier` was added + +* `models.LabPlan` was added + +* `models.Schedule$Definition` was added + +* `models.LabServicesSkuCapacity` was added + +* `models.PagedLabs` was added + +* `models.LabPlan$Definition` was added + +* `models.PagedSchedules` was added + +* `models.LabPlans` was added + +* `models.Image$Update` was added + +* `models.ProvisioningState` was added + +* `models.Schedule` was added + +* `models.VirtualMachineConnectionProfile` was added + +* `models.ConnectionType` was added + +* `models.OperationStatus` was added + +* `models.ScheduleUpdate` was added + +* `models.TrackedResourceUpdate` was added + +* `models.Usage` was added + +* `models.PagedLabServicesSkus` was added + +* `models.Image$DefinitionStages` was added + +* `models.SecurityProfile` was added + +* `models.UserUpdate` was added + +* `models.Schedule$DefinitionStages` was added + +* `models.ListUsagesResult` was added + +* `models.CreateOption` was added + +* `models.SkuTier` was added + +* `models.RecurrencePattern` was added + +* `models.PagedImages` was added + +* `models.WeekDay` was added + +* `models.Image$Definition` was added + +* `models.LabNetworkProfile` was added + +* `models.VirtualMachineState` was added + +* `models.RegistrationState` was added + +* `models.VirtualMachineProfile` was added + +* `models.ImageUpdate` was added + +* `models.Image` was added + +* `models.ShutdownOnIdleMode` was added + +* `models.OsState` was added + +* `models.Origin` was added + +* `models.SaveImageBody` was added + +* `models.ConnectionProfile` was added + +* `models.LabPlan$DefinitionStages` was added + +* `models.VirtualMachines` was added + +* `models.AutoShutdownProfile` was added + +* `models.OsType` was added + +* `models.RestrictionType` was added + +* `models.EnableState` was added + +* `models.ImageReference` was added + +* `models.LabServicesSkuRestrictions` was added + +* `models.RosterProfile` was added + +* `models.ActionType` was added + +* `models.InvitationState` was added + +* `models.PagedLabPlans` was added + +* `models.Skus` was added + +* `models.ScaleType` was added + +#### `models.Lab$Update` was modified + +* `withVirtualMachineProfile(models.VirtualMachineProfile)` was added +* `withTitle(java.lang.String)` was added +* `withTags(java.util.List)` was added +* `withDescription(java.lang.String)` was added +* `withConnectionProfile(models.ConnectionProfile)` was added +* `withLabPlanId(java.lang.String)` was added +* `withSecurityProfile(models.SecurityProfile)` was added +* `withAutoShutdownProfile(models.AutoShutdownProfile)` was added +* `withRosterProfile(models.RosterProfile)` was added + +#### `models.User$Update` was modified + +* `withAdditionalUsageQuota(java.time.Duration)` was added + +#### `models.OperationResult` was modified + +* `percentComplete()` was added +* `id()` was added +* `startTime()` was added +* `name()` was added +* `endTime()` was added + +#### `models.Users` was modified + +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `get(java.lang.String,java.lang.String,java.lang.String)` was added +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `delete(java.lang.String,java.lang.String,java.lang.String)` was added +* `listByLab(java.lang.String,java.lang.String)` was added +* `listByLab(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `invite(java.lang.String,java.lang.String,java.lang.String,models.InviteBody,com.azure.core.util.Context)` was added +* `delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `invite(java.lang.String,java.lang.String,java.lang.String,models.InviteBody)` was added + +#### `models.Operations` was modified + +* `list()` was added +* `list(com.azure.core.util.Context)` was added + +#### `models.Lab$Definition` was modified + +* `withTitle(java.lang.String)` was added +* `withLabPlanId(java.lang.String)` was added +* `withNetworkProfile(models.LabNetworkProfile)` was added +* `withDescription(java.lang.String)` was added +* `withAutoShutdownProfile(models.AutoShutdownProfile)` was added +* `withVirtualMachineProfile(models.VirtualMachineProfile)` was added +* `withSecurityProfile(models.SecurityProfile)` was added +* `withExistingResourceGroup(java.lang.String)` was added +* `withRosterProfile(models.RosterProfile)` was added +* `withConnectionProfile(models.ConnectionProfile)` was added + +#### `models.User` was modified + +* `invitationSent()` was added +* `invitationState()` was added +* `invite(models.InviteBody,com.azure.core.util.Context)` was added +* `invite(models.InviteBody)` was added +* `registrationState()` was added +* `displayName()` was added +* `systemData()` was added +* `additionalUsageQuota()` was added + +#### `models.Lab` was modified + +* `systemData()` was added +* `connectionProfile()` was added +* `syncGroup(com.azure.core.util.Context)` was added +* `autoShutdownProfile()` was added +* `state()` was added +* `labPlanId()` was added +* `publish(com.azure.core.util.Context)` was added +* `rosterProfile()` was added +* `networkProfile()` was added +* `title()` was added +* `publish()` was added +* `securityProfile()` was added +* `virtualMachineProfile()` was added +* `syncGroup()` was added +* `description()` was added + +#### `models.Labs` was modified + +* `syncGroup(java.lang.String,java.lang.String)` was added +* `list(java.lang.String,com.azure.core.util.Context)` was added +* `listByResourceGroup(java.lang.String,com.azure.core.util.Context)` was added +* `getByResourceGroup(java.lang.String,java.lang.String)` was added +* `syncGroup(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listByResourceGroup(java.lang.String)` was added +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was added +* `list()` was added +* `publish(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `getByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `publish(java.lang.String,java.lang.String)` was added + +#### `models.User$Definition` was modified + +* `withAdditionalUsageQuota(java.time.Duration)` was added +* `withExistingLab(java.lang.String,java.lang.String)` was added +* `withEmail(java.lang.String)` was added ## 1.0.0-beta.1 (2021-04-22) diff --git a/sdk/labservices/azure-resourcemanager-labservices/README.md b/sdk/labservices/azure-resourcemanager-labservices/README.md index db7667367c8b1..54e4970422aa0 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/README.md +++ b/sdk/labservices/azure-resourcemanager-labservices/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager ManagedLabs client library for Java +# Azure Resource Manager LabServices client library for Java -Azure Resource Manager ManagedLabs client library for Java. +Azure Resource Manager LabServices client library for Java. -This package contains Microsoft Azure SDK for ManagedLabs Management SDK. The Managed Labs Client. Package tag package-2018-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for LabServices Management SDK. REST API for managing Azure Lab Services images. Package tag package-preview-2021-11. 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-labservices - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -60,7 +60,7 @@ AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); -ManagedLabsManager manager = ManagedLabsManager +LabServicesManager manager = LabServicesManager .authenticate(credential, profile); ``` @@ -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/labservices/azure-resourcemanager-labservices/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/labservices/azure-resourcemanager-labservices/SAMPLE.md b/sdk/labservices/azure-resourcemanager-labservices/SAMPLE.md new file mode 100644 index 0000000000000..c46de5140a0a4 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/SAMPLE.md @@ -0,0 +1,1118 @@ +# Code snippets and samples + + +## Images + +- [CreateOrUpdate](#images_createorupdate) +- [Get](#images_get) +- [ListByLabPlan](#images_listbylabplan) +- [Update](#images_update) + +## LabPlans + +- [CreateOrUpdate](#labplans_createorupdate) +- [Delete](#labplans_delete) +- [GetByResourceGroup](#labplans_getbyresourcegroup) +- [List](#labplans_list) +- [ListByResourceGroup](#labplans_listbyresourcegroup) +- [SaveImage](#labplans_saveimage) +- [Update](#labplans_update) + +## Labs + +- [CreateOrUpdate](#labs_createorupdate) +- [Delete](#labs_delete) +- [GetByResourceGroup](#labs_getbyresourcegroup) +- [List](#labs_list) +- [ListByResourceGroup](#labs_listbyresourcegroup) +- [Publish](#labs_publish) +- [SyncGroup](#labs_syncgroup) +- [Update](#labs_update) + +## OperationResults + +- [Get](#operationresults_get) + +## Operations + +- [List](#operations_list) + +## Schedules + +- [CreateOrUpdate](#schedules_createorupdate) +- [Delete](#schedules_delete) +- [Get](#schedules_get) +- [ListByLab](#schedules_listbylab) +- [Update](#schedules_update) + +## Skus + +- [List](#skus_list) + +## Usages + +- [ListByLocation](#usages_listbylocation) + +## Users + +- [CreateOrUpdate](#users_createorupdate) +- [Delete](#users_delete) +- [Get](#users_get) +- [Invite](#users_invite) +- [ListByLab](#users_listbylab) +- [Update](#users_update) + +## VirtualMachines + +- [Get](#virtualmachines_get) +- [ListByLab](#virtualmachines_listbylab) +- [Redeploy](#virtualmachines_redeploy) +- [Reimage](#virtualmachines_reimage) +- [ResetPassword](#virtualmachines_resetpassword) +- [Start](#virtualmachines_start) +- [Stop](#virtualmachines_stop) +### Images_CreateOrUpdate + +```java +import com.azure.resourcemanager.labservices.models.EnableState; + +/** Samples for Images CreateOrUpdate. */ +public final class ImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/putImage.json + */ + /** + * Sample code: putImage. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .images() + .define("image1") + .withExistingLabPlan("testrg123", "testlabplan") + .withEnabledState(EnableState.ENABLED) + .create(); + } +} +``` + +### Images_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Images Get. */ +public final class ImagesGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/getImage.json + */ + /** + * Sample code: getImage. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.images().getWithResponse("testrg123", "testlabplan", "image1", Context.NONE); + } +} +``` + +### Images_ListByLabPlan + +```java +import com.azure.core.util.Context; + +/** Samples for Images ListByLabPlan. */ +public final class ImagesListByLabPlanSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/listImages.json + */ + /** + * Sample code: listImages. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listImages(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.images().listByLabPlan("testrg123", "testlabplan", null, Context.NONE); + } +} +``` + +### Images_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.Image; + +/** Samples for Images Update. */ +public final class ImagesUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/patchImage.json + */ + /** + * Sample code: patchImage. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { + Image resource = + manager.images().getWithResponse("testrg123", "testlabplan", "image1", Context.NONE).getValue(); + resource.update().withEnabledState(EnableState.ENABLED).apply(); + } +} +``` + +### LabPlans_CreateOrUpdate + +```java +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.ConnectionType; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; +import com.azure.resourcemanager.labservices.models.ShutdownOnIdleMode; +import com.azure.resourcemanager.labservices.models.SupportInfo; +import java.time.Duration; + +/** Samples for LabPlans CreateOrUpdate. */ +public final class LabPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/putLabPlan.json + */ + /** + * Sample code: putLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .labPlans() + .define("testlabplan") + .withRegion("westus") + .withExistingResourceGroup("testrg123") + .withDefaultConnectionProfile( + new ConnectionProfile() + .withWebSshAccess(ConnectionType.NONE) + .withWebRdpAccess(ConnectionType.NONE) + .withClientSshAccess(ConnectionType.PUBLIC) + .withClientRdpAccess(ConnectionType.PUBLIC)) + .withDefaultAutoShutdownProfile( + new AutoShutdownProfile() + .withShutdownOnDisconnect(EnableState.ENABLED) + .withShutdownWhenNotConnected(EnableState.ENABLED) + .withShutdownOnIdle(ShutdownOnIdleMode.USER_ABSENCE) + .withDisconnectDelay(Duration.parse("00:05")) + .withNoConnectDelay(Duration.parse("01:00")) + .withIdleDelay(Duration.parse("01:00"))) + .withDefaultNetworkProfile( + new LabPlanNetworkProfile() + .withSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default")) + .withSharedGalleryId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Compute/galleries/testsig") + .withSupportInfo( + new SupportInfo() + .withUrl("help.contoso.com") + .withEmail("help@contoso.com") + .withPhone("+1-202-555-0123") + .withInstructions("Contact support for help.")) + .create(); + } +} +``` + +### LabPlans_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for LabPlans Delete. */ +public final class LabPlansDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/deleteLabPlan.json + */ + /** + * Sample code: deleteLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().delete("testrg123", "testlabplan", Context.NONE); + } +} +``` + +### LabPlans_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for LabPlans GetByResourceGroup. */ +public final class LabPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/getLabPlan.json + */ + /** + * Sample code: getLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().getByResourceGroupWithResponse("testrg123", "testlabplan", Context.NONE); + } +} +``` + +### LabPlans_List + +```java +import com.azure.core.util.Context; + +/** Samples for LabPlans List. */ +public final class LabPlansListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/listLabPlans.json + */ + /** + * Sample code: listLabPlans. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listLabPlans(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().list(null, Context.NONE); + } +} +``` + +### LabPlans_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for LabPlans ListByResourceGroup. */ +public final class LabPlansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/listResourceGroupLabPlans.json + */ + /** + * Sample code: listResourceGroupLabPlans. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listResourceGroupLabPlans(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().listByResourceGroup("testrg123", Context.NONE); + } +} +``` + +### LabPlans_SaveImage + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.SaveImageBody; + +/** Samples for LabPlans SaveImage. */ +public final class LabPlansSaveImageSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/saveImageVirtualMachine.json + */ + /** + * Sample code: saveImageVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void saveImageVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .labPlans() + .saveImage( + "testrg123", + "testlabplan", + new SaveImageBody() + .withName("Test Image") + .withLabVirtualMachineId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/virtualMachines/template"), + Context.NONE); + } +} +``` + +### LabPlans_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.ConnectionType; +import com.azure.resourcemanager.labservices.models.LabPlan; + +/** Samples for LabPlans Update. */ +public final class LabPlansUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/patchLabPlan.json + */ + /** + * Sample code: patchLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + LabPlan resource = + manager.labPlans().getByResourceGroupWithResponse("testrg123", "testlabplan", Context.NONE).getValue(); + resource + .update() + .withDefaultConnectionProfile( + new ConnectionProfile() + .withWebSshAccess(ConnectionType.NONE) + .withWebRdpAccess(ConnectionType.NONE) + .withClientSshAccess(ConnectionType.PUBLIC) + .withClientRdpAccess(ConnectionType.PUBLIC)) + .apply(); + } +} +``` + +### Labs_CreateOrUpdate + +```java +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.ConnectionType; +import com.azure.resourcemanager.labservices.models.CreateOption; +import com.azure.resourcemanager.labservices.models.Credentials; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.ImageReference; +import com.azure.resourcemanager.labservices.models.LabNetworkProfile; +import com.azure.resourcemanager.labservices.models.SecurityProfile; +import com.azure.resourcemanager.labservices.models.ShutdownOnIdleMode; +import com.azure.resourcemanager.labservices.models.Sku; +import com.azure.resourcemanager.labservices.models.VirtualMachineAdditionalCapabilities; +import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; +import java.time.Duration; + +/** Samples for Labs CreateOrUpdate. */ +public final class LabsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/putLab.json + */ + /** + * Sample code: putLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .labs() + .define("testlab") + .withRegion("westus") + .withExistingResourceGroup("testrg123") + .withNetworkProfile( + new LabNetworkProfile() + .withSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default")) + .withAutoShutdownProfile( + new AutoShutdownProfile() + .withShutdownOnDisconnect(EnableState.ENABLED) + .withShutdownWhenNotConnected(EnableState.ENABLED) + .withShutdownOnIdle(ShutdownOnIdleMode.USER_ABSENCE) + .withDisconnectDelay(Duration.parse("00:05")) + .withNoConnectDelay(Duration.parse("01:00")) + .withIdleDelay(Duration.parse("01:00"))) + .withConnectionProfile( + new ConnectionProfile() + .withWebSshAccess(ConnectionType.NONE) + .withWebRdpAccess(ConnectionType.NONE) + .withClientSshAccess(ConnectionType.PUBLIC) + .withClientRdpAccess(ConnectionType.PUBLIC)) + .withVirtualMachineProfile( + new VirtualMachineProfile() + .withCreateOption(CreateOption.TEMPLATE_VM) + .withImageReference( + new ImageReference() + .withOffer("WindowsServer") + .withPublisher("Microsoft") + .withSku("2019-Datacenter") + .withVersion("2019.0.20190410")) + .withSku(new Sku().withName("Medium")) + .withAdditionalCapabilities( + new VirtualMachineAdditionalCapabilities().withInstallGpuDrivers(EnableState.DISABLED)) + .withUsageQuota(Duration.parse("10:00")) + .withUseSharedPassword(EnableState.DISABLED) + .withAdminUser(new Credentials().withUsername("test-user"))) + .withSecurityProfile(new SecurityProfile().withOpenAccess(EnableState.DISABLED)) + .withLabPlanId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan") + .withTitle("Test Lab") + .withDescription("This is a test lab.") + .create(); + } +} +``` + +### Labs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Labs Delete. */ +public final class LabsDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/deleteLab.json + */ + /** + * Sample code: deleteLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().delete("testrg123", "testlab", Context.NONE); + } +} +``` + +### Labs_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Labs GetByResourceGroup. */ +public final class LabsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/getLab.json + */ + /** + * Sample code: getLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().getByResourceGroupWithResponse("testrg123", "testlab", Context.NONE); + } +} +``` + +### Labs_List + +```java +import com.azure.core.util.Context; + +/** Samples for Labs List. */ +public final class LabsListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/listLabs.json + */ + /** + * Sample code: listLabs. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listLabs(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().list(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/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/listResourceGroupLabs.json + */ + /** + * Sample code: listResourceGroupLabs. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listResourceGroupLabs(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().listByResourceGroup("testrg123", Context.NONE); + } +} +``` + +### Labs_Publish + +```java +import com.azure.core.util.Context; + +/** Samples for Labs Publish. */ +public final class LabsPublishSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/publishLab.json + */ + /** + * Sample code: publishLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void publishLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().publish("testrg123", "testlab", Context.NONE); + } +} +``` + +### Labs_SyncGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Labs SyncGroup. */ +public final class LabsSyncGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/syncLab.json + */ + /** + * Sample code: syncLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void syncLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().syncGroup("testrg123", "testlab", Context.NONE); + } +} +``` + +### Labs_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.Lab; +import com.azure.resourcemanager.labservices.models.SecurityProfile; + +/** Samples for Labs Update. */ +public final class LabsUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/patchLab.json + */ + /** + * Sample code: patchLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + Lab resource = manager.labs().getByResourceGroupWithResponse("testrg123", "testlab", Context.NONE).getValue(); + resource.update().withSecurityProfile(new SecurityProfile().withOpenAccess(EnableState.ENABLED)).apply(); + } +} +``` + +### OperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationResults Get. */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/OperationResults/getOperationResult.json + */ + /** + * Sample code: getOperationResult. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getOperationResult(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.operationResults().getWithResponse("a64149d8-84cb-4566-ab8e-b4ee1a074174", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabServices/listOperations.json + */ + /** + * Sample code: listOperations. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listOperations(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### Schedules_CreateOrUpdate + +```java +import com.azure.resourcemanager.labservices.models.RecurrenceFrequency; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import java.time.LocalDate; +import java.time.OffsetDateTime; + +/** Samples for Schedules CreateOrUpdate. */ +public final class SchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/putSchedule.json + */ + /** + * Sample code: putSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .schedules() + .define("schedule1") + .withExistingLab("testrg123", "testlab") + .withStartAt(OffsetDateTime.parse("2020-05-26T12:00:00Z")) + .withStopAt(OffsetDateTime.parse("2020-05-26T18:00:00Z")) + .withRecurrencePattern( + new RecurrencePattern() + .withFrequency(RecurrenceFrequency.DAILY) + .withInterval(2) + .withExpirationDate(LocalDate.parse("2020-08-14"))) + .withTimeZoneId("America/Los_Angeles") + .withNotes("Schedule 1 for students") + .create(); + } +} +``` + +### Schedules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Delete. */ +public final class SchedulesDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/deleteSchedule.json + */ + /** + * Sample code: deleteSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.schedules().delete("testrg123", "testlab", "schedule1", Context.NONE); + } +} +``` + +### Schedules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules Get. */ +public final class SchedulesGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/getSchedule.json + */ + /** + * Sample code: getSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.schedules().getWithResponse("testrg123", "testlab", "schedule1", Context.NONE); + } +} +``` + +### Schedules_ListByLab + +```java +import com.azure.core.util.Context; + +/** Samples for Schedules ListByLab. */ +public final class SchedulesListByLabSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/listSchedule.json + */ + /** + * Sample code: getListSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getListSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.schedules().listByLab("testrg123", "testlab", null, Context.NONE); + } +} +``` + +### Schedules_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.RecurrenceFrequency; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import com.azure.resourcemanager.labservices.models.Schedule; +import java.time.LocalDate; + +/** Samples for Schedules Update. */ +public final class SchedulesUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/patchSchedule.json + */ + /** + * Sample code: patchSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + Schedule resource = + manager.schedules().getWithResponse("testrg123", "testlab", "schedule1", Context.NONE).getValue(); + resource + .update() + .withRecurrencePattern( + new RecurrencePattern() + .withFrequency(RecurrenceFrequency.DAILY) + .withInterval(2) + .withExpirationDate(LocalDate.parse("2020-08-14"))) + .apply(); + } +} +``` + +### Skus_List + +```java +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Skus/listSkus.json + */ + /** + * Sample code: listSkus. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listSkus(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.skus().list(null, Context.NONE); + } +} +``` + +### Usages_ListByLocation + +```java +import com.azure.core.util.Context; + +/** Samples for Usages ListByLocation. */ +public final class UsagesListByLocationSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Usages/getUsages.json + */ + /** + * Sample code: listUsages. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listUsages(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.usages().listByLocation("westus2", null, Context.NONE); + } +} +``` + +### Users_CreateOrUpdate + +```java +import java.time.Duration; + +/** Samples for Users CreateOrUpdate. */ +public final class UsersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/putUser.json + */ + /** + * Sample code: putUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .users() + .define("testuser") + .withExistingLab("testrg123", "testlab") + .withEmail("testuser@contoso.com") + .withAdditionalUsageQuota(Duration.parse("20:00")) + .create(); + } +} +``` + +### Users_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Users Delete. */ +public final class UsersDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/deleteUser.json + */ + /** + * Sample code: deleteUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.users().delete("testrg123", "testlab", "testuser", Context.NONE); + } +} +``` + +### Users_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Users Get. */ +public final class UsersGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/getUser.json + */ + /** + * Sample code: getUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.users().getWithResponse("testrg123", "testlab", "testuser", Context.NONE); + } +} +``` + +### Users_Invite + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.InviteBody; + +/** Samples for Users Invite. */ +public final class UsersInviteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/inviteUser.json + */ + /** + * Sample code: inviteUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void inviteUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .users() + .invite( + "testrg123", + "testlab", + "testuser", + new InviteBody().withText("Invitation to lab testlab"), + Context.NONE); + } +} +``` + +### Users_ListByLab + +```java +import com.azure.core.util.Context; + +/** Samples for Users ListByLab. */ +public final class UsersListByLabSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/listUser.json + */ + /** + * Sample code: listUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.users().listByLab("testrg123", "testlab", null, Context.NONE); + } +} +``` + +### Users_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.User; +import java.time.Duration; + +/** Samples for Users Update. */ +public final class UsersUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/patchUser.json + */ + /** + * Sample code: patchUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + User resource = manager.users().getWithResponse("testrg123", "testlab", "testuser", Context.NONE).getValue(); + resource.update().withAdditionalUsageQuota(Duration.parse("20:00")).apply(); + } +} +``` + +### VirtualMachines_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Get. */ +public final class VirtualMachinesGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/getVirtualMachine.json + */ + /** + * Sample code: getVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().getWithResponse("testrg123", "testlab", "template", Context.NONE); + } +} +``` + +### VirtualMachines_ListByLab + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ListByLab. */ +public final class VirtualMachinesListByLabSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/listVirtualMachine.json + */ + /** + * Sample code: listVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().listByLab("testrg123", "testlab", null, Context.NONE); + } +} +``` + +### VirtualMachines_Redeploy + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/redeployVirtualMachine.json + */ + /** + * Sample code: redeployVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void redeployVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().redeploy("testrg123", "testlab", "template", Context.NONE); + } +} +``` + +### VirtualMachines_Reimage + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Reimage. */ +public final class VirtualMachinesReimageSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/reimageVirtualMachine.json + */ + /** + * Sample code: reimageVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void reimageVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().reimage("testrg123", "testlab", "template", Context.NONE); + } +} +``` + +### VirtualMachines_ResetPassword + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.ResetPasswordBody; + +/** Samples for VirtualMachines ResetPassword. */ +public final class VirtualMachinesResetPasswordSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/resetPasswordVirtualMachine.json + */ + /** + * Sample code: resetPasswordVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void resetPasswordVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .virtualMachines() + .resetPassword( + "testrg123", + "testlab", + "template", + new ResetPasswordBody().withUsername("example-username").withPassword("example-password"), + Context.NONE); + } +} +``` + +### VirtualMachines_Start + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/startVirtualMachine.json + */ + /** + * Sample code: startVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().start("testrg123", "testlab", "template", Context.NONE); + } +} +``` + +### VirtualMachines_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Stop. */ +public final class VirtualMachinesStopSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/stopVirtualMachine.json + */ + /** + * Sample code: stopVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void stopVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().stop("testrg123", "testlab", "template", Context.NONE); + } +} +``` + diff --git a/sdk/labservices/azure-resourcemanager-labservices/pom.xml b/sdk/labservices/azure-resourcemanager-labservices/pom.xml index 4fc946621017f..5b506a2b19aa1 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/pom.xml +++ b/sdk/labservices/azure-resourcemanager-labservices/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-labservices - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-labservices + 1.0.0-beta.2 + jar - Microsoft Azure SDK for ManagedLabs Management - This package contains Microsoft Azure SDK for ManagedLabs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Managed Labs Client. Package tag package-2018-10. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for LabServices Management + This package contains Microsoft Azure SDK for LabServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Azure Lab Services images. Package tag package-preview-2021-11. + 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.24.1 - - - com.azure - azure-core-management - 1.5.1 - - + + 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.24.1 + + + com.azure + azure-core-management + 1.5.1 + + diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/ManagedLabsManager.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/LabServicesManager.java similarity index 60% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/ManagedLabsManager.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/LabServicesManager.java index f33e4b7da8c16..6af095b4b54d6 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/ManagedLabsManager.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/LabServicesManager.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,62 +17,68 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.ManagedLabsClient; -import com.azure.resourcemanager.labservices.implementation.EnvironmentSettingsImpl; -import com.azure.resourcemanager.labservices.implementation.EnvironmentsImpl; -import com.azure.resourcemanager.labservices.implementation.GalleryImagesImpl; -import com.azure.resourcemanager.labservices.implementation.GlobalUsersImpl; -import com.azure.resourcemanager.labservices.implementation.LabAccountsImpl; +import com.azure.resourcemanager.labservices.fluent.LabServicesClient; +import com.azure.resourcemanager.labservices.implementation.ImagesImpl; +import com.azure.resourcemanager.labservices.implementation.LabPlansImpl; +import com.azure.resourcemanager.labservices.implementation.LabServicesClientBuilder; import com.azure.resourcemanager.labservices.implementation.LabsImpl; -import com.azure.resourcemanager.labservices.implementation.ManagedLabsClientBuilder; +import com.azure.resourcemanager.labservices.implementation.OperationResultsImpl; import com.azure.resourcemanager.labservices.implementation.OperationsImpl; -import com.azure.resourcemanager.labservices.implementation.ProviderOperationsImpl; +import com.azure.resourcemanager.labservices.implementation.SchedulesImpl; +import com.azure.resourcemanager.labservices.implementation.SkusImpl; +import com.azure.resourcemanager.labservices.implementation.UsagesImpl; import com.azure.resourcemanager.labservices.implementation.UsersImpl; -import com.azure.resourcemanager.labservices.models.EnvironmentSettings; -import com.azure.resourcemanager.labservices.models.Environments; -import com.azure.resourcemanager.labservices.models.GalleryImages; -import com.azure.resourcemanager.labservices.models.GlobalUsers; -import com.azure.resourcemanager.labservices.models.LabAccounts; +import com.azure.resourcemanager.labservices.implementation.VirtualMachinesImpl; +import com.azure.resourcemanager.labservices.models.Images; +import com.azure.resourcemanager.labservices.models.LabPlans; import com.azure.resourcemanager.labservices.models.Labs; +import com.azure.resourcemanager.labservices.models.OperationResults; import com.azure.resourcemanager.labservices.models.Operations; -import com.azure.resourcemanager.labservices.models.ProviderOperations; +import com.azure.resourcemanager.labservices.models.Schedules; +import com.azure.resourcemanager.labservices.models.Skus; +import com.azure.resourcemanager.labservices.models.Usages; import com.azure.resourcemanager.labservices.models.Users; +import com.azure.resourcemanager.labservices.models.VirtualMachines; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; -/** Entry point to ManagedLabsManager. The Managed Labs Client. */ -public final class ManagedLabsManager { - private ProviderOperations providerOperations; +/** Entry point to LabServicesManager. REST API for managing Azure Lab Services images. */ +public final class LabServicesManager { + private Images images; - private GlobalUsers globalUsers; - - private LabAccounts labAccounts; + private LabPlans labPlans; private Operations operations; - private GalleryImages galleryImages; - private Labs labs; - private EnvironmentSettings environmentSettings; + private OperationResults operationResults; - private Environments environments; + private Schedules schedules; private Users users; - private final ManagedLabsClient clientObject; + private VirtualMachines virtualMachines; + + private Usages usages; + + private Skus skus; - private ManagedLabsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private final LabServicesClient clientObject; + + private LabServicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = - new ManagedLabsClientBuilder() + new LabServicesClientBuilder() .pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) @@ -81,25 +87,25 @@ private ManagedLabsManager(HttpPipeline httpPipeline, AzureProfile profile, Dura } /** - * Creates an instance of ManagedLabs service API entry point. + * Creates an instance of LabServices service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the ManagedLabs service API instance. + * @return the LabServices service API instance. */ - public static ManagedLabsManager authenticate(TokenCredential credential, AzureProfile profile) { + public static LabServicesManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return configure().authenticate(credential, profile); } /** - * Gets a Configurable instance that can be used to create ManagedLabsManager with optional configuration. + * Gets a Configurable instance that can be used to create LabServicesManager with optional configuration. * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { - return new ManagedLabsManager.Configurable(); + return new LabServicesManager.Configurable(); } /** The Configurable allowing configurations to be set. */ @@ -109,6 +115,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; @@ -148,6 +155,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. * @@ -174,13 +192,13 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of ManagedLabs service API entry point. + * Creates an instance of LabServices service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the ManagedLabs service API instance. + * @return the LabServices service API instance. */ - public ManagedLabsManager authenticate(TokenCredential credential, AzureProfile profile) { + public LabServicesManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); @@ -190,7 +208,7 @@ public ManagedLabsManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.labservices") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -204,20 +222,33 @@ public ManagedLabsManager 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 = @@ -225,32 +256,24 @@ public ManagedLabsManager authenticate(TokenCredential credential, AzureProfile .httpClient(httpClient) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - return new ManagedLabsManager(httpPipeline, profile, defaultPollInterval); + return new LabServicesManager(httpPipeline, profile, defaultPollInterval); } } - /** @return Resource collection API of ProviderOperations. */ - public ProviderOperations providerOperations() { - if (this.providerOperations == null) { - this.providerOperations = new ProviderOperationsImpl(clientObject.getProviderOperations(), this); + /** @return Resource collection API of Images. */ + public Images images() { + if (this.images == null) { + this.images = new ImagesImpl(clientObject.getImages(), this); } - return providerOperations; + return images; } - /** @return Resource collection API of GlobalUsers. */ - public GlobalUsers globalUsers() { - if (this.globalUsers == null) { - this.globalUsers = new GlobalUsersImpl(clientObject.getGlobalUsers(), this); + /** @return Resource collection API of LabPlans. */ + public LabPlans labPlans() { + if (this.labPlans == null) { + this.labPlans = new LabPlansImpl(clientObject.getLabPlans(), this); } - return globalUsers; - } - - /** @return Resource collection API of LabAccounts. */ - public LabAccounts labAccounts() { - if (this.labAccounts == null) { - this.labAccounts = new LabAccountsImpl(clientObject.getLabAccounts(), this); - } - return labAccounts; + return labPlans; } /** @return Resource collection API of Operations. */ @@ -261,14 +284,6 @@ public Operations operations() { return operations; } - /** @return Resource collection API of GalleryImages. */ - public GalleryImages galleryImages() { - if (this.galleryImages == null) { - this.galleryImages = new GalleryImagesImpl(clientObject.getGalleryImages(), this); - } - return galleryImages; - } - /** @return Resource collection API of Labs. */ public Labs labs() { if (this.labs == null) { @@ -277,20 +292,20 @@ public Labs labs() { return labs; } - /** @return Resource collection API of EnvironmentSettings. */ - public EnvironmentSettings environmentSettings() { - if (this.environmentSettings == null) { - this.environmentSettings = new EnvironmentSettingsImpl(clientObject.getEnvironmentSettings(), this); + /** @return Resource collection API of OperationResults. */ + public OperationResults operationResults() { + if (this.operationResults == null) { + this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); } - return environmentSettings; + return operationResults; } - /** @return Resource collection API of Environments. */ - public Environments environments() { - if (this.environments == null) { - this.environments = new EnvironmentsImpl(clientObject.getEnvironments(), this); + /** @return Resource collection API of Schedules. */ + public Schedules schedules() { + if (this.schedules == null) { + this.schedules = new SchedulesImpl(clientObject.getSchedules(), this); } - return environments; + return schedules; } /** @return Resource collection API of Users. */ @@ -301,11 +316,35 @@ public Users users() { return users; } + /** @return Resource collection API of VirtualMachines. */ + public VirtualMachines virtualMachines() { + if (this.virtualMachines == null) { + this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); + } + return virtualMachines; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + /** - * @return Wrapped service client ManagedLabsClient providing direct access to the underlying auto-generated API + * @return Wrapped service client LabServicesClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. */ - public ManagedLabsClient serviceClient() { + public LabServicesClient serviceClient() { return this.clientObject; } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentSettingsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentSettingsClient.java deleted file mode 100644 index d066982a631e8..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentSettingsClient.java +++ /dev/null @@ -1,530 +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.labservices.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.labservices.fluent.models.EnvironmentSettingInner; -import com.azure.resourcemanager.labservices.models.EnvironmentSettingFragment; -import com.azure.resourcemanager.labservices.models.PublishPayload; - -/** An instance of this class provides access to all the operations defined in EnvironmentSettingsClient. */ -public interface EnvironmentSettingsClient { - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @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 the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labAccountName, String labName); - - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentSettingInner get( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - Context context); - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EnvironmentSettingInner> beginCreateOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting); - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, EnvironmentSettingInner> beginCreateOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting, - Context context); - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentSettingInner createOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting); - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentSettingInner createOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting, - Context context); - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, String labName, String environmentSettingName); - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Modify properties of environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentSettingInner update( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingFragment environmentSetting); - - /** - * Modify properties of environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingFragment environmentSetting, - Context context); - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 claimAny(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 claimAnyWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 publish( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload); - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 publishWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload, - Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentsClient.java deleted file mode 100644 index fa07348cf32be..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/EnvironmentsClient.java +++ /dev/null @@ -1,609 +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.labservices.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.labservices.fluent.models.EnvironmentInner; -import com.azure.resourcemanager.labservices.models.EnvironmentFragment; -import com.azure.resourcemanager.labservices.models.ResetPasswordPayload; - -/** An instance of this class provides access to all the operations defined in EnvironmentsClient. */ -public interface EnvironmentsClient { - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - String filter, - Integer top, - String orderby, - Context context); - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - EnvironmentInner get( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - String expand, - Context context); - - /** - * Create or replace an existing Environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentInner createOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentInner environment); - - /** - * Create or replace an existing Environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentInner environment, - Context context); - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Modify properties of environments. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnvironmentInner update( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentFragment environment); - - /** - * Modify properties of environments. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentFragment environment, - Context context); - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 claim( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 claimWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GalleryImagesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GalleryImagesClient.java deleted file mode 100644 index d83fe8ce94c8d..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GalleryImagesClient.java +++ /dev/null @@ -1,188 +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.labservices.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.labservices.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.labservices.models.GalleryImageFragment; - -/** An instance of this class provides access to all the operations defined in GalleryImagesClient. */ -public interface GalleryImagesClient { - /** - * List gallery images in a given lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labAccountName); - - /** - * List gallery images in a given lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context); - - /** - * Get gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName 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 labAccountName, String galleryImageName); - - /** - * Get gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - Response getWithResponse( - String resourceGroupName, String labAccountName, String galleryImageName, String expand, Context context); - - /** - * Create or replace an existing Gallery Image. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageInner createOrUpdate( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage); - - /** - * Create or replace an existing Gallery Image. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String labAccountName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context); - - /** - * Delete gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labAccountName, String galleryImageName); - - /** - * Delete gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String labAccountName, String galleryImageName, Context context); - - /** - * Modify properties of gallery images. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GalleryImageInner update( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage); - - /** - * Modify properties of gallery images. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String galleryImageName, - GalleryImageFragment galleryImage, - Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GlobalUsersClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GlobalUsersClient.java deleted file mode 100644 index dfdf2b560642e..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/GlobalUsersClient.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -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.labservices.fluent.models.GetEnvironmentResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.GetPersonalPreferencesResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.ListEnvironmentsResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.ListLabsResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.OperationBatchStatusResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.OperationStatusResponseInner; -import com.azure.resourcemanager.labservices.models.EnvironmentOperationsPayload; -import com.azure.resourcemanager.labservices.models.ListEnvironmentsPayload; -import com.azure.resourcemanager.labservices.models.OperationBatchStatusPayload; -import com.azure.resourcemanager.labservices.models.OperationStatusPayload; -import com.azure.resourcemanager.labservices.models.PersonalPreferencesOperationsPayload; -import com.azure.resourcemanager.labservices.models.RegisterPayload; -import com.azure.resourcemanager.labservices.models.ResetPasswordPayload; - -/** An instance of this class provides access to all the operations defined in GlobalUsersClient. */ -public interface GlobalUsersClient { - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetEnvironmentResponseInner getEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param expand Specify the $expand query. Example: 'properties($expand=environment)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getEnvironmentWithResponse( - String username, EnvironmentOperationsPayload environmentOperationsPayload, String expand, Context context); - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationBatchStatusResponseInner getOperationBatchStatus( - String username, OperationBatchStatusPayload operationBatchStatusPayload); - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOperationBatchStatusWithResponse( - String username, OperationBatchStatusPayload operationBatchStatusPayload, Context context); - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResponseInner getOperationStatus(String username, OperationStatusPayload operationStatusPayload); - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOperationStatusWithResponse( - String username, OperationStatusPayload operationStatusPayload, Context context); - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetPersonalPreferencesResponseInner getPersonalPreferences( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload); - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getPersonalPreferencesWithResponse( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, Context context); - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ListEnvironmentsResponseInner listEnvironments(String username, ListEnvironmentsPayload listEnvironmentsPayload); - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listEnvironmentsWithResponse( - String username, ListEnvironmentsPayload listEnvironmentsPayload, Context context); - - /** - * List labs for the user. - * - * @param username The name of the user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ListLabsResponseInner listLabs(String username); - - /** - * List labs for the user. - * - * @param username The name of the user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listLabsWithResponse(String username, Context context); - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 register(String username, RegisterPayload registerPayload); - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 registerWithResponse(String username, RegisterPayload registerPayload, Context context); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetPassword(String username, ResetPasswordPayload resetPasswordPayload); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginResetPassword( - String username, ResetPasswordPayload resetPasswordPayload, Context context); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword(String username, ResetPasswordPayload resetPasswordPayload); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword(String username, ResetPasswordPayload resetPasswordPayload, Context context); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStartEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStartEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 startEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 startEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStopEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStopEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stopEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stopEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ImagesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ImagesClient.java new file mode 100644 index 0000000000000..d1a0b69aefd01 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ImagesClient.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.labservices.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.labservices.fluent.models.ImageInner; +import com.azure.resourcemanager.labservices.models.ImageUpdate; + +/** An instance of this class provides access to all the operations defined in ImagesClient. */ +public interface ImagesClient { + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLabPlan(String resourceGroupName, String labPlanName); + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLabPlan( + String resourceGroupName, String labPlanName, String filter, Context context); + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner get(String resourceGroupName, String labPlanName, String imageName); + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String labPlanName, String imageName, Context context); + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 services virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner createOrUpdate(String resourceGroupName, String labPlanName, String imageName, ImageInner body); + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 services virtual machine image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String labPlanName, String imageName, ImageInner body, Context context); + + /** + * Updates an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 services virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImageInner update(String resourceGroupName, String labPlanName, String imageName, ImageUpdate body); + + /** + * Updates an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 services virtual machine image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String labPlanName, String imageName, ImageUpdate body, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabAccountsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabAccountsClient.java deleted file mode 100644 index 3a2111adae271..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabAccountsClient.java +++ /dev/null @@ -1,274 +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.labservices.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.labservices.fluent.models.GetRegionalAvailabilityResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.LabAccountInner; -import com.azure.resourcemanager.labservices.models.CreateLabProperties; -import com.azure.resourcemanager.labservices.models.LabAccountFragment; - -/** An instance of this class provides access to all the operations defined in LabAccountsClient. */ -public interface LabAccountsClient { - /** - * List lab accounts in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List lab accounts in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); - - /** - * List lab accounts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List lab accounts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context); - - /** - * Get lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabAccountInner getByResourceGroup(String resourceGroupName, String labAccountName); - - /** - * Get lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String labAccountName, String expand, Context context); - - /** - * Create or replace an existing Lab Account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabAccountInner createOrUpdate(String resourceGroupName, String labAccountName, LabAccountInner labAccount); - - /** - * Create or replace an existing Lab Account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String labAccountName, LabAccountInner labAccount, Context context); - - /** - * Delete lab account. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String labAccountName); - - /** - * Delete lab account. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String labAccountName, Context context); - - /** - * Delete lab account. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName); - - /** - * Delete lab account. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, Context context); - - /** - * Modify properties of lab accounts. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabAccountInner update(String resourceGroupName, String labAccountName, LabAccountFragment labAccount); - - /** - * Modify properties of lab accounts. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String labAccountName, LabAccountFragment labAccount, Context context); - - /** - * Create a lab in a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 createLab(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties); - - /** - * Create a lab in a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 createLabWithResponse( - String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties, Context context); - - /** - * Get regional availability information for each size category configured under a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetRegionalAvailabilityResponseInner getRegionalAvailability(String resourceGroupName, String labAccountName); - - /** - * Get regional availability information for each size category configured under a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getRegionalAvailabilityWithResponse( - String resourceGroupName, String labAccountName, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabPlansClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabPlansClient.java new file mode 100644 index 0000000000000..885d63019a2a6 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabPlansClient.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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.labservices.fluent.models.LabPlanInner; +import com.azure.resourcemanager.labservices.models.LabPlanUpdate; +import com.azure.resourcemanager.labservices.models.SaveImageBody; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LabPlansClient. */ +public interface LabPlansClient { + /** + * Returns a list of all lab plans within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns a list of all lab plans within a subscription. + * + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); + + /** + * Returns a list of all lab plans for a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns a list of all lab plans for a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves the properties of a Lab Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabPlanInner getByResourceGroup(String resourceGroupName, String labPlanName); + + /** + * Retrieves the properties of a Lab Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String labPlanName, Context context); + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabPlanInner> beginCreateOrUpdate( + String resourceGroupName, String labPlanName, LabPlanInner body); + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabPlanInner> beginCreateOrUpdate( + String resourceGroupName, String labPlanName, LabPlanInner body, Context context); + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body); + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body, Context context); + + /** + * Operation to update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabPlanInner> beginUpdate( + String resourceGroupName, String labPlanName, LabPlanUpdate body); + + /** + * Operation to update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabPlanInner> beginUpdate( + String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context); + + /** + * Operation to update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body); + + /** + * Operation to update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labPlanName); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labPlanName, Context context); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 labPlanName); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 labPlanName, Context context); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSaveImage(String resourceGroupName, String labPlanName, SaveImageBody body); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSaveImage( + String resourceGroupName, String labPlanName, SaveImageBody body, Context context); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 saveImage(String resourceGroupName, String labPlanName, SaveImageBody body); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ManagedLabsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabServicesClient.java similarity index 57% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ManagedLabsClient.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabServicesClient.java index c79ae9f6d3a5e..2e975aa8468ec 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ManagedLabsClient.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabServicesClient.java @@ -7,10 +7,10 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for ManagedLabsClient class. */ -public interface ManagedLabsClient { +/** The interface for LabServicesClient class. */ +public interface LabServicesClient { /** - * Gets The subscription ID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -45,25 +45,18 @@ public interface ManagedLabsClient { Duration getDefaultPollInterval(); /** - * Gets the ProviderOperationsClient object to access its operations. + * Gets the ImagesClient object to access its operations. * - * @return the ProviderOperationsClient object. + * @return the ImagesClient object. */ - ProviderOperationsClient getProviderOperations(); + ImagesClient getImages(); /** - * Gets the GlobalUsersClient object to access its operations. + * Gets the LabPlansClient object to access its operations. * - * @return the GlobalUsersClient object. + * @return the LabPlansClient object. */ - GlobalUsersClient getGlobalUsers(); - - /** - * Gets the LabAccountsClient object to access its operations. - * - * @return the LabAccountsClient object. - */ - LabAccountsClient getLabAccounts(); + LabPlansClient getLabPlans(); /** * Gets the OperationsClient object to access its operations. @@ -72,13 +65,6 @@ public interface ManagedLabsClient { */ OperationsClient getOperations(); - /** - * Gets the GalleryImagesClient object to access its operations. - * - * @return the GalleryImagesClient object. - */ - GalleryImagesClient getGalleryImages(); - /** * Gets the LabsClient object to access its operations. * @@ -87,18 +73,18 @@ public interface ManagedLabsClient { LabsClient getLabs(); /** - * Gets the EnvironmentSettingsClient object to access its operations. + * Gets the OperationResultsClient object to access its operations. * - * @return the EnvironmentSettingsClient object. + * @return the OperationResultsClient object. */ - EnvironmentSettingsClient getEnvironmentSettings(); + OperationResultsClient getOperationResults(); /** - * Gets the EnvironmentsClient object to access its operations. + * Gets the SchedulesClient object to access its operations. * - * @return the EnvironmentsClient object. + * @return the SchedulesClient object. */ - EnvironmentsClient getEnvironments(); + SchedulesClient getSchedules(); /** * Gets the UsersClient object to access its operations. @@ -106,4 +92,25 @@ public interface ManagedLabsClient { * @return the UsersClient object. */ UsersClient getUsers(); + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + VirtualMachinesClient getVirtualMachines(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabsClient.java index 05fae4c04f042..d819fa36278fb 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabsClient.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/LabsClient.java @@ -12,262 +12,380 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.AddUsersPayload; -import com.azure.resourcemanager.labservices.models.LabFragment; +import com.azure.resourcemanager.labservices.models.LabUpdate; +import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in LabsClient. */ public interface LabsClient { /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labAccountName); + PagedIterable list(); /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + PagedIterable list(String filter, Context context); /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - LabInner get(String resourceGroupName, String labAccountName, String labName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String labAccountName, String labName, String expand, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Create or replace an existing Lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - LabInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, LabInner lab); + LabInner getByResourceGroup(String resourceGroupName, String labName); /** - * Create or replace an existing Lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String labAccountName, String labName, LabInner lab, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String labName, Context context); + + /** + * Operation to create or update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabInner> beginCreateOrUpdate( + String resourceGroupName, String labName, LabInner body); + + /** + * Operation to create or update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabInner> beginCreateOrUpdate( + String resourceGroupName, String labName, LabInner body, Context context); /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String labAccountName, String labName); + LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body); /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, Context context); + LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body, Context context); /** - * Delete lab. This operation can take a while to complete. + * Operation to update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabInner> beginUpdate(String resourceGroupName, String labName, LabUpdate body); + + /** + * Operation to update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LabInner> beginUpdate( + String resourceGroupName, String labName, LabUpdate body, Context context); + + /** + * Operation to update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labAccountName, String labName); + LabInner update(String resourceGroupName, String labName, LabUpdate body); /** - * Delete lab. This operation can take a while to complete. + * Operation to update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String labAccountName, String labName, Context context); + LabInner update(String resourceGroupName, String labName, LabUpdate body, Context context); + + /** + * Operation to delete a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labName); + + /** + * Operation to delete a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, Context context); /** - * Modify properties of labs. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - LabInner update(String resourceGroupName, String labAccountName, String labName, LabFragment lab); + void delete(String resourceGroupName, String labName); /** - * Modify properties of labs. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String labAccountName, String labName, LabFragment lab, Context context); + void delete(String resourceGroupName, String labName, Context context); + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String labName); + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPublish(String resourceGroupName, String labName, Context context); /** - * Add users to a lab. + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 addUsers(String resourceGroupName, String labAccountName, String labName, AddUsersPayload addUsersPayload); + void publish(String resourceGroupName, String labName); /** - * Add users to a lab. + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 addUsersWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - AddUsersPayload addUsersPayload, - Context context); + void publish(String resourceGroupName, String labName, Context context); + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSyncGroup(String resourceGroupName, String labName); + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSyncGroup(String resourceGroupName, String labName, Context context); /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 register(String resourceGroupName, String labAccountName, String labName); + void syncGroup(String resourceGroupName, String labName); /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 registerWithResponse( - String resourceGroupName, String labAccountName, String labName, Context context); + void syncGroup(String resourceGroupName, String labName, Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationResultsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationResultsClient.java new file mode 100644 index 0000000000000..8d7dd8fdd8925 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationResultsClient.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.labservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; + +/** An instance of this class provides access to all the operations defined in OperationResultsClient. */ +public interface OperationResultsClient { + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a long running operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultInner get(String operationResultId); + + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a long running operation result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String operationResultId, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationsClient.java index 4a4b634df9b59..e37b1ec855965 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationsClient.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/OperationsClient.java @@ -6,36 +6,31 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; +import com.azure.resourcemanager.labservices.fluent.models.OperationInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a list of REST API operations supported by an Azure Resource Provider. */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultInner get(String locationName, String operationName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String operationName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SchedulesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SchedulesClient.java new file mode 100644 index 0000000000000..bb82b2b3785e0 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SchedulesClient.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.labservices.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.labservices.fluent.models.ScheduleInner; +import com.azure.resourcemanager.labservices.models.ScheduleUpdate; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SchedulesClient. */ +public interface SchedulesClient { + /** + * Returns a list of all schedules for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of schedules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLab(String resourceGroupName, String labName); + + /** + * Returns a list of all schedules for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of schedules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); + + /** + * Returns the properties of a lab Schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for automatically turning virtual machines in a lab on and off at specified times. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduleInner get(String resourceGroupName, String labName, String scheduleName); + + /** + * Returns the properties of a lab Schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String labName, String scheduleName, Context context); + + /** + * Operation to create or update a lab schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for automatically turning virtual machines in a lab on and off at specified times. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduleInner createOrUpdate(String resourceGroupName, String labName, String scheduleName, ScheduleInner body); + + /** + * Operation to create or update a lab schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String labName, String scheduleName, ScheduleInner body, Context context); + + /** + * Operation to update a lab schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for automatically turning virtual machines in a lab on and off at specified times. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScheduleInner update(String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body); + + /** + * Operation to update a lab schedule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body, Context context); + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String scheduleName); + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String scheduleName, Context context); + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 scheduleName); + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 scheduleName, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ProviderOperationsClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SkusClient.java similarity index 68% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ProviderOperationsClient.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SkusClient.java index bada5d64c7979..4d9138c2d824e 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/ProviderOperationsClient.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/SkusClient.java @@ -8,29 +8,30 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.OperationMetadataInner; +import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; -/** An instance of this class provides access to all the operations defined in ProviderOperationsClient. */ -public interface ProviderOperationsClient { +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * * @throws com.azure.core.management.exception.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 paged list of lab services skus. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * + * @param filter The filter to apply to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return paged list of lab services skus. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(String filter, Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsagesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsagesClient.java new file mode 100644 index 0000000000000..ffd2c7787ebb1 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsagesClient.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.labservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, String filter, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsersClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsersClient.java index 67fb01d644a30..dbcf10a7f46f9 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsersClient.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/UsersClient.java @@ -12,228 +12,338 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.azure.resourcemanager.labservices.models.UserFragment; +import com.azure.resourcemanager.labservices.models.InviteBody; +import com.azure.resourcemanager.labservices.models.UserUpdate; +import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in UsersClient. */ public interface UsersClient { /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String labAccountName, String labName); + PagedIterable listByLab(String resourceGroupName, String labName); /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return user of a lab that can register for and use virtual machines within the lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserInner get(String resourceGroupName, String labAccountName, String labName, String username); + UserInner get(String resourceGroupName, String labName, String username); /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - String expand, - Context context); + Response getWithResponse(String resourceGroupName, String labName, String username, Context context); /** - * Create or replace an existing User. + * Operation to create or update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UserInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String username, UserInner body); + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UserInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String username, UserInner body, Context context); + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 of a lab that can register for and use virtual machines within the lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserInner createOrUpdate( - String resourceGroupName, String labAccountName, String labName, String username, UserInner user); + UserInner createOrUpdate(String resourceGroupName, String labName, String username, UserInner body); /** - * Create or replace an existing User. + * Operation to create or update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return user of a lab that can register for and use virtual machines within the lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - UserInner user, - Context context); + UserInner createOrUpdate( + String resourceGroupName, String labName, String username, UserInner body, Context context); + + /** + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UserInner> beginUpdate( + String resourceGroupName, String labName, String username, UserUpdate body); + + /** + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UserInner> beginUpdate( + String resourceGroupName, String labName, String username, UserUpdate body, Context context); /** - * Delete user. This operation can take a while to complete. + * Operation to update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return user of a lab that can register for and use virtual machines within the lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, String username); + UserInner update(String resourceGroupName, String labName, String username, UserUpdate body); /** - * Delete user. This operation can take a while to complete. + * Operation to update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return user of a lab that can register for and use virtual machines within the lab. */ @ServiceMethod(returns = ReturnType.SINGLE) + UserInner update(String resourceGroupName, String labName, String username, UserUpdate body, Context context); + + /** + * Operation to delete a user resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username); + + /** + * Operation to delete a user resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, String username, Context context); + String resourceGroupName, String labName, String username, Context context); /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labAccountName, String labName, String username); + void delete(String resourceGroupName, String labName, String username); /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labAccountName, String labName, String username, Context context); + void delete(String resourceGroupName, String labName, String username, Context context); + + /** + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInvite( + String resourceGroupName, String labName, String username, InviteBody body); + + /** + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginInvite( + String resourceGroupName, String labName, String username, InviteBody body, Context context); /** - * Modify properties of users. + * Operation to invite a user to a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserInner update( - String resourceGroupName, String labAccountName, String labName, String username, UserFragment user); + void invite(String resourceGroupName, String labName, String username, InviteBody body); /** - * Modify properties of users. + * Operation to invite a user to a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - UserFragment user, - Context context); + void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/VirtualMachinesClient.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/VirtualMachinesClient.java new file mode 100644 index 0000000000000..c3e04ca40cb89 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/VirtualMachinesClient.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.labservices.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.labservices.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.labservices.models.ResetPasswordBody; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +public interface VirtualMachinesClient { + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLab(String resourceGroupName, String labName); + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLab( + String resourceGroupName, String labName, String filter, Context context); + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtual machine resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner get(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtual machine resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart( + String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop( + String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage( + String resourceGroupName, String labName, String virtualMachineName); + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginReimage( + String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRedeploy( + String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRedeploy( + String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 redeploy(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body); + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context); + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetPassword(String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body); + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentInner.java deleted file mode 100644 index dc8c63cebbc0f..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentInner.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import com.azure.resourcemanager.labservices.models.NetworkInterface; -import com.azure.resourcemanager.labservices.models.ResourceSet; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Represents an environment instance. */ -@JsonFlatten -@Fluent -public class EnvironmentInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentInner.class); - - /* - * The set of a VM and the setting id it was created for - */ - @JsonProperty(value = "properties.resourceSets") - private ResourceSet resourceSets; - - /* - * The AAD object Id of the user who has claimed the environment - */ - @JsonProperty(value = "properties.claimedByUserObjectId", access = JsonProperty.Access.WRITE_ONLY) - private String claimedByUserObjectId; - - /* - * The user principal Id of the user who has claimed the environment - */ - @JsonProperty(value = "properties.claimedByUserPrincipalId", access = JsonProperty.Access.WRITE_ONLY) - private String claimedByUserPrincipalId; - - /* - * The name or email address of the user who has claimed the environment - */ - @JsonProperty(value = "properties.claimedByUserName", access = JsonProperty.Access.WRITE_ONLY) - private String claimedByUsername; - - /* - * Is the environment claimed or not - */ - @JsonProperty(value = "properties.isClaimed", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isClaimed; - - /* - * Last known power state of the environment - */ - @JsonProperty(value = "properties.lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) - private String lastKnownPowerState; - - /* - * Network details of the environment - */ - @JsonProperty(value = "properties.networkInterface", access = JsonProperty.Access.WRITE_ONLY) - private NetworkInterface networkInterface; - - /* - * How long the environment has been used by a lab user - */ - @JsonProperty(value = "properties.totalUsage", access = JsonProperty.Access.WRITE_ONLY) - private Duration totalUsage; - - /* - * When the password was last reset on the environment. - */ - @JsonProperty(value = "properties.passwordLastReset", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime passwordLastReset; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /* - * The details of the latest operation. ex: status, error - */ - @JsonProperty(value = "properties.latestOperationResult", access = JsonProperty.Access.WRITE_ONLY) - private LatestOperationResult latestOperationResult; - - /** - * Get the resourceSets property: The set of a VM and the setting id it was created for. - * - * @return the resourceSets value. - */ - public ResourceSet resourceSets() { - return this.resourceSets; - } - - /** - * Set the resourceSets property: The set of a VM and the setting id it was created for. - * - * @param resourceSets the resourceSets value to set. - * @return the EnvironmentInner object itself. - */ - public EnvironmentInner withResourceSets(ResourceSet resourceSets) { - this.resourceSets = resourceSets; - return this; - } - - /** - * Get the claimedByUserObjectId property: The AAD object Id of the user who has claimed the environment. - * - * @return the claimedByUserObjectId value. - */ - public String claimedByUserObjectId() { - return this.claimedByUserObjectId; - } - - /** - * Get the claimedByUserPrincipalId property: The user principal Id of the user who has claimed the environment. - * - * @return the claimedByUserPrincipalId value. - */ - public String claimedByUserPrincipalId() { - return this.claimedByUserPrincipalId; - } - - /** - * Get the claimedByUsername property: The name or email address of the user who has claimed the environment. - * - * @return the claimedByUsername value. - */ - public String claimedByUsername() { - return this.claimedByUsername; - } - - /** - * Get the isClaimed property: Is the environment claimed or not. - * - * @return the isClaimed value. - */ - public Boolean isClaimed() { - return this.isClaimed; - } - - /** - * Get the lastKnownPowerState property: Last known power state of the environment. - * - * @return the lastKnownPowerState value. - */ - public String lastKnownPowerState() { - return this.lastKnownPowerState; - } - - /** - * Get the networkInterface property: Network details of the environment. - * - * @return the networkInterface value. - */ - public NetworkInterface networkInterface() { - return this.networkInterface; - } - - /** - * Get the totalUsage property: How long the environment has been used by a lab user. - * - * @return the totalUsage value. - */ - public Duration totalUsage() { - return this.totalUsage; - } - - /** - * Get the passwordLastReset property: When the password was last reset on the environment. - * - * @return the passwordLastReset value. - */ - public OffsetDateTime passwordLastReset() { - return this.passwordLastReset; - } - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the EnvironmentInner object itself. - */ - public EnvironmentInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the EnvironmentInner object itself. - */ - public EnvironmentInner withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** - * Get the latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - public LatestOperationResult latestOperationResult() { - return this.latestOperationResult; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceSets() != null) { - resourceSets().validate(); - } - if (networkInterface() != null) { - networkInterface().validate(); - } - if (latestOperationResult() != null) { - latestOperationResult().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentSettingInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentSettingInner.java deleted file mode 100644 index 2e7b0db59a64f..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/EnvironmentSettingInner.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.ConfigurationState; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import com.azure.resourcemanager.labservices.models.PublishingState; -import com.azure.resourcemanager.labservices.models.ResourceSettings; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Represents settings of an environment, from which environment instances would be created. */ -@JsonFlatten -@Fluent -public class EnvironmentSettingInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentSettingInner.class); - - /* - * Describes the readiness of this environment setting - */ - @JsonProperty(value = "properties.publishingState", access = JsonProperty.Access.WRITE_ONLY) - private PublishingState publishingState; - - /* - * Describes the user's progress in configuring their environment setting - */ - @JsonProperty(value = "properties.configurationState") - private ConfigurationState configurationState; - - /* - * Describes the environment and its resource settings - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * Brief title describing the environment and its resource settings - */ - @JsonProperty(value = "properties.title") - private String title; - - /* - * The resource specific settings - */ - @JsonProperty(value = "properties.resourceSettings") - private ResourceSettings resourceSettings; - - /* - * Time when the template VM was last changed. - */ - @JsonProperty(value = "properties.lastChanged", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastChanged; - - /* - * Time when the template VM was last sent for publishing. - */ - @JsonProperty(value = "properties.lastPublished", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastPublished; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /* - * The details of the latest operation. ex: status, error - */ - @JsonProperty(value = "properties.latestOperationResult", access = JsonProperty.Access.WRITE_ONLY) - private LatestOperationResult latestOperationResult; - - /** - * Get the publishingState property: Describes the readiness of this environment setting. - * - * @return the publishingState value. - */ - public PublishingState publishingState() { - return this.publishingState; - } - - /** - * Get the configurationState property: Describes the user's progress in configuring their environment setting. - * - * @return the configurationState value. - */ - public ConfigurationState configurationState() { - return this.configurationState; - } - - /** - * Set the configurationState property: Describes the user's progress in configuring their environment setting. - * - * @param configurationState the configurationState value to set. - * @return the EnvironmentSettingInner object itself. - */ - public EnvironmentSettingInner withConfigurationState(ConfigurationState configurationState) { - this.configurationState = configurationState; - return this; - } - - /** - * Get the description property: Describes the environment and its resource settings. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Describes the environment and its resource settings. - * - * @param description the description value to set. - * @return the EnvironmentSettingInner object itself. - */ - public EnvironmentSettingInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the title property: Brief title describing the environment and its resource settings. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Brief title describing the environment and its resource settings. - * - * @param title the title value to set. - * @return the EnvironmentSettingInner object itself. - */ - public EnvironmentSettingInner withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the resourceSettings property: The resource specific settings. - * - * @return the resourceSettings value. - */ - public ResourceSettings resourceSettings() { - return this.resourceSettings; - } - - /** - * Set the resourceSettings property: The resource specific settings. - * - * @param resourceSettings the resourceSettings value to set. - * @return the EnvironmentSettingInner object itself. - */ - public EnvironmentSettingInner withResourceSettings(ResourceSettings resourceSettings) { - this.resourceSettings = resourceSettings; - return this; - } - - /** - * Get the lastChanged property: Time when the template VM was last changed. - * - * @return the lastChanged value. - */ - public OffsetDateTime lastChanged() { - return this.lastChanged; - } - - /** - * Get the lastPublished property: Time when the template VM was last sent for publishing. - * - * @return the lastPublished value. - */ - public OffsetDateTime lastPublished() { - return this.lastPublished; - } - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the EnvironmentSettingInner object itself. - */ - public EnvironmentSettingInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the EnvironmentSettingInner object itself. - */ - public EnvironmentSettingInner withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** - * Get the latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - public LatestOperationResult latestOperationResult() { - return this.latestOperationResult; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentSettingInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentSettingInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceSettings() != null) { - resourceSettings().validate(); - } - if (latestOperationResult() != null) { - latestOperationResult().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GalleryImageInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GalleryImageInner.java deleted file mode 100644 index 2430b363c566d..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GalleryImageInner.java +++ /dev/null @@ -1,286 +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.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.GalleryImageReference; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Represents an image from the Azure Marketplace. */ -@JsonFlatten -@Fluent -public class GalleryImageInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageInner.class); - - /* - * The author of the gallery image. - */ - @JsonProperty(value = "properties.author", access = JsonProperty.Access.WRITE_ONLY) - private String author; - - /* - * The creation date of the gallery image. - */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; - - /* - * The description of the gallery image. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The image reference of the gallery image. - */ - @JsonProperty(value = "properties.imageReference", access = JsonProperty.Access.WRITE_ONLY) - private GalleryImageReference imageReference; - - /* - * The icon of the gallery image. - */ - @JsonProperty(value = "properties.icon", access = JsonProperty.Access.WRITE_ONLY) - private String icon; - - /* - * Indicates whether this gallery image is enabled. - */ - @JsonProperty(value = "properties.isEnabled") - private Boolean isEnabled; - - /* - * Indicates whether this gallery has been overridden for this lab account - */ - @JsonProperty(value = "properties.isOverride") - private Boolean isOverride; - - /* - * The third party plan that applies to this image - */ - @JsonProperty(value = "properties.planId", access = JsonProperty.Access.WRITE_ONLY) - private String planId; - - /* - * Indicates if the plan has been authorized for programmatic deployment. - */ - @JsonProperty(value = "properties.isPlanAuthorized") - private Boolean isPlanAuthorized; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /* - * The details of the latest operation. ex: status, error - */ - @JsonProperty(value = "properties.latestOperationResult", access = JsonProperty.Access.WRITE_ONLY) - private LatestOperationResult latestOperationResult; - - /** - * Get the author property: The author of the gallery image. - * - * @return the author value. - */ - public String author() { - return this.author; - } - - /** - * 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; - } - - /** - * Get the imageReference property: The image reference of the gallery image. - * - * @return the imageReference value. - */ - public GalleryImageReference imageReference() { - return this.imageReference; - } - - /** - * Get the icon property: The icon of the gallery image. - * - * @return the icon value. - */ - public String icon() { - return this.icon; - } - - /** - * Get the isEnabled property: Indicates whether this gallery image is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether this gallery image is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the isOverride property: Indicates whether this gallery has been overridden for this lab account. - * - * @return the isOverride value. - */ - public Boolean isOverride() { - return this.isOverride; - } - - /** - * Set the isOverride property: Indicates whether this gallery has been overridden for this lab account. - * - * @param isOverride the isOverride value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withIsOverride(Boolean isOverride) { - this.isOverride = isOverride; - 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; - } - - /** - * 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 GalleryImageInner object itself. - */ - public GalleryImageInner 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; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the GalleryImageInner object itself. - */ - public GalleryImageInner withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** - * Get the latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - public LatestOperationResult latestOperationResult() { - return this.latestOperationResult; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (imageReference() != null) { - imageReference().validate(); - } - if (latestOperationResult() != null) { - latestOperationResult().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetEnvironmentResponseInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetEnvironmentResponseInner.java deleted file mode 100644 index 28789ba5f0858..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetEnvironmentResponseInner.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.EnvironmentDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents the environments details. */ -@Immutable -public final class GetEnvironmentResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetEnvironmentResponseInner.class); - - /* - * Details of the environment - */ - @JsonProperty(value = "environment", access = JsonProperty.Access.WRITE_ONLY) - private EnvironmentDetails environment; - - /** - * Get the environment property: Details of the environment. - * - * @return the environment value. - */ - public EnvironmentDetails environment() { - return this.environment; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (environment() != null) { - environment().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetPersonalPreferencesResponseInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetPersonalPreferencesResponseInner.java deleted file mode 100644 index b9fab2fc14050..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetPersonalPreferencesResponseInner.java +++ /dev/null @@ -1,77 +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.labservices.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.util.List; - -/** Represents the PersonalPreferences for the user. */ -@Fluent -public final class GetPersonalPreferencesResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetPersonalPreferencesResponseInner.class); - - /* - * Id to be used by the cache orchestrator - */ - @JsonProperty(value = "id") - private String id; - - /* - * Array of favorite lab resource ids - */ - @JsonProperty(value = "favoriteLabResourceIds") - private List favoriteLabResourceIds; - - /** - * Get the id property: Id to be used by the cache orchestrator. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Id to be used by the cache orchestrator. - * - * @param id the id value to set. - * @return the GetPersonalPreferencesResponseInner object itself. - */ - public GetPersonalPreferencesResponseInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the favoriteLabResourceIds property: Array of favorite lab resource ids. - * - * @return the favoriteLabResourceIds value. - */ - public List favoriteLabResourceIds() { - return this.favoriteLabResourceIds; - } - - /** - * Set the favoriteLabResourceIds property: Array of favorite lab resource ids. - * - * @param favoriteLabResourceIds the favoriteLabResourceIds value to set. - * @return the GetPersonalPreferencesResponseInner object itself. - */ - public GetPersonalPreferencesResponseInner withFavoriteLabResourceIds(List favoriteLabResourceIds) { - this.favoriteLabResourceIds = favoriteLabResourceIds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetRegionalAvailabilityResponseInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetRegionalAvailabilityResponseInner.java deleted file mode 100644 index 2335fa78ff39a..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/GetRegionalAvailabilityResponseInner.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.RegionalAvailability; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response model from the GetRegionalAvailability action. */ -@Fluent -public final class GetRegionalAvailabilityResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetRegionalAvailabilityResponseInner.class); - - /* - * Availability information for different size categories per region - */ - @JsonProperty(value = "regionalAvailability") - private List regionalAvailability; - - /** - * Get the regionalAvailability property: Availability information for different size categories per region. - * - * @return the regionalAvailability value. - */ - public List regionalAvailability() { - return this.regionalAvailability; - } - - /** - * Set the regionalAvailability property: Availability information for different size categories per region. - * - * @param regionalAvailability the regionalAvailability value to set. - * @return the GetRegionalAvailabilityResponseInner object itself. - */ - public GetRegionalAvailabilityResponseInner withRegionalAvailability( - List regionalAvailability) { - this.regionalAvailability = regionalAvailability; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (regionalAvailability() != null) { - regionalAvailability().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageInner.java new file mode 100644 index 0000000000000..163cd14ea210b --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageInner.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.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.OsState; +import com.azure.resourcemanager.labservices.models.OsType; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Lab services virtual machine image. */ +@Fluent +public final class ImageInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageInner.class); + + /* + * Metadata pertaining to creation and last modification of the image. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Image resource properties + */ + @JsonProperty(value = "properties", required = true) + private ImageProperties innerProperties = new ImageProperties(); + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the image. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Image resource properties. + * + * @return the innerProperties value. + */ + private ImageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Current provisioning state of the image. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the displayName property: The image display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the description property: A description of the image. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the iconUrl property: URL of the image icon. + * + * @return the iconUrl value. + */ + public String iconUrl() { + return this.innerProperties() == null ? null : this.innerProperties().iconUrl(); + } + + /** + * Get the author property: The image author. + * + * @return the author value. + */ + public String author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Get the osType property: The OS Type of the image. + * + * @return the osType value. + */ + public OsType osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Get the plan property: The ID of marketplace plan associated with the image (optional). + * + * @return the plan value. + */ + public String plan() { + return this.innerProperties() == null ? null : this.innerProperties().plan(); + } + + /** + * Get the termsStatus property: The status of image terms of use (enabled = accepted, disabled = not accepted). + * + * @return the termsStatus value. + */ + public EnableState termsStatus() { + return this.innerProperties() == null ? null : this.innerProperties().termsStatus(); + } + + /** + * Get the offer property: The ID of an offer associated with the image. + * + * @return the offer value. + */ + public String offer() { + return this.innerProperties() == null ? null : this.innerProperties().offer(); + } + + /** + * Get the publisher property: The ID of the publisher of the image. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Get the sku property: The image SKU. + * + * @return the sku value. + */ + public String sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Get the version property: The image version. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the sharedGalleryId property: The ID for the image in the shared gallery. + * + * @return the sharedGalleryId value. + */ + public String sharedGalleryId() { + return this.innerProperties() == null ? null : this.innerProperties().sharedGalleryId(); + } + + /** + * Get the availableRegions property: The available regions of the image in the shared gallery. + * + * @return the availableRegions value. + */ + public List availableRegions() { + return this.innerProperties() == null ? null : this.innerProperties().availableRegions(); + } + + /** + * Set the availableRegions property: The available regions of the image in the shared gallery. + * + * @param availableRegions the availableRegions value to set. + * @return the ImageInner object itself. + */ + public ImageInner withAvailableRegions(List availableRegions) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withAvailableRegions(availableRegions); + return this; + } + + /** + * Get the osState property: The OS State of the image. + * + * @return the osState value. + */ + public OsState osState() { + return this.innerProperties() == null ? null : this.innerProperties().osState(); + } + + /** + * Get the enabledState property: Is the image enabled. + * + * @return the enabledState value. + */ + public EnableState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Is the image enabled. + * + * @param enabledState the enabledState value to set. + * @return the ImageInner object itself. + */ + public ImageInner withEnabledState(EnableState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageProperties(); + } + this.innerProperties().withEnabledState(enabledState); + 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 ImageInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageProperties.java new file mode 100644 index 0000000000000..b22b947568c40 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageProperties.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.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.OsState; +import com.azure.resourcemanager.labservices.models.OsType; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of an image resource. */ +@Fluent +public final class ImageProperties extends ImageUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageProperties.class); + + /* + * Current provisioning state of the image. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The image display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * A description of the image. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * URL of the image icon. + */ + @JsonProperty(value = "iconUrl", access = JsonProperty.Access.WRITE_ONLY) + private String iconUrl; + + /* + * The image author. + */ + @JsonProperty(value = "author", access = JsonProperty.Access.WRITE_ONLY) + private String author; + + /* + * The OS Type of the image. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private OsType osType; + + /* + * The ID of marketplace plan associated with the image (optional). + */ + @JsonProperty(value = "plan", access = JsonProperty.Access.WRITE_ONLY) + private String plan; + + /* + * The status of image terms of use (enabled = accepted, disabled = not + * accepted). + */ + @JsonProperty(value = "termsStatus", access = JsonProperty.Access.WRITE_ONLY) + private EnableState termsStatus; + + /* + * The ID of an offer associated with the image. + */ + @JsonProperty(value = "offer", access = JsonProperty.Access.WRITE_ONLY) + private String offer; + + /* + * The ID of the publisher of the image. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * The image SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private String sku; + + /* + * The image version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The ID for the image in the shared gallery. + */ + @JsonProperty(value = "sharedGalleryId", access = JsonProperty.Access.WRITE_ONLY) + private String sharedGalleryId; + + /* + * The available regions of the image in the shared gallery. + */ + @JsonProperty(value = "availableRegions") + private List availableRegions; + + /* + * The OS State of the image. + */ + @JsonProperty(value = "osState", access = JsonProperty.Access.WRITE_ONLY) + private OsState osState; + + /** + * Get the provisioningState property: Current provisioning state of the image. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the displayName property: The image display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: A description of the image. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the iconUrl property: URL of the image icon. + * + * @return the iconUrl value. + */ + public String iconUrl() { + return this.iconUrl; + } + + /** + * Get the author property: The image author. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Get the osType property: The OS Type of the image. + * + * @return the osType value. + */ + public OsType osType() { + return this.osType; + } + + /** + * Get the plan property: The ID of marketplace plan associated with the image (optional). + * + * @return the plan value. + */ + public String plan() { + return this.plan; + } + + /** + * Get the termsStatus property: The status of image terms of use (enabled = accepted, disabled = not accepted). + * + * @return the termsStatus value. + */ + public EnableState termsStatus() { + return this.termsStatus; + } + + /** + * Get the offer property: The ID of an offer associated with the image. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Get the publisher property: The ID of the publisher of the image. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the sku property: The image SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Get the version property: The image version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the sharedGalleryId property: The ID for the image in the shared gallery. + * + * @return the sharedGalleryId value. + */ + public String sharedGalleryId() { + return this.sharedGalleryId; + } + + /** + * Get the availableRegions property: The available regions of the image in the shared gallery. + * + * @return the availableRegions value. + */ + public List availableRegions() { + return this.availableRegions; + } + + /** + * Set the availableRegions property: The available regions of the image in the shared gallery. + * + * @param availableRegions the availableRegions value to set. + * @return the ImageProperties object itself. + */ + public ImageProperties withAvailableRegions(List availableRegions) { + this.availableRegions = availableRegions; + return this; + } + + /** + * Get the osState property: The OS State of the image. + * + * @return the osState value. + */ + public OsState osState() { + return this.osState; + } + + /** {@inheritDoc} */ + @Override + public ImageProperties withEnabledState(EnableState enabledState) { + super.withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageUpdateProperties.java new file mode 100644 index 0000000000000..2abbb7c65a1b0 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ImageUpdateProperties.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of an image resource update. */ +@Fluent +public class ImageUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageUpdateProperties.class); + + /* + * Is the image enabled + */ + @JsonProperty(value = "enabledState") + private EnableState enabledState; + + /** + * Get the enabledState property: Is the image enabled. + * + * @return the enabledState value. + */ + public EnableState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Is the image enabled. + * + * @param enabledState the enabledState value to set. + * @return the ImageUpdateProperties object itself. + */ + public ImageUpdateProperties withEnabledState(EnableState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabAccountInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabAccountInner.java deleted file mode 100644 index 9c34f94743a5d..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabAccountInner.java +++ /dev/null @@ -1,158 +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.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import com.azure.resourcemanager.labservices.models.SizeConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Represents a lab account. */ -@JsonFlatten -@Fluent -public class LabAccountInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabAccountInner.class); - - /* - * Represents the size configuration under the lab account - */ - @JsonProperty(value = "properties.sizeConfiguration", access = JsonProperty.Access.WRITE_ONLY) - private SizeConfigurationProperties sizeConfiguration; - - /* - * Represents if region selection is enabled - */ - @JsonProperty(value = "properties.enabledRegionSelection") - private Boolean enabledRegionSelection; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /* - * The details of the latest operation. ex: status, error - */ - @JsonProperty(value = "properties.latestOperationResult", access = JsonProperty.Access.WRITE_ONLY) - private LatestOperationResult latestOperationResult; - - /** - * Get the sizeConfiguration property: Represents the size configuration under the lab account. - * - * @return the sizeConfiguration value. - */ - public SizeConfigurationProperties sizeConfiguration() { - return this.sizeConfiguration; - } - - /** - * Get the enabledRegionSelection property: Represents if region selection is enabled. - * - * @return the enabledRegionSelection value. - */ - public Boolean enabledRegionSelection() { - return this.enabledRegionSelection; - } - - /** - * Set the enabledRegionSelection property: Represents if region selection is enabled. - * - * @param enabledRegionSelection the enabledRegionSelection value to set. - * @return the LabAccountInner object itself. - */ - public LabAccountInner withEnabledRegionSelection(Boolean enabledRegionSelection) { - this.enabledRegionSelection = enabledRegionSelection; - return this; - } - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the LabAccountInner object itself. - */ - public LabAccountInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the LabAccountInner object itself. - */ - public LabAccountInner withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** - * Get the latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - public LatestOperationResult latestOperationResult() { - return this.latestOperationResult; - } - - /** {@inheritDoc} */ - @Override - public LabAccountInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabAccountInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sizeConfiguration() != null) { - sizeConfiguration().validate(); - } - if (latestOperationResult() != null) { - latestOperationResult().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabInner.java index 2a95832952288..7a1883ad25632 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabInner.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabInner.java @@ -5,255 +5,302 @@ package com.azure.resourcemanager.labservices.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.labservices.models.LabUserAccessMode; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.LabNetworkProfile; +import com.azure.resourcemanager.labservices.models.LabState; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RosterProfile; +import com.azure.resourcemanager.labservices.models.SecurityProfile; +import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; import java.util.Map; -/** Represents a lab. */ -@JsonFlatten +/** The lab resource. */ @Fluent -public class LabInner extends Resource { +public final class LabInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LabInner.class); /* - * Maximum number of users allowed in the lab. + * Metadata pertaining to creation and last modification of the lab. */ - @JsonProperty(value = "properties.maxUsersInLab") - private Integer maxUsersInLab; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /* - * Maximum value MaxUsersInLab can be set to, as specified by the service + * Lab resource properties */ - @JsonProperty(value = "properties.userQuota", access = JsonProperty.Access.WRITE_ONLY) - private Integer userQuota; + @JsonProperty(value = "properties", required = true) + private LabProperties innerProperties = new LabProperties(); - /* - * Invitation code that users can use to join a lab. - */ - @JsonProperty(value = "properties.invitationCode", access = JsonProperty.Access.WRITE_ONLY) - private String invitationCode; - - /* - * Object id of the user that created the lab. - */ - @JsonProperty(value = "properties.createdByObjectId", access = JsonProperty.Access.WRITE_ONLY) - private String createdByObjectId; - - /* - * Maximum duration a user can use an environment for in the lab. - */ - @JsonProperty(value = "properties.usageQuota") - private Duration usageQuota; - - /* - * Lab user access mode (open to all vs. restricted to those listed on the - * lab). - */ - @JsonProperty(value = "properties.userAccessMode") - private LabUserAccessMode userAccessMode; - - /* - * Lab creator name + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the lab. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.createdByUserPrincipalName", access = JsonProperty.Access.WRITE_ONLY) - private String createdByUserPrincipalName; + public SystemData systemData() { + return this.systemData; + } - /* - * Creation date for the lab + /** + * Get the innerProperties property: Lab resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private LabProperties innerProperties() { + return this.innerProperties; + } - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - 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") - private String uniqueIdentifier; + /** {@inheritDoc} */ + @Override + public LabInner withTags(Map tags) { + super.withTags(tags); + return this; + } - /* - * The details of the latest operation. ex: status, error + /** + * Get the provisioningState property: Current provisioning state of the lab. + * + * @return the provisioningState value. */ - @JsonProperty(value = "properties.latestOperationResult", access = JsonProperty.Access.WRITE_ONLY) - private LatestOperationResult latestOperationResult; + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } /** - * Get the maxUsersInLab property: Maximum number of users allowed in the lab. + * Get the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile + * cannot be modified once a lab has been created. * - * @return the maxUsersInLab value. + * @return the networkProfile value. */ - public Integer maxUsersInLab() { - return this.maxUsersInLab; + public LabNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); } /** - * Set the maxUsersInLab property: Maximum number of users allowed in the lab. + * Set the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile + * cannot be modified once a lab has been created. * - * @param maxUsersInLab the maxUsersInLab value to set. + * @param networkProfile the networkProfile value to set. * @return the LabInner object itself. */ - public LabInner withMaxUsersInLab(Integer maxUsersInLab) { - this.maxUsersInLab = maxUsersInLab; + public LabInner withNetworkProfile(LabNetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); return this; } /** - * Get the userQuota property: Maximum value MaxUsersInLab can be set to, as specified by the service. + * Get the state property: The lab state. * - * @return the userQuota value. + * @return the state value. */ - public Integer userQuota() { - return this.userQuota; + public LabState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** - * Get the invitationCode property: Invitation code that users can use to join a lab. + * Get the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. * - * @return the invitationCode value. + * @return the autoShutdownProfile value. */ - public String invitationCode() { - return this.invitationCode; + public AutoShutdownProfile autoShutdownProfile() { + return this.innerProperties() == null ? null : this.innerProperties().autoShutdownProfile(); } /** - * Get the createdByObjectId property: Object id of the user that created the lab. + * Set the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. * - * @return the createdByObjectId value. + * @param autoShutdownProfile the autoShutdownProfile value to set. + * @return the LabInner object itself. */ - public String createdByObjectId() { - return this.createdByObjectId; + public LabInner withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withAutoShutdownProfile(autoShutdownProfile); + return this; } /** - * Get the usageQuota property: Maximum duration a user can use an environment for in the lab. + * Get the connectionProfile property: The connection profile for the lab. This controls settings such as web access + * to lab resources or whether RDP or SSH ports are open. * - * @return the usageQuota value. + * @return the connectionProfile value. */ - public Duration usageQuota() { - return this.usageQuota; + public ConnectionProfile connectionProfile() { + return this.innerProperties() == null ? null : this.innerProperties().connectionProfile(); } /** - * Set the usageQuota property: Maximum duration a user can use an environment for in the lab. + * Set the connectionProfile property: The connection profile for the lab. This controls settings such as web access + * to lab resources or whether RDP or SSH ports are open. * - * @param usageQuota the usageQuota value to set. + * @param connectionProfile the connectionProfile value to set. * @return the LabInner object itself. */ - public LabInner withUsageQuota(Duration usageQuota) { - this.usageQuota = usageQuota; + public LabInner withConnectionProfile(ConnectionProfile connectionProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withConnectionProfile(connectionProfile); return this; } /** - * Get the userAccessMode property: Lab user access mode (open to all vs. restricted to those listed on the lab). + * Get the virtualMachineProfile property: The profile used for creating lab virtual machines. * - * @return the userAccessMode value. + * @return the virtualMachineProfile value. */ - public LabUserAccessMode userAccessMode() { - return this.userAccessMode; + public VirtualMachineProfile virtualMachineProfile() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineProfile(); } /** - * Set the userAccessMode property: Lab user access mode (open to all vs. restricted to those listed on the lab). + * Set the virtualMachineProfile property: The profile used for creating lab virtual machines. * - * @param userAccessMode the userAccessMode value to set. + * @param virtualMachineProfile the virtualMachineProfile value to set. * @return the LabInner object itself. */ - public LabInner withUserAccessMode(LabUserAccessMode userAccessMode) { - this.userAccessMode = userAccessMode; + public LabInner withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withVirtualMachineProfile(virtualMachineProfile); return this; } /** - * Get the createdByUserPrincipalName property: Lab creator name. + * Get the securityProfile property: The lab security profile. * - * @return the createdByUserPrincipalName value. + * @return the securityProfile value. */ - public String createdByUserPrincipalName() { - return this.createdByUserPrincipalName; + public SecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); } /** - * Get the createdDate property: Creation date for the lab. + * Set the securityProfile property: The lab security profile. * - * @return the createdDate value. + * @param securityProfile the securityProfile value to set. + * @return the LabInner object itself. */ - public OffsetDateTime createdDate() { - return this.createdDate; + public LabInner withSecurityProfile(SecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; } /** - * Get the provisioningState property: The provisioning status of the resource. + * Get the rosterProfile property: The lab user list management profile. * - * @return the provisioningState value. + * @return the rosterProfile value. */ - public String provisioningState() { - return this.provisioningState; + public RosterProfile rosterProfile() { + return this.innerProperties() == null ? null : this.innerProperties().rosterProfile(); } /** - * Set the provisioningState property: The provisioning status of the resource. + * Set the rosterProfile property: The lab user list management profile. * - * @param provisioningState the provisioningState value to set. + * @param rosterProfile the rosterProfile value to set. * @return the LabInner object itself. */ - public LabInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; + public LabInner withRosterProfile(RosterProfile rosterProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withRosterProfile(rosterProfile); return this; } /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Get the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as + * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. * - * @return the uniqueIdentifier value. + * @return the labPlanId value. */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; + public String labPlanId() { + return this.innerProperties() == null ? null : this.innerProperties().labPlanId(); } /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Set the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as + * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. * - * @param uniqueIdentifier the uniqueIdentifier value to set. + * @param labPlanId the labPlanId value to set. * @return the LabInner object itself. */ - public LabInner withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; + public LabInner withLabPlanId(String labPlanId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withLabPlanId(labPlanId); return this; } /** - * Get the latestOperationResult property: The details of the latest operation. ex: status, error. + * Get the title property: The title of the lab. * - * @return the latestOperationResult value. + * @return the title value. */ - public LatestOperationResult latestOperationResult() { - return this.latestOperationResult; + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); } - /** {@inheritDoc} */ - @Override - public LabInner withLocation(String location) { - super.withLocation(location); + /** + * Set the title property: The title of the lab. + * + * @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 description property: The description of the lab. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the lab. + * + * @param description the description value to set. + * @return the LabInner object itself. + */ + public LabInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new LabProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -263,8 +310,12 @@ public LabInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (latestOperationResult() != null) { - latestOperationResult().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model LabInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanInner.java new file mode 100644 index 0000000000000..d2173a69a536d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanInner.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.labservices.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.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.SupportInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Lab Plans act as a permission container for creating labs via labs.azure.com. Additionally, they can provide a set of + * default configurations that will apply at the time of creating a lab, but these defaults can still be overwritten. + */ +@Fluent +public final class LabPlanInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanInner.class); + + /* + * Metadata pertaining to creation and last modification of the lab plan. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Lab plan resource properties + */ + @JsonProperty(value = "properties", required = true) + private LabPlanProperties innerProperties = new LabPlanProperties(); + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the lab plan. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Lab plan resource properties. + * + * @return the innerProperties value. + */ + private LabPlanProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public LabPlanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabPlanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Current provisioning state of the lab plan. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultConnectionProfile value. + */ + public ConnectionProfile defaultConnectionProfile() { + return this.innerProperties() == null ? null : this.innerProperties().defaultConnectionProfile(); + } + + /** + * Set the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @param defaultConnectionProfile the defaultConnectionProfile value to set. + * @return the LabPlanInner object itself. + */ + public LabPlanInner withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanProperties(); + } + this.innerProperties().withDefaultConnectionProfile(defaultConnectionProfile); + return this; + } + + /** + * Get the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultAutoShutdownProfile value. + */ + public AutoShutdownProfile defaultAutoShutdownProfile() { + return this.innerProperties() == null ? null : this.innerProperties().defaultAutoShutdownProfile(); + } + + /** + * Set the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @param defaultAutoShutdownProfile the defaultAutoShutdownProfile value to set. + * @return the LabPlanInner object itself. + */ + public LabPlanInner withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanProperties(); + } + this.innerProperties().withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); + return this; + } + + /** + * Get the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs associated with this lab plan. + * + * @return the defaultNetworkProfile value. + */ + public LabPlanNetworkProfile defaultNetworkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().defaultNetworkProfile(); + } + + /** + * Set the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs associated with this lab plan. + * + * @param defaultNetworkProfile the defaultNetworkProfile value to set. + * @return the LabPlanInner object itself. + */ + public LabPlanInner withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanProperties(); + } + this.innerProperties().withDefaultNetworkProfile(defaultNetworkProfile); + return this; + } + + /** + * Get the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * + * @return the allowedRegions value. + */ + public List allowedRegions() { + return this.innerProperties() == null ? null : this.innerProperties().allowedRegions(); + } + + /** + * Set the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * + * @param allowedRegions the allowedRegions value to set. + * @return the LabPlanInner object itself. + */ + public LabPlanInner withAllowedRegions(List allowedRegions) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanProperties(); + } + this.innerProperties().withAllowedRegions(allowedRegions); + return this; + } + + /** + * Get the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving + * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be + * made available to use when creating new labs. + * + * @return the sharedGalleryId value. + */ + public String sharedGalleryId() { + return this.innerProperties() == null ? null : this.innerProperties().sharedGalleryId(); + } + + /** + * Set the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving + * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be + * made available to use when creating new labs. + * + * @param sharedGalleryId the sharedGalleryId value to set. + * @return the LabPlanInner object itself. + */ + public LabPlanInner withSharedGalleryId(String sharedGalleryId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanProperties(); + } + this.innerProperties().withSharedGalleryId(sharedGalleryId); + return this; + } + + /** + * Get the supportInfo property: Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * + * @return the supportInfo value. + */ + public SupportInfo supportInfo() { + return this.innerProperties() == null ? null : this.innerProperties().supportInfo(); + } + + /** + * Set the supportInfo property: Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * + * @param supportInfo the supportInfo value to set. + * @return the LabPlanInner object itself. + */ + public LabPlanInner withSupportInfo(SupportInfo supportInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanProperties(); + } + this.innerProperties().withSupportInfo(supportInfo); + return this; + } + + /** + * Get the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. + * + * @return the linkedLmsInstance value. + */ + public String linkedLmsInstance() { + return this.innerProperties() == null ? null : this.innerProperties().linkedLmsInstance(); + } + + /** + * Set the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. + * + * @param linkedLmsInstance the linkedLmsInstance value to set. + * @return the LabPlanInner object itself. + */ + public LabPlanInner withLinkedLmsInstance(String linkedLmsInstance) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanProperties(); + } + this.innerProperties().withLinkedLmsInstance(linkedLmsInstance); + 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 LabPlanInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanProperties.java new file mode 100644 index 0000000000000..838570cc54651 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.SupportInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Lab plan resource properties. */ +@Fluent +public final class LabPlanProperties extends LabPlanUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanProperties.class); + + /* + * Current provisioning state of the lab plan. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: Current provisioning state of the lab plan. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public LabPlanProperties withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { + super.withDefaultConnectionProfile(defaultConnectionProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabPlanProperties withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { + super.withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabPlanProperties withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { + super.withDefaultNetworkProfile(defaultNetworkProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabPlanProperties withAllowedRegions(List allowedRegions) { + super.withAllowedRegions(allowedRegions); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabPlanProperties withSharedGalleryId(String sharedGalleryId) { + super.withSharedGalleryId(sharedGalleryId); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabPlanProperties withSupportInfo(SupportInfo supportInfo) { + super.withSupportInfo(supportInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabPlanProperties withLinkedLmsInstance(String linkedLmsInstance) { + super.withLinkedLmsInstance(linkedLmsInstance); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanUpdateProperties.java new file mode 100644 index 0000000000000..1518ebb7c997c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabPlanUpdateProperties.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; +import com.azure.resourcemanager.labservices.models.SupportInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Lab plan resource properties for updates. */ +@Fluent +public class LabPlanUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanUpdateProperties.class); + + /* + * The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + */ + @JsonProperty(value = "defaultConnectionProfile") + private ConnectionProfile defaultConnectionProfile; + + /* + * The default lab shutdown profile. This can be changed on a lab resource + * and only provides a default profile. + */ + @JsonProperty(value = "defaultAutoShutdownProfile") + private AutoShutdownProfile defaultAutoShutdownProfile; + + /* + * The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs + * associated with this lab plan. + */ + @JsonProperty(value = "defaultNetworkProfile") + private LabPlanNetworkProfile defaultNetworkProfile; + + /* + * The allowed regions for the lab creator to use when creating labs using + * this lab plan. + */ + @JsonProperty(value = "allowedRegions") + private List allowedRegions; + + /* + * Resource ID of the Shared Image Gallery attached to this lab plan. When + * saving a lab template virtual machine image it will be persisted in this + * gallery. Shared images from the gallery can be made available to use + * when creating new labs. + */ + @JsonProperty(value = "sharedGalleryId") + private String sharedGalleryId; + + /* + * Support contact information and instructions for users of the lab plan. + * This information is displayed to lab owners and virtual machine users + * for all labs in the lab plan. + */ + @JsonProperty(value = "supportInfo") + private SupportInfo supportInfo; + + /* + * Base Url of the lms instance this lab plan can link lab rosters against. + */ + @JsonProperty(value = "linkedLmsInstance") + private String linkedLmsInstance; + + /** + * Get the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultConnectionProfile value. + */ + public ConnectionProfile defaultConnectionProfile() { + return this.defaultConnectionProfile; + } + + /** + * Set the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @param defaultConnectionProfile the defaultConnectionProfile value to set. + * @return the LabPlanUpdateProperties object itself. + */ + public LabPlanUpdateProperties withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { + this.defaultConnectionProfile = defaultConnectionProfile; + return this; + } + + /** + * Get the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultAutoShutdownProfile value. + */ + public AutoShutdownProfile defaultAutoShutdownProfile() { + return this.defaultAutoShutdownProfile; + } + + /** + * Set the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @param defaultAutoShutdownProfile the defaultAutoShutdownProfile value to set. + * @return the LabPlanUpdateProperties object itself. + */ + public LabPlanUpdateProperties withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { + this.defaultAutoShutdownProfile = defaultAutoShutdownProfile; + return this; + } + + /** + * Get the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs associated with this lab plan. + * + * @return the defaultNetworkProfile value. + */ + public LabPlanNetworkProfile defaultNetworkProfile() { + return this.defaultNetworkProfile; + } + + /** + * Set the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs associated with this lab plan. + * + * @param defaultNetworkProfile the defaultNetworkProfile value to set. + * @return the LabPlanUpdateProperties object itself. + */ + public LabPlanUpdateProperties withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { + this.defaultNetworkProfile = defaultNetworkProfile; + return this; + } + + /** + * Get the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * + * @return the allowedRegions value. + */ + public List allowedRegions() { + return this.allowedRegions; + } + + /** + * Set the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * + * @param allowedRegions the allowedRegions value to set. + * @return the LabPlanUpdateProperties object itself. + */ + public LabPlanUpdateProperties withAllowedRegions(List allowedRegions) { + this.allowedRegions = allowedRegions; + return this; + } + + /** + * Get the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving + * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be + * made available to use when creating new labs. + * + * @return the sharedGalleryId value. + */ + public String sharedGalleryId() { + return this.sharedGalleryId; + } + + /** + * Set the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving + * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be + * made available to use when creating new labs. + * + * @param sharedGalleryId the sharedGalleryId value to set. + * @return the LabPlanUpdateProperties object itself. + */ + public LabPlanUpdateProperties withSharedGalleryId(String sharedGalleryId) { + this.sharedGalleryId = sharedGalleryId; + return this; + } + + /** + * Get the supportInfo property: Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * + * @return the supportInfo value. + */ + public SupportInfo supportInfo() { + return this.supportInfo; + } + + /** + * Set the supportInfo property: Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * + * @param supportInfo the supportInfo value to set. + * @return the LabPlanUpdateProperties object itself. + */ + public LabPlanUpdateProperties withSupportInfo(SupportInfo supportInfo) { + this.supportInfo = supportInfo; + return this; + } + + /** + * Get the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. + * + * @return the linkedLmsInstance value. + */ + public String linkedLmsInstance() { + return this.linkedLmsInstance; + } + + /** + * Set the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. + * + * @param linkedLmsInstance the linkedLmsInstance value to set. + * @return the LabPlanUpdateProperties object itself. + */ + public LabPlanUpdateProperties withLinkedLmsInstance(String linkedLmsInstance) { + this.linkedLmsInstance = linkedLmsInstance; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (defaultConnectionProfile() != null) { + defaultConnectionProfile().validate(); + } + if (defaultAutoShutdownProfile() != null) { + defaultAutoShutdownProfile().validate(); + } + if (defaultNetworkProfile() != null) { + defaultNetworkProfile().validate(); + } + if (supportInfo() != null) { + supportInfo().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabProperties.java new file mode 100644 index 0000000000000..c081d888fb975 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabProperties.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.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.LabNetworkProfile; +import com.azure.resourcemanager.labservices.models.LabState; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RosterProfile; +import com.azure.resourcemanager.labservices.models.SecurityProfile; +import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a lab resource. */ +@Fluent +public final class LabProperties extends LabUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabProperties.class); + + /* + * Current provisioning state of the lab. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The network profile for the lab, typically applied via a lab plan. This + * profile cannot be modified once a lab has been created. + */ + @JsonProperty(value = "networkProfile") + private LabNetworkProfile networkProfile; + + /* + * The lab state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private LabState state; + + /** + * Get the provisioningState property: Current provisioning state of the lab. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile + * cannot be modified once a lab has been created. + * + * @return the networkProfile value. + */ + public LabNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile + * cannot be modified once a lab has been created. + * + * @param networkProfile the networkProfile value to set. + * @return the LabProperties object itself. + */ + public LabProperties withNetworkProfile(LabNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the state property: The lab state. + * + * @return the state value. + */ + public LabState state() { + return this.state; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { + super.withAutoShutdownProfile(autoShutdownProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withConnectionProfile(ConnectionProfile connectionProfile) { + super.withConnectionProfile(connectionProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { + super.withVirtualMachineProfile(virtualMachineProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withSecurityProfile(SecurityProfile securityProfile) { + super.withSecurityProfile(securityProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withRosterProfile(RosterProfile rosterProfile) { + super.withRosterProfile(rosterProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withLabPlanId(String labPlanId) { + super.withLabPlanId(labPlanId); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withTitle(String title) { + super.withTitle(title); + return this; + } + + /** {@inheritDoc} */ + @Override + public LabProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkProfile() != null) { + networkProfile().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabServicesSkuInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabServicesSkuInner.java new file mode 100644 index 0000000000000..a3c61eb421f3c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabServicesSkuInner.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.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.LabServicesSkuCapabilities; +import com.azure.resourcemanager.labservices.models.LabServicesSkuCapacity; +import com.azure.resourcemanager.labservices.models.LabServicesSkuCost; +import com.azure.resourcemanager.labservices.models.LabServicesSkuRestrictions; +import com.azure.resourcemanager.labservices.models.LabServicesSkuTier; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure Lab Services resource SKUs. */ +@Fluent +public final class LabServicesSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuInner.class); + + /* + * The lab services resource type. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The name of the SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The tier of the SKU. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private LabServicesSkuTier tier; + + /* + * The SKU size. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /* + * The family of the SKU. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /* + * The scale out/in options of the SKU. + */ + @JsonProperty(value = "capacity") + private LabServicesSkuCapacity capacity; + + /* + * The capabilities of the SKU. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /* + * List of locations that are available for a size. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * Metadata for retrieving price info of a lab services SKUs. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /* + * Restrictions of a lab services SKUs. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The lab services resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: The tier of the SKU. + * + * @return the tier value. + */ + public LabServicesSkuTier tier() { + return this.tier; + } + + /** + * Get the size property: The SKU size. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the family property: The family of the SKU. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the capacity property: The scale out/in options of the SKU. + * + * @return the capacity value. + */ + public LabServicesSkuCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The scale out/in options of the SKU. + * + * @param capacity the capacity value to set. + * @return the LabServicesSkuInner object itself. + */ + public LabServicesSkuInner withCapacity(LabServicesSkuCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the capabilities property: The capabilities of the SKU. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the locations property: List of locations that are available for a size. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the costs property: Metadata for retrieving price info of a lab services SKUs. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the restrictions property: Restrictions of a lab services SKUs. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabUpdateProperties.java new file mode 100644 index 0000000000000..57e9626b758a7 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/LabUpdateProperties.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.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.RosterProfile; +import com.azure.resourcemanager.labservices.models.SecurityProfile; +import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a lab resource used for updates. */ +@Fluent +public class LabUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabUpdateProperties.class); + + /* + * The resource auto shutdown configuration for the lab. This controls + * whether actions are taken on resources that are sitting idle. + */ + @JsonProperty(value = "autoShutdownProfile") + private AutoShutdownProfile autoShutdownProfile; + + /* + * The connection profile for the lab. This controls settings such as web + * access to lab resources or whether RDP or SSH ports are open. + */ + @JsonProperty(value = "connectionProfile") + private ConnectionProfile connectionProfile; + + /* + * The profile used for creating lab virtual machines. + */ + @JsonProperty(value = "virtualMachineProfile") + private VirtualMachineProfile virtualMachineProfile; + + /* + * The lab security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * The lab user list management profile. + */ + @JsonProperty(value = "rosterProfile") + private RosterProfile rosterProfile; + + /* + * The ID of the lab plan. Used during resource creation to provide + * defaults and acts as a permission container when creating a lab via + * labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. + */ + @JsonProperty(value = "labPlanId") + private String labPlanId; + + /* + * The title of the lab. + */ + @JsonProperty(value = "title") + private String title; + + /* + * The description of the lab. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. + * + * @return the autoShutdownProfile value. + */ + public AutoShutdownProfile autoShutdownProfile() { + return this.autoShutdownProfile; + } + + /** + * Set the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. + * + * @param autoShutdownProfile the autoShutdownProfile value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { + this.autoShutdownProfile = autoShutdownProfile; + return this; + } + + /** + * Get the connectionProfile property: The connection profile for the lab. This controls settings such as web access + * to lab resources or whether RDP or SSH ports are open. + * + * @return the connectionProfile value. + */ + public ConnectionProfile connectionProfile() { + return this.connectionProfile; + } + + /** + * Set the connectionProfile property: The connection profile for the lab. This controls settings such as web access + * to lab resources or whether RDP or SSH ports are open. + * + * @param connectionProfile the connectionProfile value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withConnectionProfile(ConnectionProfile connectionProfile) { + this.connectionProfile = connectionProfile; + return this; + } + + /** + * Get the virtualMachineProfile property: The profile used for creating lab virtual machines. + * + * @return the virtualMachineProfile value. + */ + public VirtualMachineProfile virtualMachineProfile() { + return this.virtualMachineProfile; + } + + /** + * Set the virtualMachineProfile property: The profile used for creating lab virtual machines. + * + * @param virtualMachineProfile the virtualMachineProfile value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { + this.virtualMachineProfile = virtualMachineProfile; + return this; + } + + /** + * Get the securityProfile property: The lab security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: The lab security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the rosterProfile property: The lab user list management profile. + * + * @return the rosterProfile value. + */ + public RosterProfile rosterProfile() { + return this.rosterProfile; + } + + /** + * Set the rosterProfile property: The lab user list management profile. + * + * @param rosterProfile the rosterProfile value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withRosterProfile(RosterProfile rosterProfile) { + this.rosterProfile = rosterProfile; + return this; + } + + /** + * Get the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as + * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. + * + * @return the labPlanId value. + */ + public String labPlanId() { + return this.labPlanId; + } + + /** + * Set the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as + * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. + * + * @param labPlanId the labPlanId value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withLabPlanId(String labPlanId) { + this.labPlanId = labPlanId; + return this; + } + + /** + * Get the title property: The title of the lab. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The title of the lab. + * + * @param title the title value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: The description of the lab. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the lab. + * + * @param description the description value to set. + * @return the LabUpdateProperties object itself. + */ + public LabUpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoShutdownProfile() != null) { + autoShutdownProfile().validate(); + } + if (connectionProfile() != null) { + connectionProfile().validate(); + } + if (virtualMachineProfile() != null) { + virtualMachineProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (rosterProfile() != null) { + rosterProfile().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListEnvironmentsResponseInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListEnvironmentsResponseInner.java deleted file mode 100644 index d3961b1e8f436..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListEnvironmentsResponseInner.java +++ /dev/null @@ -1,55 +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.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.EnvironmentDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents the list of environments owned by a user. */ -@Fluent -public final class ListEnvironmentsResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListEnvironmentsResponseInner.class); - - /* - * List of all the environments - */ - @JsonProperty(value = "environments") - private List environments; - - /** - * Get the environments property: List of all the environments. - * - * @return the environments value. - */ - public List environments() { - return this.environments; - } - - /** - * Set the environments property: List of all the environments. - * - * @param environments the environments value to set. - * @return the ListEnvironmentsResponseInner object itself. - */ - public ListEnvironmentsResponseInner withEnvironments(List environments) { - this.environments = environments; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (environments() != null) { - environments().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListLabsResponseInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListLabsResponseInner.java deleted file mode 100644 index ed1bc3a07f998..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ListLabsResponseInner.java +++ /dev/null @@ -1,55 +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.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.LabDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Lists the labs owned by a user. */ -@Fluent -public final class ListLabsResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListLabsResponseInner.class); - - /* - * List of all the labs - */ - @JsonProperty(value = "labs") - private List labs; - - /** - * Get the labs property: List of all the labs. - * - * @return the labs value. - */ - public List labs() { - return this.labs; - } - - /** - * Set the labs property: List of all the labs. - * - * @param labs the labs value to set. - * @return the ListLabsResponseInner object itself. - */ - public ListLabsResponseInner withLabs(List labs) { - this.labs = labs; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (labs() != null) { - labs().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationBatchStatusResponseInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationBatchStatusResponseInner.java deleted file mode 100644 index 32ca741cf67d8..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationBatchStatusResponseInner.java +++ /dev/null @@ -1,44 +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.labservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.OperationBatchStatusResponseItem; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Status Details of the long running operation for an environment. */ -@Immutable -public final class OperationBatchStatusResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationBatchStatusResponseInner.class); - - /* - * Gets a collection of items that contain the operation url and status. - */ - @JsonProperty(value = "items", access = JsonProperty.Access.WRITE_ONLY) - private List items; - - /** - * Get the items property: Gets a collection of items that contain the operation url and status. - * - * @return the items value. - */ - public List items() { - return this.items; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (items() != null) { - items().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..6ed316ad24578 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.ActionType; +import com.azure.resourcemanager.labservices.models.OperationDisplay; +import com.azure.resourcemanager.labservices.models.Origin; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). + * Examples: "Microsoft.Compute/virtualMachines/write", + * "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for + * data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access + * Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationMetadataInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationMetadataInner.java deleted file mode 100644 index 2e15ebffd10ca..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationMetadataInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.OperationMetadataDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The REST API operation supported by ManagedLab ResourceProvider. */ -@Fluent -public final class OperationMetadataInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetadataInner.class); - - /* - * Operation name: {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * The object that describes the operations - */ - @JsonProperty(value = "display") - private OperationMetadataDisplay display; - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationMetadataInner object itself. - */ - public OperationMetadataInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: The object that describes the operations. - * - * @return the display value. - */ - public OperationMetadataDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that describes the operations. - * - * @param display the display value to set. - * @return the OperationMetadataInner object itself. - */ - public OperationMetadataInner withDisplay(OperationMetadataDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationResultInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationResultInner.java index 7041c69f0052a..f87735fbf4655 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationResultInner.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationResultInner.java @@ -5,34 +5,86 @@ package com.azure.resourcemanager.labservices.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.models.OperationError; +import com.azure.resourcemanager.labservices.models.OperationStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; -/** An Operation Result. */ +/** A long running operation result. */ @Fluent public final class OperationResultInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInner.class); /* - * The operation status. + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ - @JsonProperty(value = "status") - private String status; + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; /* - * Error details for the operation in case of a failure. + * The name of the resource + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The operation status + */ + @JsonProperty(value = "status", required = true) + private OperationStatus status; + + /* + * Start time + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * End time + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Percent completion + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /* + * The error for a failure if the operation failed. */ @JsonProperty(value = "error") - private OperationError error; + private ManagementError error; + + /** + * Get the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } /** * Get the status property: The operation status. * * @return the status value. */ - public String status() { + public OperationStatus status() { return this.status; } @@ -42,27 +94,87 @@ public String status() { * @param status the status value to set. * @return the OperationResultInner object itself. */ - public OperationResultInner withStatus(String status) { + public OperationResultInner withStatus(OperationStatus status) { this.status = status; return this; } /** - * Get the error property: Error details for the operation in case of a failure. + * Get the startTime property: Start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time. + * + * @param startTime the startTime value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: End time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time. + * + * @param endTime the endTime value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the percentComplete property: Percent completion. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent completion. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the error property: The error for a failure if the operation failed. * * @return the error value. */ - public OperationError error() { + public ManagementError error() { return this.error; } /** - * Set the error property: Error details for the operation in case of a failure. + * Set the error property: The error for a failure if the operation failed. * * @param error the error value to set. * @return the OperationResultInner object itself. */ - public OperationResultInner withError(OperationError error) { + public OperationResultInner withError(ManagementError error) { this.error = error; return this; } @@ -73,8 +185,10 @@ public OperationResultInner withError(OperationError error) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (error() != null) { - error().validate(); + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model OperationResultInner")); } } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationStatusResponseInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationStatusResponseInner.java deleted file mode 100644 index 92c298cb2704b..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/OperationStatusResponseInner.java +++ /dev/null @@ -1,39 +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.labservices.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; - -/** Status Details of the long running operation for an environment. */ -@Immutable -public final class OperationStatusResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusResponseInner.class); - - /* - * status of the long running operation for an environment - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** - * Get the status property: status of the long running operation for an environment. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleInner.java new file mode 100644 index 0000000000000..343df0cfd3058 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleInner.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.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Schedule for automatically turning virtual machines in a lab on and off at specified times. */ +@Fluent +public final class ScheduleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleInner.class); + + /* + * Metadata pertaining to creation and last modification of the schedule. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Schedule resource properties + */ + @JsonProperty(value = "properties", required = true) + private ScheduleProperties innerProperties = new ScheduleProperties(); + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the schedule. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Schedule resource properties. + * + * @return the innerProperties value. + */ + private ScheduleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Current provisioning state of the schedule. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the startAt value. + */ + public OffsetDateTime startAt() { + return this.innerProperties() == null ? null : this.innerProperties().startAt(); + } + + /** + * Set the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @param startAt the startAt value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withStartAt(OffsetDateTime startAt) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withStartAt(startAt); + return this; + } + + /** + * Get the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the stopAt value. + */ + public OffsetDateTime stopAt() { + return this.innerProperties() == null ? null : this.innerProperties().stopAt(); + } + + /** + * Set the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @param stopAt the stopAt value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withStopAt(OffsetDateTime stopAt) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withStopAt(stopAt); + return this; + } + + /** + * Get the recurrencePattern property: The recurrence pattern of the scheduled actions. + * + * @return the recurrencePattern value. + */ + public RecurrencePattern recurrencePattern() { + return this.innerProperties() == null ? null : this.innerProperties().recurrencePattern(); + } + + /** + * Set the recurrencePattern property: The recurrence pattern of the scheduled actions. + * + * @param recurrencePattern the recurrencePattern value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withRecurrencePattern(RecurrencePattern recurrencePattern) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withRecurrencePattern(recurrencePattern); + return this; + } + + /** + * Get the timeZoneId property: The IANA timezone id for the schedule. + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); + } + + /** + * Set the timeZoneId property: The IANA timezone id for the schedule. + * + * @param timeZoneId the timeZoneId value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withTimeZoneId(String timeZoneId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the notes property: Notes for this schedule. + * + * @return the notes value. + */ + public String notes() { + return this.innerProperties() == null ? null : this.innerProperties().notes(); + } + + /** + * Set the notes property: Notes for this schedule. + * + * @param notes the notes value to set. + * @return the ScheduleInner object itself. + */ + public ScheduleInner withNotes(String notes) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleProperties(); + } + this.innerProperties().withNotes(notes); + 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 ScheduleInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleProperties.java new file mode 100644 index 0000000000000..2768dd30887ec --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Schedule resource properties. */ +@Fluent +public final class ScheduleProperties extends ScheduleUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleProperties.class); + + /* + * Current provisioning state of the schedule. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: Current provisioning state of the schedule. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ScheduleProperties withStartAt(OffsetDateTime startAt) { + super.withStartAt(startAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduleProperties withStopAt(OffsetDateTime stopAt) { + super.withStopAt(stopAt); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduleProperties withRecurrencePattern(RecurrencePattern recurrencePattern) { + super.withRecurrencePattern(recurrencePattern); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduleProperties withTimeZoneId(String timeZoneId) { + super.withTimeZoneId(timeZoneId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ScheduleProperties withNotes(String notes) { + super.withNotes(notes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleUpdateProperties.java new file mode 100644 index 0000000000000..a992a75361c82 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/ScheduleUpdateProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Schedule resource properties used for updates. */ +@Fluent +public class ScheduleUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleUpdateProperties.class); + + /* + * When lab user virtual machines will be started. Timestamp offsets will + * be ignored and timeZoneId is used instead. + */ + @JsonProperty(value = "startAt") + private OffsetDateTime startAt; + + /* + * When lab user virtual machines will be stopped. Timestamp offsets will + * be ignored and timeZoneId is used instead. + */ + @JsonProperty(value = "stopAt") + private OffsetDateTime stopAt; + + /* + * The recurrence pattern of the scheduled actions. + */ + @JsonProperty(value = "recurrencePattern") + private RecurrencePattern recurrencePattern; + + /* + * The IANA timezone id for the schedule. + */ + @JsonProperty(value = "timeZoneId") + private String timeZoneId; + + /* + * Notes for this schedule. + */ + @JsonProperty(value = "notes") + private String notes; + + /** + * Get the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the startAt value. + */ + public OffsetDateTime startAt() { + return this.startAt; + } + + /** + * Set the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @param startAt the startAt value to set. + * @return the ScheduleUpdateProperties object itself. + */ + public ScheduleUpdateProperties withStartAt(OffsetDateTime startAt) { + this.startAt = startAt; + return this; + } + + /** + * Get the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the stopAt value. + */ + public OffsetDateTime stopAt() { + return this.stopAt; + } + + /** + * Set the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @param stopAt the stopAt value to set. + * @return the ScheduleUpdateProperties object itself. + */ + public ScheduleUpdateProperties withStopAt(OffsetDateTime stopAt) { + this.stopAt = stopAt; + return this; + } + + /** + * Get the recurrencePattern property: The recurrence pattern of the scheduled actions. + * + * @return the recurrencePattern value. + */ + public RecurrencePattern recurrencePattern() { + return this.recurrencePattern; + } + + /** + * Set the recurrencePattern property: The recurrence pattern of the scheduled actions. + * + * @param recurrencePattern the recurrencePattern value to set. + * @return the ScheduleUpdateProperties object itself. + */ + public ScheduleUpdateProperties withRecurrencePattern(RecurrencePattern recurrencePattern) { + this.recurrencePattern = recurrencePattern; + return this; + } + + /** + * Get the timeZoneId property: The IANA timezone id for the schedule. + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.timeZoneId; + } + + /** + * Set the timeZoneId property: The IANA timezone id for the schedule. + * + * @param timeZoneId the timeZoneId value to set. + * @return the ScheduleUpdateProperties object itself. + */ + public ScheduleUpdateProperties withTimeZoneId(String timeZoneId) { + this.timeZoneId = timeZoneId; + return this; + } + + /** + * Get the notes property: Notes for this schedule. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: Notes for this schedule. + * + * @param notes the notes value to set. + * @return the ScheduleUpdateProperties object itself. + */ + public ScheduleUpdateProperties withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recurrencePattern() != null) { + recurrencePattern().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UsageInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..e7894554ae571 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UsageInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.UsageName; +import com.azure.resourcemanager.labservices.models.UsageUnit; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The core usage details. */ +@Fluent +public final class UsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); + + /* + * The current usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /* + * The limit integer. + */ + @JsonProperty(value = "limit") + private Long limit; + + /* + * The unit details. + */ + @JsonProperty(value = "unit") + private UsageUnit unit; + + /* + * The name. + */ + @JsonProperty(value = "name") + private UsageName name; + + /* + * The fully qualified arm resource id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the currentValue property: The current usage. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current usage. + * + * @param currentValue the currentValue value to set. + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The limit integer. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: The limit integer. + * + * @param limit the limit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the unit property: The unit details. + * + * @return the unit value. + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit details. + * + * @param unit the unit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UsageUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name property: The name. + * + * @param name the name value to set. + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + + /** + * Get the id property: The fully qualified arm resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The fully qualified arm resource id. + * + * @param id the id value to set. + * @return the UsageInner object itself. + */ + public UsageInner withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java index 6465c52bcfbbf..9322e780b7329 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java @@ -5,174 +5,152 @@ package com.azure.resourcemanager.labservices.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.labservices.models.LatestOperationResult; +import com.azure.resourcemanager.labservices.models.InvitationState; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RegistrationState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.Duration; -import java.util.Map; +import java.time.OffsetDateTime; -/** The User registered to a lab. */ -@JsonFlatten +/** User of a lab that can register for and use virtual machines within the lab. */ @Fluent -public class UserInner extends Resource { +public final class UserInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class); /* - * The user email address, as it was specified during registration. + * Metadata pertaining to creation and last modification of the user + * resource. */ - @JsonProperty(value = "properties.email", access = JsonProperty.Access.WRITE_ONLY) - private String email; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /* - * The user family name, as it was specified during registration. + * User resource properties */ - @JsonProperty(value = "properties.familyName", access = JsonProperty.Access.WRITE_ONLY) - private String familyName; - - /* - * The user given name, as it was specified during registration. - */ - @JsonProperty(value = "properties.givenName", access = JsonProperty.Access.WRITE_ONLY) - private String givenName; - - /* - * The user tenant ID, as it was specified during registration. - */ - @JsonProperty(value = "properties.tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * How long the user has used his VMs in this lab - */ - @JsonProperty(value = "properties.totalUsage", access = JsonProperty.Access.WRITE_ONLY) - private Duration totalUsage; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /* - * The details of the latest operation. ex: status, error - */ - @JsonProperty(value = "properties.latestOperationResult", access = JsonProperty.Access.WRITE_ONLY) - private LatestOperationResult latestOperationResult; + @JsonProperty(value = "properties", required = true) + private UserProperties innerProperties = new UserProperties(); /** - * Get the email property: The user email address, as it was specified during registration. + * Get the systemData property: Metadata pertaining to creation and last modification of the user resource. * - * @return the email value. + * @return the systemData value. */ - public String email() { - return this.email; + public SystemData systemData() { + return this.systemData; } /** - * Get the familyName property: The user family name, as it was specified during registration. + * Get the innerProperties property: User resource properties. * - * @return the familyName value. + * @return the innerProperties value. */ - public String familyName() { - return this.familyName; + private UserProperties innerProperties() { + return this.innerProperties; } /** - * Get the givenName property: The user given name, as it was specified during registration. + * Get the provisioningState property: Current provisioning state of the user resource. * - * @return the givenName value. + * @return the provisioningState value. */ - public String givenName() { - return this.givenName; + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** - * Get the tenantId property: The user tenant ID, as it was specified during registration. + * Get the displayName property: Display name of the user, for example user's full name. * - * @return the tenantId value. + * @return the displayName value. */ - public String tenantId() { - return this.tenantId; + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** - * Get the totalUsage property: How long the user has used his VMs in this lab. + * Get the email property: Email address of the user. * - * @return the totalUsage value. + * @return the email value. */ - public Duration totalUsage() { - return this.totalUsage; + public String email() { + return this.innerProperties() == null ? null : this.innerProperties().email(); } /** - * Get the provisioningState property: The provisioning status of the resource. + * Set the email property: Email address of the user. * - * @return the provisioningState value. + * @param email the email value to set. + * @return the UserInner object itself. */ - public String provisioningState() { - return this.provisioningState; + public UserInner withEmail(String email) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withEmail(email); + return this; } /** - * Set the provisioningState property: The provisioning status of the resource. + * Get the registrationState property: State of the user's registration within the lab. * - * @param provisioningState the provisioningState value to set. - * @return the UserInner object itself. + * @return the registrationState value. */ - public UserInner withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; + public RegistrationState registrationState() { + return this.innerProperties() == null ? null : this.innerProperties().registrationState(); } /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Get the invitationState property: State of the invitation message for the user. * - * @return the uniqueIdentifier value. + * @return the invitationState value. */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; + public InvitationState invitationState() { + return this.innerProperties() == null ? null : this.innerProperties().invitationState(); } /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Get the invitationSent property: Date and time when the invitation message was sent to the user. * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the UserInner object itself. + * @return the invitationSent value. */ - public UserInner withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; + public OffsetDateTime invitationSent() { + return this.innerProperties() == null ? null : this.innerProperties().invitationSent(); } /** - * Get the latestOperationResult property: The details of the latest operation. ex: status, error. + * Get the totalUsage property: How long the user has used their virtual machines in this lab. * - * @return the latestOperationResult value. + * @return the totalUsage value. */ - public LatestOperationResult latestOperationResult() { - return this.latestOperationResult; + public Duration totalUsage() { + return this.innerProperties() == null ? null : this.innerProperties().totalUsage(); } - /** {@inheritDoc} */ - @Override - public UserInner withLocation(String location) { - super.withLocation(location); - return this; + /** + * Get the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage + * quota. + * + * @return the additionalUsageQuota value. + */ + public Duration additionalUsageQuota() { + return this.innerProperties() == null ? null : this.innerProperties().additionalUsageQuota(); } - /** {@inheritDoc} */ - @Override - public UserInner withTags(Map tags) { - super.withTags(tags); + /** + * Set the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage + * quota. + * + * @param additionalUsageQuota the additionalUsageQuota value to set. + * @return the UserInner object itself. + */ + public UserInner withAdditionalUsageQuota(Duration additionalUsageQuota) { + if (this.innerProperties() == null) { + this.innerProperties = new UserProperties(); + } + this.innerProperties().withAdditionalUsageQuota(additionalUsageQuota); return this; } @@ -182,8 +160,12 @@ public UserInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (latestOperationResult() != null) { - latestOperationResult().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model UserInner")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserProperties.java new file mode 100644 index 0000000000000..47c2601fe706a --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.InvitationState; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RegistrationState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** User resource properties. */ +@Fluent +public final class UserProperties extends UserUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserProperties.class); + + /* + * Current provisioning state of the user resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Display name of the user, for example user's full name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Email address of the user. + */ + @JsonProperty(value = "email", required = true) + private String email; + + /* + * State of the user's registration within the lab. + */ + @JsonProperty(value = "registrationState", access = JsonProperty.Access.WRITE_ONLY) + private RegistrationState registrationState; + + /* + * State of the invitation message for the user. + */ + @JsonProperty(value = "invitationState", access = JsonProperty.Access.WRITE_ONLY) + private InvitationState invitationState; + + /* + * Date and time when the invitation message was sent to the user. + */ + @JsonProperty(value = "invitationSent", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime invitationSent; + + /* + * How long the user has used their virtual machines in this lab. + */ + @JsonProperty(value = "totalUsage", access = JsonProperty.Access.WRITE_ONLY) + private Duration totalUsage; + + /** + * Get the provisioningState property: Current provisioning state of the user resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the displayName property: Display name of the user, for example user's full name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the email property: Email address of the user. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email address of the user. + * + * @param email the email value to set. + * @return the UserProperties object itself. + */ + public UserProperties withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the registrationState property: State of the user's registration within the lab. + * + * @return the registrationState value. + */ + public RegistrationState registrationState() { + return this.registrationState; + } + + /** + * Get the invitationState property: State of the invitation message for the user. + * + * @return the invitationState value. + */ + public InvitationState invitationState() { + return this.invitationState; + } + + /** + * Get the invitationSent property: Date and time when the invitation message was sent to the user. + * + * @return the invitationSent value. + */ + public OffsetDateTime invitationSent() { + return this.invitationSent; + } + + /** + * Get the totalUsage property: How long the user has used their virtual machines in this lab. + * + * @return the totalUsage value. + */ + public Duration totalUsage() { + return this.totalUsage; + } + + /** {@inheritDoc} */ + @Override + public UserProperties withAdditionalUsageQuota(Duration additionalUsageQuota) { + super.withAdditionalUsageQuota(additionalUsageQuota); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (email() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property email in model UserProperties")); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserUpdateProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserUpdateProperties.java new file mode 100644 index 0000000000000..e28da807e534d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserUpdateProperties.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.labservices.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.Duration; + +/** User resource properties used for updates. */ +@Fluent +public class UserUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserUpdateProperties.class); + + /* + * The amount of usage quota time the user gets in addition to the lab + * usage quota. + */ + @JsonProperty(value = "additionalUsageQuota") + private Duration additionalUsageQuota; + + /** + * Get the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage + * quota. + * + * @return the additionalUsageQuota value. + */ + public Duration additionalUsageQuota() { + return this.additionalUsageQuota; + } + + /** + * Set the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage + * quota. + * + * @param additionalUsageQuota the additionalUsageQuota value to set. + * @return the UserUpdateProperties object itself. + */ + public UserUpdateProperties withAdditionalUsageQuota(Duration additionalUsageQuota) { + this.additionalUsageQuota = additionalUsageQuota; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineInner.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineInner.java new file mode 100644 index 0000000000000..0ed584eb0d88b --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineInner.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.VirtualMachineConnectionProfile; +import com.azure.resourcemanager.labservices.models.VirtualMachineState; +import com.azure.resourcemanager.labservices.models.VirtualMachineType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A lab virtual machine resource. */ +@Fluent +public final class VirtualMachineInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineInner.class); + + /* + * System data of the Lab virtual machine. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Virtual machine resource properties + */ + @JsonProperty(value = "properties", required = true) + private VirtualMachineProperties innerProperties = new VirtualMachineProperties(); + + /** + * Get the systemData property: System data of the Lab virtual machine. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Virtual machine resource properties. + * + * @return the innerProperties value. + */ + private VirtualMachineProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Current provisioning state of the virtual machine. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the state property: The current state of the virtual machine. + * + * @return the state value. + */ + public VirtualMachineState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the connectionProfile property: Profile for information about connecting to the virtual machine. + * + * @return the connectionProfile value. + */ + public VirtualMachineConnectionProfile connectionProfile() { + return this.innerProperties() == null ? null : this.innerProperties().connectionProfile(); + } + + /** + * Get the claimedByUserId property: The lab user ID (not the PUID!) of who claimed the virtual machine. + * + * @return the claimedByUserId value. + */ + public String claimedByUserId() { + return this.innerProperties() == null ? null : this.innerProperties().claimedByUserId(); + } + + /** + * Get the vmType property: The type of this VM resource. + * + * @return the vmType value. + */ + public VirtualMachineType vmType() { + return this.innerProperties() == null ? null : this.innerProperties().vmType(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VirtualMachineInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineProperties.java new file mode 100644 index 0000000000000..c932bf475361a --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/VirtualMachineProperties.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.labservices.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.VirtualMachineConnectionProfile; +import com.azure.resourcemanager.labservices.models.VirtualMachineState; +import com.azure.resourcemanager.labservices.models.VirtualMachineType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual machine resource properties. */ +@Immutable +public final class VirtualMachineProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineProperties.class); + + /* + * Current provisioning state of the virtual machine. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The current state of the virtual machine + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineState state; + + /* + * Profile for information about connecting to the virtual machine. + */ + @JsonProperty(value = "connectionProfile", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineConnectionProfile connectionProfile; + + /* + * The lab user ID (not the PUID!) of who claimed the virtual machine. + */ + @JsonProperty(value = "claimedByUserId", access = JsonProperty.Access.WRITE_ONLY) + private String claimedByUserId; + + /* + * The type of this VM resource + */ + @JsonProperty(value = "vmType", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineType vmType; + + /** + * Get the provisioningState property: Current provisioning state of the virtual machine. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the state property: The current state of the virtual machine. + * + * @return the state value. + */ + public VirtualMachineState state() { + return this.state; + } + + /** + * Get the connectionProfile property: Profile for information about connecting to the virtual machine. + * + * @return the connectionProfile value. + */ + public VirtualMachineConnectionProfile connectionProfile() { + return this.connectionProfile; + } + + /** + * Get the claimedByUserId property: The lab user ID (not the PUID!) of who claimed the virtual machine. + * + * @return the claimedByUserId value. + */ + public String claimedByUserId() { + return this.claimedByUserId; + } + + /** + * Get the vmType property: The type of this VM resource. + * + * @return the vmType value. + */ + public VirtualMachineType vmType() { + return this.vmType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionProfile() != null) { + connectionProfile().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/package-info.java index cdcb8a87f1694..34a923c01f969 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/package-info.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/package-info.java @@ -2,5 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for ManagedLabsClient. The Managed Labs Client. */ +/** Package containing the inner data models for LabServicesClient. REST API for managing Azure Lab Services images. */ package com.azure.resourcemanager.labservices.fluent.models; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/package-info.java index 631cad509ed20..33339f2e16f1e 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/package-info.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/package-info.java @@ -2,5 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for ManagedLabsClient. The Managed Labs Client. */ +/** Package containing the service clients for LabServicesClient. REST API for managing Azure Lab Services images. */ package com.azure.resourcemanager.labservices.fluent; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentImpl.java deleted file mode 100644 index 7fea7452b2a6f..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentImpl.java +++ /dev/null @@ -1,379 +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.labservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentInner; -import com.azure.resourcemanager.labservices.models.Environment; -import com.azure.resourcemanager.labservices.models.EnvironmentFragment; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import com.azure.resourcemanager.labservices.models.NetworkInterface; -import com.azure.resourcemanager.labservices.models.ResetPasswordPayload; -import com.azure.resourcemanager.labservices.models.ResourceSet; -import com.azure.resourcemanager.labservices.models.ResourceSetFragment; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class EnvironmentImpl implements Environment, Environment.Definition, Environment.Update { - private EnvironmentInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager 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 ResourceSet resourceSets() { - return this.innerModel().resourceSets(); - } - - public String claimedByUserObjectId() { - return this.innerModel().claimedByUserObjectId(); - } - - public String claimedByUserPrincipalId() { - return this.innerModel().claimedByUserPrincipalId(); - } - - public String claimedByUsername() { - return this.innerModel().claimedByUsername(); - } - - public Boolean isClaimed() { - return this.innerModel().isClaimed(); - } - - public String lastKnownPowerState() { - return this.innerModel().lastKnownPowerState(); - } - - public NetworkInterface networkInterface() { - return this.innerModel().networkInterface(); - } - - public Duration totalUsage() { - return this.innerModel().totalUsage(); - } - - public OffsetDateTime passwordLastReset() { - return this.innerModel().passwordLastReset(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public String uniqueIdentifier() { - return this.innerModel().uniqueIdentifier(); - } - - public LatestOperationResult latestOperationResult() { - return this.innerModel().latestOperationResult(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public EnvironmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labAccountName; - - private String labName; - - private String environmentSettingName; - - private String environmentName; - - private EnvironmentFragment updateEnvironment; - - public EnvironmentImpl withExistingEnvironmentsetting( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - this.resourceGroupName = resourceGroupName; - this.labAccountName = labAccountName; - this.labName = labName; - this.environmentSettingName = environmentSettingName; - return this; - } - - public Environment create() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironments() - .createOrUpdateWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public Environment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironments() - .createOrUpdateWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.innerModel(), - context) - .getValue(); - return this; - } - - EnvironmentImpl(String name, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = new EnvironmentInner(); - this.serviceManager = serviceManager; - this.environmentName = name; - } - - public EnvironmentImpl update() { - this.updateEnvironment = new EnvironmentFragment(); - return this; - } - - public Environment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironments() - .updateWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - updateEnvironment, - Context.NONE) - .getValue(); - return this; - } - - public Environment apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironments() - .updateWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - updateEnvironment, - context) - .getValue(); - return this; - } - - EnvironmentImpl( - EnvironmentInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labAccountName = Utils.getValueFromIdByName(innerObject.id(), "labaccounts"); - this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); - this.environmentSettingName = Utils.getValueFromIdByName(innerObject.id(), "environmentsettings"); - this.environmentName = Utils.getValueFromIdByName(innerObject.id(), "environments"); - } - - public Environment refresh() { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getEnvironments() - .getWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - localExpand, - Context.NONE) - .getValue(); - return this; - } - - public Environment refresh(Context context) { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getEnvironments() - .getWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - localExpand, - context) - .getValue(); - return this; - } - - public void claim() { - serviceManager - .environments() - .claim(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - } - - public Response claimWithResponse(Context context) { - return serviceManager - .environments() - .claimWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - public void resetPassword(ResetPasswordPayload resetPasswordPayload) { - serviceManager - .environments() - .resetPassword( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload); - } - - public void resetPassword(ResetPasswordPayload resetPasswordPayload, Context context) { - serviceManager - .environments() - .resetPassword( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload, - context); - } - - public void start() { - serviceManager - .environments() - .start(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - } - - public void start(Context context) { - serviceManager - .environments() - .start(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - public void stop() { - serviceManager - .environments() - .stop(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - } - - public void stop(Context context) { - serviceManager - .environments() - .stop(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - public EnvironmentImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public EnvironmentImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public EnvironmentImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateEnvironment.withTags(tags); - return this; - } - } - - public EnvironmentImpl withResourceSets(ResourceSet resourceSets) { - this.innerModel().withResourceSets(resourceSets); - return this; - } - - public EnvironmentImpl withProvisioningState(String provisioningState) { - if (isInCreateMode()) { - this.innerModel().withProvisioningState(provisioningState); - return this; - } else { - this.updateEnvironment.withProvisioningState(provisioningState); - return this; - } - } - - public EnvironmentImpl withUniqueIdentifier(String uniqueIdentifier) { - if (isInCreateMode()) { - this.innerModel().withUniqueIdentifier(uniqueIdentifier); - return this; - } else { - this.updateEnvironment.withUniqueIdentifier(uniqueIdentifier); - return this; - } - } - - public EnvironmentImpl withResourceSets(ResourceSetFragment resourceSets) { - this.updateEnvironment.withResourceSets(resourceSets); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingImpl.java deleted file mode 100644 index 80c766e21ee5d..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingImpl.java +++ /dev/null @@ -1,357 +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.labservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentSettingInner; -import com.azure.resourcemanager.labservices.models.ConfigurationState; -import com.azure.resourcemanager.labservices.models.EnvironmentSetting; -import com.azure.resourcemanager.labservices.models.EnvironmentSettingFragment; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import com.azure.resourcemanager.labservices.models.PublishPayload; -import com.azure.resourcemanager.labservices.models.PublishingState; -import com.azure.resourcemanager.labservices.models.ResourceSettings; -import com.azure.resourcemanager.labservices.models.ResourceSettingsFragment; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class EnvironmentSettingImpl - implements EnvironmentSetting, EnvironmentSetting.Definition, EnvironmentSetting.Update { - private EnvironmentSettingInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager 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 PublishingState publishingState() { - return this.innerModel().publishingState(); - } - - public ConfigurationState configurationState() { - return this.innerModel().configurationState(); - } - - public String description() { - return this.innerModel().description(); - } - - public String title() { - return this.innerModel().title(); - } - - public ResourceSettings resourceSettings() { - return this.innerModel().resourceSettings(); - } - - public OffsetDateTime lastChanged() { - return this.innerModel().lastChanged(); - } - - public OffsetDateTime lastPublished() { - return this.innerModel().lastPublished(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public String uniqueIdentifier() { - return this.innerModel().uniqueIdentifier(); - } - - public LatestOperationResult latestOperationResult() { - return this.innerModel().latestOperationResult(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public EnvironmentSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labAccountName; - - private String labName; - - private String environmentSettingName; - - private EnvironmentSettingFragment updateEnvironmentSetting; - - public EnvironmentSettingImpl withExistingLab(String resourceGroupName, String labAccountName, String labName) { - this.resourceGroupName = resourceGroupName; - this.labAccountName = labAccountName; - this.labName = labName; - return this; - } - - public EnvironmentSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentSettings() - .createOrUpdate( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.innerModel(), - Context.NONE); - return this; - } - - public EnvironmentSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentSettings() - .createOrUpdate( - resourceGroupName, labAccountName, labName, environmentSettingName, this.innerModel(), context); - return this; - } - - EnvironmentSettingImpl(String name, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = new EnvironmentSettingInner(); - this.serviceManager = serviceManager; - this.environmentSettingName = name; - } - - public EnvironmentSettingImpl update() { - this.updateEnvironmentSetting = new EnvironmentSettingFragment(); - return this; - } - - public EnvironmentSetting apply() { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentSettings() - .updateWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - updateEnvironmentSetting, - Context.NONE) - .getValue(); - return this; - } - - public EnvironmentSetting apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentSettings() - .updateWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - updateEnvironmentSetting, - context) - .getValue(); - return this; - } - - EnvironmentSettingImpl( - EnvironmentSettingInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labAccountName = Utils.getValueFromIdByName(innerObject.id(), "labaccounts"); - this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); - this.environmentSettingName = Utils.getValueFromIdByName(innerObject.id(), "environmentsettings"); - } - - public EnvironmentSetting refresh() { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentSettings() - .getWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, localExpand, Context.NONE) - .getValue(); - return this; - } - - public EnvironmentSetting refresh(Context context) { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getEnvironmentSettings() - .getWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, localExpand, context) - .getValue(); - return this; - } - - public void claimAny() { - serviceManager - .environmentSettings() - .claimAny(resourceGroupName, labAccountName, labName, environmentSettingName); - } - - public Response claimAnyWithResponse(Context context) { - return serviceManager - .environmentSettings() - .claimAnyWithResponse(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - public void publish(PublishPayload publishPayload) { - serviceManager - .environmentSettings() - .publish(resourceGroupName, labAccountName, labName, environmentSettingName, publishPayload); - } - - public Response publishWithResponse(PublishPayload publishPayload, Context context) { - return serviceManager - .environmentSettings() - .publishWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, publishPayload, context); - } - - public void start() { - serviceManager.environmentSettings().start(resourceGroupName, labAccountName, labName, environmentSettingName); - } - - public void start(Context context) { - serviceManager - .environmentSettings() - .start(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - public void stop() { - serviceManager.environmentSettings().stop(resourceGroupName, labAccountName, labName, environmentSettingName); - } - - public void stop(Context context) { - serviceManager - .environmentSettings() - .stop(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - public EnvironmentSettingImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public EnvironmentSettingImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public EnvironmentSettingImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateEnvironmentSetting.withTags(tags); - return this; - } - } - - public EnvironmentSettingImpl withConfigurationState(ConfigurationState configurationState) { - if (isInCreateMode()) { - this.innerModel().withConfigurationState(configurationState); - return this; - } else { - this.updateEnvironmentSetting.withConfigurationState(configurationState); - return this; - } - } - - public EnvironmentSettingImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateEnvironmentSetting.withDescription(description); - return this; - } - } - - public EnvironmentSettingImpl withTitle(String title) { - if (isInCreateMode()) { - this.innerModel().withTitle(title); - return this; - } else { - this.updateEnvironmentSetting.withTitle(title); - return this; - } - } - - public EnvironmentSettingImpl withResourceSettings(ResourceSettings resourceSettings) { - this.innerModel().withResourceSettings(resourceSettings); - return this; - } - - public EnvironmentSettingImpl withProvisioningState(String provisioningState) { - if (isInCreateMode()) { - this.innerModel().withProvisioningState(provisioningState); - return this; - } else { - this.updateEnvironmentSetting.withProvisioningState(provisioningState); - return this; - } - } - - public EnvironmentSettingImpl withUniqueIdentifier(String uniqueIdentifier) { - if (isInCreateMode()) { - this.innerModel().withUniqueIdentifier(uniqueIdentifier); - return this; - } else { - this.updateEnvironmentSetting.withUniqueIdentifier(uniqueIdentifier); - return this; - } - } - - public EnvironmentSettingImpl withResourceSettings(ResourceSettingsFragment resourceSettings) { - this.updateEnvironmentSetting.withResourceSettings(resourceSettings); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsClientImpl.java deleted file mode 100644 index f509b4f67fb05..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsClientImpl.java +++ /dev/null @@ -1,2731 +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.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.EnvironmentSettingsClient; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentSettingInner; -import com.azure.resourcemanager.labservices.models.EnvironmentSettingFragment; -import com.azure.resourcemanager.labservices.models.PublishPayload; -import com.azure.resourcemanager.labservices.models.ResponseWithContinuationEnvironmentSetting; -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 EnvironmentSettingsClient. */ -public final class EnvironmentSettingsClientImpl implements EnvironmentSettingsClient { - private final ClientLogger logger = new ClientLogger(EnvironmentSettingsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final EnvironmentSettingsService service; - - /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; - - /** - * Initializes an instance of EnvironmentSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EnvironmentSettingsClientImpl(ManagedLabsClientImpl client) { - this.service = - RestProxy.create(EnvironmentSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ManagedLabsClientEnvironmentSettings to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientEnv") - private interface EnvironmentSettingsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @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.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @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.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentSettingInner environmentSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentSettingFragment environmentSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/claimAny") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> claimAny( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/publish") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> publish( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PublishPayload publishPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @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 environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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, - labAccountName, - 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 environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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, - labAccountName, - 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 environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @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 the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String labAccountName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @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 the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String labAccountName, String labName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby)); - } - - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby, context)); - } - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName, 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - expand, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName 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, - labAccountName, - labName, - environmentSettingName, - expand, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) { - return getWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentSettingInner get( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - final String expand = null; - return getAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand).block(); - } - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - Context context) { - return getWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand, context) - .block(); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentSetting is required and cannot be null.")); - } else { - environmentSetting.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - environmentSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentSetting is required and cannot be null.")); - } else { - environmentSetting.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - environmentSetting, - accept, - context); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, EnvironmentSettingInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - EnvironmentSettingInner.class, - EnvironmentSettingInner.class, - Context.NONE); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, EnvironmentSettingInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - EnvironmentSettingInner.class, - EnvironmentSettingInner.class, - context); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, EnvironmentSettingInner> beginCreateOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting) { - return beginCreateOrUpdateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting) - .getSyncPoller(); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, EnvironmentSettingInner> beginCreateOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, context) - .getSyncPoller(); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting) { - return beginCreateOrUpdateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentSettingInner createOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting) { - return createOrUpdateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting) - .block(); - } - - /** - * Create or replace an existing Environment Setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentSettingInner createOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingInner environmentSetting, - Context context) { - return createOrUpdateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, context) - .block(); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName 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, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName).getSyncPoller(); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context) - .getSyncPoller(); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 labAccountName, String labName, String environmentSettingName) { - deleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName).block(); - } - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 labAccountName, - String labName, - String environmentSettingName, - Context context) { - deleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context).block(); - } - - /** - * Modify properties of environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingFragment environmentSetting) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentSetting is required and cannot be null.")); - } else { - environmentSetting.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - environmentSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Modify properties of environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingFragment environmentSetting, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentSetting is required and cannot be null.")); - } else { - environmentSetting.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - environmentSetting, - accept, - context); - } - - /** - * Modify properties of environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingFragment environmentSetting) { - return updateWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Modify properties of environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentSettingInner update( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingFragment environmentSetting) { - return updateAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting) - .block(); - } - - /** - * Modify properties of environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentSetting Represents settings of an environment, from which environment instances would be - * created. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents settings of an environment, from which environment instances would be created. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - EnvironmentSettingFragment environmentSetting, - Context context) { - return updateWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, context) - .block(); - } - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> claimAnyWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .claimAny( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> claimAnyWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .claimAny( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono claimAnyAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - return claimAnyWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 claimAny( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - claimAnyAsync(resourceGroupName, labAccountName, labName, environmentSettingName).block(); - } - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 claimAnyWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return claimAnyWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context) - .block(); - } - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> publishWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (publishPayload == null) { - return Mono.error(new IllegalArgumentException("Parameter publishPayload is required and cannot be null.")); - } else { - publishPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .publish( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - publishPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> publishWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (publishPayload == null) { - return Mono.error(new IllegalArgumentException("Parameter publishPayload is required and cannot be null.")); - } else { - publishPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .publish( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - publishPayload, - accept, - context); - } - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono publishAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload) { - return publishWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, publishPayload) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 publish( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload) { - publishAsync(resourceGroupName, labAccountName, labName, environmentSettingName, publishPayload).block(); - } - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 publishWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload, - Context context) { - return publishWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, publishPayload, context) - .block(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - Mono>> mono = - startWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - return beginStartAsync(resourceGroupName, labAccountName, labName, environmentSettingName).getSyncPoller(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return beginStartAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context) - .getSyncPoller(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - return beginStartAsync(resourceGroupName, labAccountName, labName, environmentSettingName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return beginStartAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - startAsync(resourceGroupName, labAccountName, labName, environmentSettingName).block(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - startAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context).block(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - Mono>> mono = - stopWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - return beginStopAsync(resourceGroupName, labAccountName, labName, environmentSettingName).getSyncPoller(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return beginStopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context) - .getSyncPoller(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - return beginStopAsync(resourceGroupName, labAccountName, labName, environmentSettingName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return beginStopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - stopAsync(resourceGroupName, labAccountName, labName, environmentSettingName).block(); - } - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - stopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, 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 the response of a list operation. - */ - @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 the response of a list operation. - */ - @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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsImpl.java deleted file mode 100644 index 0fa07b15468f6..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentSettingsImpl.java +++ /dev/null @@ -1,323 +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.labservices.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.labservices.fluent.EnvironmentSettingsClient; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentSettingInner; -import com.azure.resourcemanager.labservices.models.EnvironmentSetting; -import com.azure.resourcemanager.labservices.models.EnvironmentSettings; -import com.azure.resourcemanager.labservices.models.PublishPayload; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class EnvironmentSettingsImpl implements EnvironmentSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentSettingsImpl.class); - - private final EnvironmentSettingsClient innerClient; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - public EnvironmentSettingsImpl( - EnvironmentSettingsClient innerClient, - com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String labAccountName, String labName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, labAccountName, labName); - return Utils.mapPage(inner, inner1 -> new EnvironmentSettingImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, labAccountName, labName, expand, filter, top, orderby, context); - return Utils.mapPage(inner, inner1 -> new EnvironmentSettingImpl(inner1, this.manager())); - } - - public EnvironmentSetting get( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - EnvironmentSettingInner inner = - this.serviceClient().get(resourceGroupName, labAccountName, labName, environmentSettingName); - if (inner != null) { - return new EnvironmentSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, labAccountName, labName, environmentSettingName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EnvironmentSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - this.serviceClient().delete(resourceGroupName, labAccountName, labName, environmentSettingName); - } - - public void delete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - this.serviceClient().delete(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - public void claimAny( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - this.serviceClient().claimAny(resourceGroupName, labAccountName, labName, environmentSettingName); - } - - public Response claimAnyWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - return this - .serviceClient() - .claimAnyWithResponse(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - public void publish( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload) { - this - .serviceClient() - .publish(resourceGroupName, labAccountName, labName, environmentSettingName, publishPayload); - } - - public Response publishWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload, - Context context) { - return this - .serviceClient() - .publishWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, publishPayload, context); - } - - public void start(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - this.serviceClient().start(resourceGroupName, labAccountName, labName, environmentSettingName); - } - - public void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - this.serviceClient().start(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - public void stop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - this.serviceClient().stop(resourceGroupName, labAccountName, labName, environmentSettingName); - } - - public void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context) { - this.serviceClient().stop(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - public EnvironmentSetting 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - String localExpand = null; - return this - .getWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - return this - .getWithResponse(resourceGroupName, labAccountName, labName, environmentSettingName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - this.delete(resourceGroupName, labAccountName, labName, environmentSettingName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - this.delete(resourceGroupName, labAccountName, labName, environmentSettingName, context); - } - - private EnvironmentSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - public EnvironmentSettingImpl define(String name) { - return new EnvironmentSettingImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsClientImpl.java deleted file mode 100644 index 359326a93349f..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsClientImpl.java +++ /dev/null @@ -1,3144 +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.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.EnvironmentsClient; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentInner; -import com.azure.resourcemanager.labservices.models.EnvironmentFragment; -import com.azure.resourcemanager.labservices.models.ResetPasswordPayload; -import com.azure.resourcemanager.labservices.models.ResponseWithContinuationEnvironment; -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 EnvironmentsClient. */ -public final class EnvironmentsClientImpl implements EnvironmentsClient { - private final ClientLogger logger = new ClientLogger(EnvironmentsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final EnvironmentsService service; - - /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; - - /** - * Initializes an instance of EnvironmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EnvironmentsClientImpl(ManagedLabsClientImpl client) { - this.service = - RestProxy.create(EnvironmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ManagedLabsClientEnvironments to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientEnv") - private interface EnvironmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @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.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @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.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentInner environment, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentFragment environment, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}/claim") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> claim( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}/resetPassword") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetPassword( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ResetPasswordPayload resetPasswordPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}" - + "/environments/{environmentName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("labName") String labName, - @PathParam("environmentSettingName") String environmentSettingName, - @PathParam("environmentName") String environmentName, - @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 environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - 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 environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName 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, - labAccountName, - labName, - environmentSettingName, - 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 environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - String filter, - Integer top, - String orderby) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - expand, - filter, - top, - orderby, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - final String expand = null; - final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>( - listAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby)); - } - - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>( - listAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - expand, - filter, - top, - orderby, - context)); - } - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> getWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - expand, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> getWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName 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, - labAccountName, - labName, - environmentSettingName, - environmentName, - expand, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 labAccountName, - String labName, - String environmentSettingName, - String environmentName, - String expand) { - return getWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, 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 labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - final String expand = null; - return getWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, 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 labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentInner get( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - final String expand = null; - return getAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, expand) - .block(); - } - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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) - public Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - String expand, - Context context) { - return getWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, expand, context) - .block(); - } - - /** - * Create or replace an existing Environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentInner environment) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } else { - environment.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - environment, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or replace an existing Environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentInner environment, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } else { - environment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - environment, - accept, - context); - } - - /** - * Create or replace an existing Environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentInner environment) { - return createOrUpdateWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or replace an existing Environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentInner createOrUpdate( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentInner environment) { - return createOrUpdateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment) - .block(); - } - - /** - * Create or replace an existing Environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentInner environment, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - environment, - context) - .block(); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName 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, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) - .getSyncPoller(); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return beginDeleteAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .getSyncPoller(); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return beginDeleteAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - deleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).block(); - } - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - deleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .block(); - } - - /** - * Modify properties of environments. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentFragment environment) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } else { - environment.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - environment, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Modify properties of environments. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentFragment environment, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environment == null) { - return Mono.error(new IllegalArgumentException("Parameter environment is required and cannot be null.")); - } else { - environment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - environment, - accept, - context); - } - - /** - * Modify properties of environments. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentFragment environment) { - return updateWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Modify properties of environments. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnvironmentInner update( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentFragment environment) { - return updateAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment) - .block(); - } - - /** - * Modify properties of environments. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param environment Represents an environment instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an environment instance. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - EnvironmentFragment environment, - Context context) { - return updateWithResponseAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - environment, - context) - .block(); - } - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> claimWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .claim( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> claimWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .claim( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono claimAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - return claimWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void claim( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - claimAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).block(); - } - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 claimWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return claimWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .block(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetPasswordWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (resetPasswordPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null.")); - } else { - resetPasswordPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .resetPassword( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - resetPasswordPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetPasswordWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (resetPasswordPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null.")); - } else { - resetPasswordPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .resetPassword( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - resetPasswordPayload, - accept, - context); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginResetPasswordAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload) { - Mono>> mono = - resetPasswordWithResponseAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginResetPasswordAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - resetPasswordWithResponseAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload, - context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload) { - return beginResetPasswordAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload) - .getSyncPoller(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context) { - return beginResetPasswordAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload, - context) - .getSyncPoller(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetPasswordAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload) { - return beginResetPasswordAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetPasswordAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context) { - return beginResetPasswordAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload) { - resetPasswordAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload) - .block(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context) { - resetPasswordAsync( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload, - context) - .block(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - Mono>> mono = - startWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - return beginStartAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) - .getSyncPoller(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return beginStartAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .getSyncPoller(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - return beginStartAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return beginStartAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - startAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).block(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - startAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .block(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labName == null) { - return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); - } - if (environmentSettingName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.")); - } - if (environmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - Mono>> mono = - stopWithResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - return beginStopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) - .getSyncPoller(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return beginStopAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .getSyncPoller(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - return beginStopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return beginStopAsync( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - stopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).block(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - stopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, 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 the response of a list operation. - */ - @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 the response of a list operation. - */ - @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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsImpl.java deleted file mode 100644 index ae601fcc2588a..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/EnvironmentsImpl.java +++ /dev/null @@ -1,428 +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.labservices.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.labservices.fluent.EnvironmentsClient; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentInner; -import com.azure.resourcemanager.labservices.models.Environment; -import com.azure.resourcemanager.labservices.models.Environments; -import com.azure.resourcemanager.labservices.models.ResetPasswordPayload; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class EnvironmentsImpl implements Environments { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentsImpl.class); - - private final EnvironmentsClient innerClient; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - public EnvironmentsImpl( - EnvironmentsClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, labAccountName, labName, environmentSettingName); - return Utils.mapPage(inner, inner1 -> new EnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - expand, - filter, - top, - orderby, - context); - return Utils.mapPage(inner, inner1 -> new EnvironmentImpl(inner1, this.manager())); - } - - public Environment get( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - EnvironmentInner inner = - this - .serviceClient() - .get(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - if (inner != null) { - return new EnvironmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - String expand, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - expand, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new EnvironmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - this - .serviceClient() - .delete(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - } - - public void delete( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - this - .serviceClient() - .delete(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - public void claim( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - this.serviceClient().claim(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - } - - public Response claimWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - return this - .serviceClient() - .claimWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - public void resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload) { - this - .serviceClient() - .resetPassword( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload); - } - - public void resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context) { - this - .serviceClient() - .resetPassword( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - resetPasswordPayload, - context); - } - - public void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - this.serviceClient().start(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - } - - public void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - this - .serviceClient() - .start(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - public void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName) { - this.serviceClient().stop(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName); - } - - public void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context) { - this - .serviceClient() - .stop(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - public Environment 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - String environmentName = Utils.getValueFromIdByName(id, "environments"); - if (environmentName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - String localExpand = null; - return this - .getWithResponse( - resourceGroupName, - labAccountName, - labName, - environmentSettingName, - environmentName, - 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - String environmentName = Utils.getValueFromIdByName(id, "environments"); - if (environmentName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - return this - .getWithResponse( - resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - String environmentName = Utils.getValueFromIdByName(id, "environments"); - if (environmentName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - this.delete(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", 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 environmentSettingName = Utils.getValueFromIdByName(id, "environmentsettings"); - if (environmentSettingName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'environmentsettings'.", id))); - } - String environmentName = Utils.getValueFromIdByName(id, "environments"); - if (environmentName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'environments'.", id))); - } - this.delete(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, context); - } - - private EnvironmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - public EnvironmentImpl define(String name) { - return new EnvironmentImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImageImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImageImpl.java deleted file mode 100644 index 20957e93277f3..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImageImpl.java +++ /dev/null @@ -1,284 +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.labservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.labservices.models.GalleryImage; -import com.azure.resourcemanager.labservices.models.GalleryImageFragment; -import com.azure.resourcemanager.labservices.models.GalleryImageReference; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class GalleryImageImpl implements GalleryImage, GalleryImage.Definition, GalleryImage.Update { - private GalleryImageInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager 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 String author() { - return this.innerModel().author(); - } - - public OffsetDateTime createdDate() { - return this.innerModel().createdDate(); - } - - public String description() { - return this.innerModel().description(); - } - - public GalleryImageReference imageReference() { - return this.innerModel().imageReference(); - } - - public String icon() { - return this.innerModel().icon(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public Boolean isOverride() { - return this.innerModel().isOverride(); - } - - public String planId() { - return this.innerModel().planId(); - } - - public Boolean isPlanAuthorized() { - return this.innerModel().isPlanAuthorized(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public String uniqueIdentifier() { - return this.innerModel().uniqueIdentifier(); - } - - public LatestOperationResult latestOperationResult() { - return this.innerModel().latestOperationResult(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public GalleryImageInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labAccountName; - - private String galleryImageName; - - private GalleryImageFragment updateGalleryImage; - - public GalleryImageImpl withExistingLabaccount(String resourceGroupName, String labAccountName) { - this.resourceGroupName = resourceGroupName; - this.labAccountName = labAccountName; - return this; - } - - public GalleryImage create() { - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImages() - .createOrUpdateWithResponse( - resourceGroupName, labAccountName, galleryImageName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GalleryImage create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImages() - .createOrUpdateWithResponse( - resourceGroupName, labAccountName, galleryImageName, this.innerModel(), context) - .getValue(); - return this; - } - - GalleryImageImpl(String name, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = new GalleryImageInner(); - this.serviceManager = serviceManager; - this.galleryImageName = name; - } - - public GalleryImageImpl update() { - this.updateGalleryImage = new GalleryImageFragment(); - return this; - } - - public GalleryImage apply() { - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImages() - .updateWithResponse( - resourceGroupName, labAccountName, galleryImageName, updateGalleryImage, Context.NONE) - .getValue(); - return this; - } - - public GalleryImage apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImages() - .updateWithResponse(resourceGroupName, labAccountName, galleryImageName, updateGalleryImage, context) - .getValue(); - return this; - } - - GalleryImageImpl( - GalleryImageInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labAccountName = Utils.getValueFromIdByName(innerObject.id(), "labaccounts"); - this.galleryImageName = Utils.getValueFromIdByName(innerObject.id(), "galleryimages"); - } - - public GalleryImage refresh() { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImages() - .getWithResponse(resourceGroupName, labAccountName, galleryImageName, localExpand, Context.NONE) - .getValue(); - return this; - } - - public GalleryImage refresh(Context context) { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getGalleryImages() - .getWithResponse(resourceGroupName, labAccountName, galleryImageName, localExpand, context) - .getValue(); - return this; - } - - public GalleryImageImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public GalleryImageImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public GalleryImageImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateGalleryImage.withTags(tags); - return this; - } - } - - public GalleryImageImpl withIsEnabled(Boolean isEnabled) { - if (isInCreateMode()) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } else { - this.updateGalleryImage.withIsEnabled(isEnabled); - return this; - } - } - - public GalleryImageImpl withIsOverride(Boolean isOverride) { - if (isInCreateMode()) { - this.innerModel().withIsOverride(isOverride); - return this; - } else { - this.updateGalleryImage.withIsOverride(isOverride); - return this; - } - } - - public GalleryImageImpl withIsPlanAuthorized(Boolean isPlanAuthorized) { - if (isInCreateMode()) { - this.innerModel().withIsPlanAuthorized(isPlanAuthorized); - return this; - } else { - this.updateGalleryImage.withIsPlanAuthorized(isPlanAuthorized); - return this; - } - } - - public GalleryImageImpl withProvisioningState(String provisioningState) { - if (isInCreateMode()) { - this.innerModel().withProvisioningState(provisioningState); - return this; - } else { - this.updateGalleryImage.withProvisioningState(provisioningState); - return this; - } - } - - public GalleryImageImpl withUniqueIdentifier(String uniqueIdentifier) { - if (isInCreateMode()) { - this.innerModel().withUniqueIdentifier(uniqueIdentifier); - return this; - } else { - this.updateGalleryImage.withUniqueIdentifier(uniqueIdentifier); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImagesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImagesImpl.java deleted file mode 100644 index 0972d708f8af2..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImagesImpl.java +++ /dev/null @@ -1,200 +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.labservices.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.labservices.fluent.GalleryImagesClient; -import com.azure.resourcemanager.labservices.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.labservices.models.GalleryImage; -import com.azure.resourcemanager.labservices.models.GalleryImages; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class GalleryImagesImpl implements GalleryImages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImagesImpl.class); - - private final GalleryImagesClient innerClient; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - public GalleryImagesImpl( - GalleryImagesClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String labAccountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labAccountName); - return Utils.mapPage(inner, inner1 -> new GalleryImageImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, labAccountName, expand, filter, top, orderby, context); - return Utils.mapPage(inner, inner1 -> new GalleryImageImpl(inner1, this.manager())); - } - - public GalleryImage get(String resourceGroupName, String labAccountName, String galleryImageName) { - GalleryImageInner inner = this.serviceClient().get(resourceGroupName, labAccountName, galleryImageName); - if (inner != null) { - return new GalleryImageImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String labAccountName, String galleryImageName, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labAccountName, galleryImageName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GalleryImageImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String labAccountName, String galleryImageName) { - this.serviceClient().delete(resourceGroupName, labAccountName, galleryImageName); - } - - public Response deleteWithResponse( - String resourceGroupName, String labAccountName, String galleryImageName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, labAccountName, galleryImageName, context); - } - - public GalleryImage 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryimages"); - if (galleryImageName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); - } - String localExpand = null; - return this - .getWithResponse(resourceGroupName, labAccountName, galleryImageName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryimages"); - if (galleryImageName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); - } - return this.getWithResponse(resourceGroupName, labAccountName, galleryImageName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryimages"); - if (galleryImageName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); - } - this.deleteWithResponse(resourceGroupName, labAccountName, galleryImageName, Context.NONE).getValue(); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - String galleryImageName = Utils.getValueFromIdByName(id, "galleryimages"); - if (galleryImageName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'galleryimages'.", id))); - } - return this.deleteWithResponse(resourceGroupName, labAccountName, galleryImageName, context); - } - - private GalleryImagesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - public GalleryImageImpl define(String name) { - return new GalleryImageImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetEnvironmentResponseImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetEnvironmentResponseImpl.java deleted file mode 100644 index 364f657434b8b..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetEnvironmentResponseImpl.java +++ /dev/null @@ -1,34 +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.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.GetEnvironmentResponseInner; -import com.azure.resourcemanager.labservices.models.EnvironmentDetails; -import com.azure.resourcemanager.labservices.models.GetEnvironmentResponse; - -public final class GetEnvironmentResponseImpl implements GetEnvironmentResponse { - private GetEnvironmentResponseInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - GetEnvironmentResponseImpl( - GetEnvironmentResponseInner innerObject, - com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public EnvironmentDetails environment() { - return this.innerModel().environment(); - } - - public GetEnvironmentResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetPersonalPreferencesResponseImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetPersonalPreferencesResponseImpl.java deleted file mode 100644 index 3abeb100375b5..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetPersonalPreferencesResponseImpl.java +++ /dev/null @@ -1,44 +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.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.GetPersonalPreferencesResponseInner; -import com.azure.resourcemanager.labservices.models.GetPersonalPreferencesResponse; -import java.util.Collections; -import java.util.List; - -public final class GetPersonalPreferencesResponseImpl implements GetPersonalPreferencesResponse { - private GetPersonalPreferencesResponseInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - GetPersonalPreferencesResponseImpl( - GetPersonalPreferencesResponseInner innerObject, - com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public List favoriteLabResourceIds() { - List inner = this.innerModel().favoriteLabResourceIds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public GetPersonalPreferencesResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetRegionalAvailabilityResponseImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetRegionalAvailabilityResponseImpl.java deleted file mode 100644 index deab39ba77334..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GetRegionalAvailabilityResponseImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.GetRegionalAvailabilityResponseInner; -import com.azure.resourcemanager.labservices.models.GetRegionalAvailabilityResponse; -import com.azure.resourcemanager.labservices.models.RegionalAvailability; -import java.util.Collections; -import java.util.List; - -public final class GetRegionalAvailabilityResponseImpl implements GetRegionalAvailabilityResponse { - private GetRegionalAvailabilityResponseInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - GetRegionalAvailabilityResponseImpl( - GetRegionalAvailabilityResponseInner innerObject, - com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List regionalAvailability() { - List inner = this.innerModel().regionalAvailability(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public GetRegionalAvailabilityResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersClientImpl.java deleted file mode 100644 index 4160e4afd3c59..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersClientImpl.java +++ /dev/null @@ -1,1908 +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.labservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.labservices.fluent.GlobalUsersClient; -import com.azure.resourcemanager.labservices.fluent.models.GetEnvironmentResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.GetPersonalPreferencesResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.ListEnvironmentsResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.ListLabsResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.OperationBatchStatusResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.OperationStatusResponseInner; -import com.azure.resourcemanager.labservices.models.EnvironmentOperationsPayload; -import com.azure.resourcemanager.labservices.models.ListEnvironmentsPayload; -import com.azure.resourcemanager.labservices.models.OperationBatchStatusPayload; -import com.azure.resourcemanager.labservices.models.OperationStatusPayload; -import com.azure.resourcemanager.labservices.models.PersonalPreferencesOperationsPayload; -import com.azure.resourcemanager.labservices.models.RegisterPayload; -import com.azure.resourcemanager.labservices.models.ResetPasswordPayload; -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 GlobalUsersClient. */ -public final class GlobalUsersClientImpl implements GlobalUsersClient { - private final ClientLogger logger = new ClientLogger(GlobalUsersClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final GlobalUsersService service; - - /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; - - /** - * Initializes an instance of GlobalUsersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GlobalUsersClientImpl(ManagedLabsClientImpl client) { - this.service = - RestProxy.create(GlobalUsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ManagedLabsClientGlobalUsers to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientGlo") - private interface GlobalUsersService { - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/getEnvironment") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getEnvironment( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentOperationsPayload environmentOperationsPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/getOperationBatchStatus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOperationBatchStatus( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") OperationBatchStatusPayload operationBatchStatusPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/getOperationStatus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOperationStatus( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") OperationStatusPayload operationStatusPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getPersonalPreferences( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/listEnvironments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listEnvironments( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ListEnvironmentsPayload listEnvironmentsPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/listLabs") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listLabs( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/register") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> register( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RegisterPayload registerPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/resetPassword") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> resetPassword( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ResetPasswordPayload resetPasswordPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/startEnvironment") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startEnvironment( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentOperationsPayload environmentOperationsPayload, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/providers/Microsoft.LabServices/users/{userName}/stopEnvironment") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stopEnvironment( - @HostParam("$host") String endpoint, - @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") EnvironmentOperationsPayload environmentOperationsPayload, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param expand Specify the $expand query. Example: 'properties($expand=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 the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getEnvironmentWithResponseAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (environmentOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter environmentOperationsPayload is required and cannot be null.")); - } else { - environmentOperationsPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getEnvironment( - this.client.getEndpoint(), - username, - expand, - this.client.getApiVersion(), - environmentOperationsPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param expand Specify the $expand query. Example: 'properties($expand=environment)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getEnvironmentWithResponseAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, 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 (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (environmentOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter environmentOperationsPayload is required and cannot be null.")); - } else { - environmentOperationsPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getEnvironment( - this.client.getEndpoint(), - username, - expand, - this.client.getApiVersion(), - environmentOperationsPayload, - accept, - context); - } - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param expand Specify the $expand query. Example: 'properties($expand=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 the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, String expand) { - return getEnvironmentWithResponseAsync(username, environmentOperationsPayload, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - final String expand = null; - return getEnvironmentWithResponseAsync(username, environmentOperationsPayload, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetEnvironmentResponseInner getEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - final String expand = null; - return getEnvironmentAsync(username, environmentOperationsPayload, expand).block(); - } - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param expand Specify the $expand query. Example: 'properties($expand=environment)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEnvironmentWithResponse( - String username, EnvironmentOperationsPayload environmentOperationsPayload, String expand, Context context) { - return getEnvironmentWithResponseAsync(username, environmentOperationsPayload, expand, context).block(); - } - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationBatchStatusWithResponseAsync( - String username, OperationBatchStatusPayload operationBatchStatusPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (operationBatchStatusPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter operationBatchStatusPayload is required and cannot be null.")); - } else { - operationBatchStatusPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getOperationBatchStatus( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - operationBatchStatusPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationBatchStatusWithResponseAsync( - String username, OperationBatchStatusPayload operationBatchStatusPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (operationBatchStatusPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter operationBatchStatusPayload is required and cannot be null.")); - } else { - operationBatchStatusPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOperationBatchStatus( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - operationBatchStatusPayload, - accept, - context); - } - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOperationBatchStatusAsync( - String username, OperationBatchStatusPayload operationBatchStatusPayload) { - return getOperationBatchStatusWithResponseAsync(username, operationBatchStatusPayload) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationBatchStatusResponseInner getOperationBatchStatus( - String username, OperationBatchStatusPayload operationBatchStatusPayload) { - return getOperationBatchStatusAsync(username, operationBatchStatusPayload).block(); - } - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationBatchStatusWithResponse( - String username, OperationBatchStatusPayload operationBatchStatusPayload, Context context) { - return getOperationBatchStatusWithResponseAsync(username, operationBatchStatusPayload, context).block(); - } - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationStatusWithResponseAsync( - String username, OperationStatusPayload operationStatusPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (operationStatusPayload == null) { - return Mono - .error( - new IllegalArgumentException("Parameter operationStatusPayload is required and cannot be null.")); - } else { - operationStatusPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getOperationStatus( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - operationStatusPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationStatusWithResponseAsync( - String username, OperationStatusPayload operationStatusPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (operationStatusPayload == null) { - return Mono - .error( - new IllegalArgumentException("Parameter operationStatusPayload is required and cannot be null.")); - } else { - operationStatusPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getOperationStatus( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - operationStatusPayload, - accept, - context); - } - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOperationStatusAsync( - String username, OperationStatusPayload operationStatusPayload) { - return getOperationStatusWithResponseAsync(username, operationStatusPayload) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResponseInner getOperationStatus( - String username, OperationStatusPayload operationStatusPayload) { - return getOperationStatusAsync(username, operationStatusPayload).block(); - } - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationStatusWithResponse( - String username, OperationStatusPayload operationStatusPayload, Context context) { - return getOperationStatusWithResponseAsync(username, operationStatusPayload, context).block(); - } - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPersonalPreferencesWithResponseAsync( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (personalPreferencesOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter personalPreferencesOperationsPayload is required and cannot be null.")); - } else { - personalPreferencesOperationsPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getPersonalPreferences( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - personalPreferencesOperationsPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPersonalPreferencesWithResponseAsync( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (personalPreferencesOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter personalPreferencesOperationsPayload is required and cannot be null.")); - } else { - personalPreferencesOperationsPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getPersonalPreferences( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - personalPreferencesOperationsPayload, - accept, - context); - } - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getPersonalPreferencesAsync( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { - return getPersonalPreferencesWithResponseAsync(username, personalPreferencesOperationsPayload) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetPersonalPreferencesResponseInner getPersonalPreferences( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { - return getPersonalPreferencesAsync(username, personalPreferencesOperationsPayload).block(); - } - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPersonalPreferencesWithResponse( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, Context context) { - return getPersonalPreferencesWithResponseAsync(username, personalPreferencesOperationsPayload, context).block(); - } - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEnvironmentsWithResponseAsync( - String username, ListEnvironmentsPayload listEnvironmentsPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (listEnvironmentsPayload == null) { - return Mono - .error( - new IllegalArgumentException("Parameter listEnvironmentsPayload is required and cannot be null.")); - } else { - listEnvironmentsPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listEnvironments( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - listEnvironmentsPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEnvironmentsWithResponseAsync( - String username, ListEnvironmentsPayload listEnvironmentsPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (listEnvironmentsPayload == null) { - return Mono - .error( - new IllegalArgumentException("Parameter listEnvironmentsPayload is required and cannot be null.")); - } else { - listEnvironmentsPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listEnvironments( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - listEnvironmentsPayload, - accept, - context); - } - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listEnvironmentsAsync( - String username, ListEnvironmentsPayload listEnvironmentsPayload) { - return listEnvironmentsWithResponseAsync(username, listEnvironmentsPayload) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListEnvironmentsResponseInner listEnvironments( - String username, ListEnvironmentsPayload listEnvironmentsPayload) { - return listEnvironmentsAsync(username, listEnvironmentsPayload).block(); - } - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listEnvironmentsWithResponse( - String username, ListEnvironmentsPayload listEnvironmentsPayload, Context context) { - return listEnvironmentsWithResponseAsync(username, listEnvironmentsPayload, context).block(); - } - - /** - * List labs for the user. - * - * @param username The name of the user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLabsWithResponseAsync(String username) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.listLabs(this.client.getEndpoint(), username, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List labs for the user. - * - * @param username The name of the user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLabsWithResponseAsync(String username, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listLabs(this.client.getEndpoint(), username, this.client.getApiVersion(), accept, context); - } - - /** - * List labs for the user. - * - * @param username The name of the user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listLabsAsync(String username) { - return listLabsWithResponseAsync(username) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List labs for the user. - * - * @param username The name of the user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListLabsResponseInner listLabs(String username) { - return listLabsAsync(username).block(); - } - - /** - * List labs for the user. - * - * @param username The name of the user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listLabsWithResponse(String username, Context context) { - return listLabsWithResponseAsync(username, context).block(); - } - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> registerWithResponseAsync(String username, RegisterPayload registerPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (registerPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter registerPayload is required and cannot be null.")); - } else { - registerPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .register( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - registerPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> registerWithResponseAsync( - String username, RegisterPayload registerPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (registerPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter registerPayload is required and cannot be null.")); - } else { - registerPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .register( - this.client.getEndpoint(), username, this.client.getApiVersion(), registerPayload, accept, context); - } - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono registerAsync(String username, RegisterPayload registerPayload) { - return registerWithResponseAsync(username, registerPayload).flatMap((Response res) -> Mono.empty()); - } - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 register(String username, RegisterPayload registerPayload) { - registerAsync(username, registerPayload).block(); - } - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 registerWithResponse(String username, RegisterPayload registerPayload, Context context) { - return registerWithResponseAsync(username, registerPayload, context).block(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetPasswordWithResponseAsync( - String username, ResetPasswordPayload resetPasswordPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (resetPasswordPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null.")); - } else { - resetPasswordPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .resetPassword( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - resetPasswordPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> resetPasswordWithResponseAsync( - String username, ResetPasswordPayload resetPasswordPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (resetPasswordPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null.")); - } else { - resetPasswordPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .resetPassword( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - resetPasswordPayload, - accept, - context); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginResetPasswordAsync( - String username, ResetPasswordPayload resetPasswordPayload) { - Mono>> mono = resetPasswordWithResponseAsync(username, resetPasswordPayload); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginResetPasswordAsync( - String username, ResetPasswordPayload resetPasswordPayload, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = resetPasswordWithResponseAsync(username, resetPasswordPayload, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetPassword( - String username, ResetPasswordPayload resetPasswordPayload) { - return beginResetPasswordAsync(username, resetPasswordPayload).getSyncPoller(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginResetPassword( - String username, ResetPasswordPayload resetPasswordPayload, Context context) { - return beginResetPasswordAsync(username, resetPasswordPayload, context).getSyncPoller(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetPasswordAsync(String username, ResetPasswordPayload resetPasswordPayload) { - return beginResetPasswordAsync(username, resetPasswordPayload) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resetPasswordAsync(String username, ResetPasswordPayload resetPasswordPayload, Context context) { - return beginResetPasswordAsync(username, resetPasswordPayload, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resetPassword(String username, ResetPasswordPayload resetPasswordPayload) { - resetPasswordAsync(username, resetPasswordPayload).block(); - } - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resetPassword(String username, ResetPasswordPayload resetPasswordPayload, Context context) { - resetPasswordAsync(username, resetPasswordPayload, context).block(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startEnvironmentWithResponseAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (environmentOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter environmentOperationsPayload is required and cannot be null.")); - } else { - environmentOperationsPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .startEnvironment( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - environmentOperationsPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startEnvironmentWithResponseAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (environmentOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter environmentOperationsPayload is required and cannot be null.")); - } else { - environmentOperationsPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .startEnvironment( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - environmentOperationsPayload, - accept, - context); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - Mono>> mono = - startEnvironmentWithResponseAsync(username, environmentOperationsPayload); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startEnvironmentWithResponseAsync(username, environmentOperationsPayload, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStartEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - return beginStartEnvironmentAsync(username, environmentOperationsPayload).getSyncPoller(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStartEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - return beginStartEnvironmentAsync(username, environmentOperationsPayload, context).getSyncPoller(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - return beginStartEnvironmentAsync(username, environmentOperationsPayload) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - return beginStartEnvironmentAsync(username, environmentOperationsPayload, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 startEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload) { - startEnvironmentAsync(username, environmentOperationsPayload).block(); - } - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 startEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - startEnvironmentAsync(username, environmentOperationsPayload, context).block(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopEnvironmentWithResponseAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (environmentOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter environmentOperationsPayload is required and cannot be null.")); - } else { - environmentOperationsPayload.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stopEnvironment( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - environmentOperationsPayload, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopEnvironmentWithResponseAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (username == null) { - return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); - } - if (environmentOperationsPayload == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter environmentOperationsPayload is required and cannot be null.")); - } else { - environmentOperationsPayload.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stopEnvironment( - this.client.getEndpoint(), - username, - this.client.getApiVersion(), - environmentOperationsPayload, - accept, - context); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - Mono>> mono = - stopEnvironmentWithResponseAsync(username, environmentOperationsPayload); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStopEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopEnvironmentWithResponseAsync(username, environmentOperationsPayload, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStopEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - return beginStopEnvironmentAsync(username, environmentOperationsPayload).getSyncPoller(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStopEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - return beginStopEnvironmentAsync(username, environmentOperationsPayload, context).getSyncPoller(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - return beginStopEnvironmentAsync(username, environmentOperationsPayload) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopEnvironmentAsync( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - return beginStopEnvironmentAsync(username, environmentOperationsPayload, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 stopEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload) { - stopEnvironmentAsync(username, environmentOperationsPayload).block(); - } - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 stopEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - stopEnvironmentAsync(username, environmentOperationsPayload, context).block(); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersImpl.java deleted file mode 100644 index d9a313a6891cb..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GlobalUsersImpl.java +++ /dev/null @@ -1,237 +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.labservices.implementation; - -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.labservices.fluent.GlobalUsersClient; -import com.azure.resourcemanager.labservices.fluent.models.GetEnvironmentResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.GetPersonalPreferencesResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.ListEnvironmentsResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.ListLabsResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.OperationBatchStatusResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.OperationStatusResponseInner; -import com.azure.resourcemanager.labservices.models.EnvironmentOperationsPayload; -import com.azure.resourcemanager.labservices.models.GetEnvironmentResponse; -import com.azure.resourcemanager.labservices.models.GetPersonalPreferencesResponse; -import com.azure.resourcemanager.labservices.models.GlobalUsers; -import com.azure.resourcemanager.labservices.models.ListEnvironmentsPayload; -import com.azure.resourcemanager.labservices.models.ListEnvironmentsResponse; -import com.azure.resourcemanager.labservices.models.ListLabsResponse; -import com.azure.resourcemanager.labservices.models.OperationBatchStatusPayload; -import com.azure.resourcemanager.labservices.models.OperationBatchStatusResponse; -import com.azure.resourcemanager.labservices.models.OperationStatusPayload; -import com.azure.resourcemanager.labservices.models.OperationStatusResponse; -import com.azure.resourcemanager.labservices.models.PersonalPreferencesOperationsPayload; -import com.azure.resourcemanager.labservices.models.RegisterPayload; -import com.azure.resourcemanager.labservices.models.ResetPasswordPayload; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class GlobalUsersImpl implements GlobalUsers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalUsersImpl.class); - - private final GlobalUsersClient innerClient; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - public GlobalUsersImpl( - GlobalUsersClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public GetEnvironmentResponse getEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload) { - GetEnvironmentResponseInner inner = this.serviceClient().getEnvironment(username, environmentOperationsPayload); - if (inner != null) { - return new GetEnvironmentResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getEnvironmentWithResponse( - String username, EnvironmentOperationsPayload environmentOperationsPayload, String expand, Context context) { - Response inner = - this.serviceClient().getEnvironmentWithResponse(username, environmentOperationsPayload, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GetEnvironmentResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationBatchStatusResponse getOperationBatchStatus( - String username, OperationBatchStatusPayload operationBatchStatusPayload) { - OperationBatchStatusResponseInner inner = - this.serviceClient().getOperationBatchStatus(username, operationBatchStatusPayload); - if (inner != null) { - return new OperationBatchStatusResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getOperationBatchStatusWithResponse( - String username, OperationBatchStatusPayload operationBatchStatusPayload, Context context) { - Response inner = - this.serviceClient().getOperationBatchStatusWithResponse(username, operationBatchStatusPayload, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OperationBatchStatusResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationStatusResponse getOperationStatus(String username, OperationStatusPayload operationStatusPayload) { - OperationStatusResponseInner inner = this.serviceClient().getOperationStatus(username, operationStatusPayload); - if (inner != null) { - return new OperationStatusResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getOperationStatusWithResponse( - String username, OperationStatusPayload operationStatusPayload, Context context) { - Response inner = - this.serviceClient().getOperationStatusWithResponse(username, operationStatusPayload, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OperationStatusResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GetPersonalPreferencesResponse getPersonalPreferences( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { - GetPersonalPreferencesResponseInner inner = - this.serviceClient().getPersonalPreferences(username, personalPreferencesOperationsPayload); - if (inner != null) { - return new GetPersonalPreferencesResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getPersonalPreferencesWithResponse( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, Context context) { - Response inner = - this - .serviceClient() - .getPersonalPreferencesWithResponse(username, personalPreferencesOperationsPayload, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GetPersonalPreferencesResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ListEnvironmentsResponse listEnvironments(String username, ListEnvironmentsPayload listEnvironmentsPayload) { - ListEnvironmentsResponseInner inner = this.serviceClient().listEnvironments(username, listEnvironmentsPayload); - if (inner != null) { - return new ListEnvironmentsResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listEnvironmentsWithResponse( - String username, ListEnvironmentsPayload listEnvironmentsPayload, Context context) { - Response inner = - this.serviceClient().listEnvironmentsWithResponse(username, listEnvironmentsPayload, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ListEnvironmentsResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ListLabsResponse listLabs(String username) { - ListLabsResponseInner inner = this.serviceClient().listLabs(username); - if (inner != null) { - return new ListLabsResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listLabsWithResponse(String username, Context context) { - Response inner = this.serviceClient().listLabsWithResponse(username, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ListLabsResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void register(String username, RegisterPayload registerPayload) { - this.serviceClient().register(username, registerPayload); - } - - public Response registerWithResponse(String username, RegisterPayload registerPayload, Context context) { - return this.serviceClient().registerWithResponse(username, registerPayload, context); - } - - public void resetPassword(String username, ResetPasswordPayload resetPasswordPayload) { - this.serviceClient().resetPassword(username, resetPasswordPayload); - } - - public void resetPassword(String username, ResetPasswordPayload resetPasswordPayload, Context context) { - this.serviceClient().resetPassword(username, resetPasswordPayload, context); - } - - public void startEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload) { - this.serviceClient().startEnvironment(username, environmentOperationsPayload); - } - - public void startEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - this.serviceClient().startEnvironment(username, environmentOperationsPayload, context); - } - - public void stopEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload) { - this.serviceClient().stopEnvironment(username, environmentOperationsPayload); - } - - public void stopEnvironment( - String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context) { - this.serviceClient().stopEnvironment(username, environmentOperationsPayload, context); - } - - private GlobalUsersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImageImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImageImpl.java new file mode 100644 index 0000000000000..c048acde33996 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImageImpl.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.labservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.ImageInner; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.Image; +import com.azure.resourcemanager.labservices.models.ImageUpdate; +import com.azure.resourcemanager.labservices.models.OsState; +import com.azure.resourcemanager.labservices.models.OsType; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ImageImpl implements Image, Image.Definition, Image.Update { + private ImageInner innerObject; + + private final com.azure.resourcemanager.labservices.LabServicesManager 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String iconUrl() { + return this.innerModel().iconUrl(); + } + + public String author() { + return this.innerModel().author(); + } + + public OsType osType() { + return this.innerModel().osType(); + } + + public String plan() { + return this.innerModel().plan(); + } + + public EnableState termsStatus() { + return this.innerModel().termsStatus(); + } + + public String offer() { + return this.innerModel().offer(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String sku() { + return this.innerModel().sku(); + } + + public String version() { + return this.innerModel().version(); + } + + public String sharedGalleryId() { + return this.innerModel().sharedGalleryId(); + } + + public List availableRegions() { + List inner = this.innerModel().availableRegions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OsState osState() { + return this.innerModel().osState(); + } + + public EnableState enabledState() { + return this.innerModel().enabledState(); + } + + public ImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String labPlanName; + + private String imageName; + + private ImageUpdate updateBody; + + public ImageImpl withExistingLabPlan(String resourceGroupName, String labPlanName) { + this.resourceGroupName = resourceGroupName; + this.labPlanName = labPlanName; + return this; + } + + public Image create() { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .createOrUpdateWithResponse(resourceGroupName, labPlanName, imageName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Image create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .createOrUpdateWithResponse(resourceGroupName, labPlanName, imageName, this.innerModel(), context) + .getValue(); + return this; + } + + ImageImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = new ImageInner(); + this.serviceManager = serviceManager; + this.imageName = name; + } + + public ImageImpl update() { + this.updateBody = new ImageUpdate(); + return this; + } + + public Image apply() { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .updateWithResponse(resourceGroupName, labPlanName, imageName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public Image apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .updateWithResponse(resourceGroupName, labPlanName, imageName, updateBody, context) + .getValue(); + return this; + } + + ImageImpl(ImageInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.labPlanName = Utils.getValueFromIdByName(innerObject.id(), "labPlans"); + this.imageName = Utils.getValueFromIdByName(innerObject.id(), "images"); + } + + public Image refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .getWithResponse(resourceGroupName, labPlanName, imageName, Context.NONE) + .getValue(); + return this; + } + + public Image refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImages() + .getWithResponse(resourceGroupName, labPlanName, imageName, context) + .getValue(); + return this; + } + + public ImageImpl withAvailableRegions(List availableRegions) { + this.innerModel().withAvailableRegions(availableRegions); + return this; + } + + public ImageImpl withEnabledState(EnableState enabledState) { + if (isInCreateMode()) { + this.innerModel().withEnabledState(enabledState); + return this; + } else { + this.updateBody.withEnabledState(enabledState); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesClientImpl.java new file mode 100644 index 0000000000000..e6c6c6426aa6f --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesClientImpl.java @@ -0,0 +1,966 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +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; +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.labservices.fluent.ImagesClient; +import com.azure.resourcemanager.labservices.fluent.models.ImageInner; +import com.azure.resourcemanager.labservices.models.ImageUpdate; +import com.azure.resourcemanager.labservices.models.PagedImages; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ImagesClient. */ +public final class ImagesClientImpl implements ImagesClient { + private final ClientLogger logger = new ClientLogger(ImagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ImagesService service; + + /** The service client containing this operation class. */ + private final LabServicesClientImpl client; + + /** + * Initializes an instance of ImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ImagesClientImpl(LabServicesClientImpl client) { + this.service = RestProxy.create(ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LabServicesClientImages to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "LabServicesClientIma") + private interface ImagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" + + "/labPlans/{labPlanName}/images") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLabPlan( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labPlanName") String labPlanName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" + + "/labPlans/{labPlanName}/images/{imageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labPlanName") String labPlanName, + @PathParam("imageName") String imageName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" + + "/labPlans/{labPlanName}/images/{imageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labPlanName") String labPlanName, + @PathParam("imageName") String imageName, + @BodyParam("application/json") ImageInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" + + "/labPlans/{labPlanName}/images/{imageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labPlanName") String labPlanName, + @PathParam("imageName") String imageName, + @BodyParam("application/json") ImageUpdate body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLabPlanNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabPlanSinglePageAsync( + String resourceGroupName, String labPlanName, String filter) { + 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 (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLabPlan( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + filter, + 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())); + } + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabPlanSinglePageAsync( + String resourceGroupName, String labPlanName, String filter, 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 (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLabPlan( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLabPlanAsync(String resourceGroupName, String labPlanName, String filter) { + return new PagedFlux<>( + () -> listByLabPlanSinglePageAsync(resourceGroupName, labPlanName, filter), + nextLink -> listByLabPlanNextSinglePageAsync(nextLink)); + } + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLabPlanAsync(String resourceGroupName, String labPlanName) { + final String filter = null; + return new PagedFlux<>( + () -> listByLabPlanSinglePageAsync(resourceGroupName, labPlanName, filter), + nextLink -> listByLabPlanNextSinglePageAsync(nextLink)); + } + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLabPlanAsync( + String resourceGroupName, String labPlanName, String filter, Context context) { + return new PagedFlux<>( + () -> listByLabPlanSinglePageAsync(resourceGroupName, labPlanName, filter, context), + nextLink -> listByLabPlanNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLabPlan(String resourceGroupName, String labPlanName) { + final String filter = null; + return new PagedIterable<>(listByLabPlanAsync(resourceGroupName, labPlanName, filter)); + } + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLabPlan( + String resourceGroupName, String labPlanName, String filter, Context context) { + return new PagedIterable<>(listByLabPlanAsync(resourceGroupName, labPlanName, filter, context)); + } + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image 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 an image resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labPlanName, String imageName) { + 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 (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + imageName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labPlanName, String imageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + imageName, + accept, + context); + } + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image 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 an image resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String labPlanName, String imageName) { + return getWithResponseAsync(resourceGroupName, labPlanName, imageName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image 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 an image resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner get(String resourceGroupName, String labPlanName, String imageName) { + return getAsync(resourceGroupName, labPlanName, imageName).block(); + } + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String labPlanName, String imageName, Context context) { + return getWithResponseAsync(resourceGroupName, labPlanName, imageName, context).block(); + } + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String labPlanName, String imageName, ImageInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + imageName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String labPlanName, String imageName, ImageInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + imageName, + body, + accept, + context); + } + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labPlanName, String imageName, ImageInner body) { + return createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, imageName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner createOrUpdate(String resourceGroupName, String labPlanName, String imageName, ImageInner body) { + return createOrUpdateAsync(resourceGroupName, labPlanName, imageName, body).block(); + } + + /** + * Updates an image resource via PUT. Creating new resources via PUT will not function. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String labPlanName, String imageName, ImageInner body, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, imageName, body, context).block(); + } + + /** + * Updates an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String labPlanName, String imageName, ImageUpdate body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + imageName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String labPlanName, String imageName, ImageUpdate body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (imageName == null) { + return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labPlanName, + imageName, + body, + accept, + context); + } + + /** + * Updates an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String labPlanName, String imageName, ImageUpdate body) { + return updateWithResponseAsync(resourceGroupName, labPlanName, imageName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImageInner update(String resourceGroupName, String labPlanName, String imageName, ImageUpdate body) { + return updateAsync(resourceGroupName, labPlanName, imageName, body).block(); + } + + /** + * Updates an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 services virtual machine image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String labPlanName, String imageName, ImageUpdate body, Context context) { + return updateWithResponseAsync(resourceGroupName, labPlanName, imageName, body, 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 paged list of Lab services virtual machine images along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabPlanNextSinglePageAsync(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.listByLabPlanNext(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 paged list of Lab services virtual machine images along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabPlanNextSinglePageAsync(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 + .listByLabPlanNext(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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesImpl.java new file mode 100644 index 0000000000000..8a5d05397e350 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ImagesImpl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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.labservices.fluent.ImagesClient; +import com.azure.resourcemanager.labservices.fluent.models.ImageInner; +import com.azure.resourcemanager.labservices.models.Image; +import com.azure.resourcemanager.labservices.models.Images; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ImagesImpl implements Images { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImagesImpl.class); + + private final ImagesClient innerClient; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + public ImagesImpl( + ImagesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLabPlan(String resourceGroupName, String labPlanName) { + PagedIterable inner = this.serviceClient().listByLabPlan(resourceGroupName, labPlanName); + return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public PagedIterable listByLabPlan( + String resourceGroupName, String labPlanName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByLabPlan(resourceGroupName, labPlanName, filter, context); + return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + } + + public Image get(String resourceGroupName, String labPlanName, String imageName) { + ImageInner inner = this.serviceClient().get(resourceGroupName, labPlanName, imageName); + if (inner != null) { + return new ImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String labPlanName, String imageName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labPlanName, imageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Image 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 labPlanName = Utils.getValueFromIdByName(id, "labPlans"); + if (labPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); + } + String imageName = Utils.getValueFromIdByName(id, "images"); + if (imageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + return this.getWithResponse(resourceGroupName, labPlanName, imageName, 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 labPlanName = Utils.getValueFromIdByName(id, "labPlans"); + if (labPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); + } + String imageName = Utils.getValueFromIdByName(id, "images"); + if (imageName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + } + return this.getWithResponse(resourceGroupName, labPlanName, imageName, context); + } + + private ImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } + + public ImageImpl define(String name) { + return new ImageImpl(name, this.manager()); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountImpl.java deleted file mode 100644 index 7d387ec7a0a82..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountImpl.java +++ /dev/null @@ -1,251 +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.labservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.LabAccountInner; -import com.azure.resourcemanager.labservices.models.CreateLabProperties; -import com.azure.resourcemanager.labservices.models.GetRegionalAvailabilityResponse; -import com.azure.resourcemanager.labservices.models.LabAccount; -import com.azure.resourcemanager.labservices.models.LabAccountFragment; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import com.azure.resourcemanager.labservices.models.SizeConfigurationProperties; -import java.util.Collections; -import java.util.Map; - -public final class LabAccountImpl implements LabAccount, LabAccount.Definition, LabAccount.Update { - private LabAccountInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager 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 SizeConfigurationProperties sizeConfiguration() { - return this.innerModel().sizeConfiguration(); - } - - public Boolean enabledRegionSelection() { - return this.innerModel().enabledRegionSelection(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public String uniqueIdentifier() { - return this.innerModel().uniqueIdentifier(); - } - - public LatestOperationResult latestOperationResult() { - return this.innerModel().latestOperationResult(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public LabAccountInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String labAccountName; - - private LabAccountFragment updateLabAccount; - - public LabAccountImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public LabAccount create() { - this.innerObject = - serviceManager - .serviceClient() - .getLabAccounts() - .createOrUpdateWithResponse(resourceGroupName, labAccountName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public LabAccount create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLabAccounts() - .createOrUpdateWithResponse(resourceGroupName, labAccountName, this.innerModel(), context) - .getValue(); - return this; - } - - LabAccountImpl(String name, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = new LabAccountInner(); - this.serviceManager = serviceManager; - this.labAccountName = name; - } - - public LabAccountImpl update() { - this.updateLabAccount = new LabAccountFragment(); - return this; - } - - public LabAccount apply() { - this.innerObject = - serviceManager - .serviceClient() - .getLabAccounts() - .updateWithResponse(resourceGroupName, labAccountName, updateLabAccount, Context.NONE) - .getValue(); - return this; - } - - public LabAccount apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLabAccounts() - .updateWithResponse(resourceGroupName, labAccountName, updateLabAccount, context) - .getValue(); - return this; - } - - LabAccountImpl( - LabAccountInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labAccountName = Utils.getValueFromIdByName(innerObject.id(), "labaccounts"); - } - - public LabAccount refresh() { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getLabAccounts() - .getByResourceGroupWithResponse(resourceGroupName, labAccountName, localExpand, Context.NONE) - .getValue(); - return this; - } - - public LabAccount refresh(Context context) { - String localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getLabAccounts() - .getByResourceGroupWithResponse(resourceGroupName, labAccountName, localExpand, context) - .getValue(); - return this; - } - - public void createLab(CreateLabProperties createLabProperties) { - serviceManager.labAccounts().createLab(resourceGroupName, labAccountName, createLabProperties); - } - - public Response createLabWithResponse(CreateLabProperties createLabProperties, Context context) { - return serviceManager - .labAccounts() - .createLabWithResponse(resourceGroupName, labAccountName, createLabProperties, context); - } - - public GetRegionalAvailabilityResponse getRegionalAvailability() { - return serviceManager.labAccounts().getRegionalAvailability(resourceGroupName, labAccountName); - } - - public Response getRegionalAvailabilityWithResponse(Context context) { - return serviceManager - .labAccounts() - .getRegionalAvailabilityWithResponse(resourceGroupName, labAccountName, context); - } - - public LabAccountImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public LabAccountImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public LabAccountImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateLabAccount.withTags(tags); - return this; - } - } - - public LabAccountImpl withEnabledRegionSelection(Boolean enabledRegionSelection) { - if (isInCreateMode()) { - this.innerModel().withEnabledRegionSelection(enabledRegionSelection); - return this; - } else { - this.updateLabAccount.withEnabledRegionSelection(enabledRegionSelection); - return this; - } - } - - public LabAccountImpl withProvisioningState(String provisioningState) { - if (isInCreateMode()) { - this.innerModel().withProvisioningState(provisioningState); - return this; - } else { - this.updateLabAccount.withProvisioningState(provisioningState); - return this; - } - } - - public LabAccountImpl withUniqueIdentifier(String uniqueIdentifier) { - if (isInCreateMode()) { - this.innerModel().withUniqueIdentifier(uniqueIdentifier); - return this; - } else { - this.updateLabAccount.withUniqueIdentifier(uniqueIdentifier); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountsImpl.java deleted file mode 100644 index 653028356d55e..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountsImpl.java +++ /dev/null @@ -1,214 +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.labservices.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.labservices.fluent.LabAccountsClient; -import com.azure.resourcemanager.labservices.fluent.models.GetRegionalAvailabilityResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.LabAccountInner; -import com.azure.resourcemanager.labservices.models.CreateLabProperties; -import com.azure.resourcemanager.labservices.models.GetRegionalAvailabilityResponse; -import com.azure.resourcemanager.labservices.models.LabAccount; -import com.azure.resourcemanager.labservices.models.LabAccounts; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class LabAccountsImpl implements LabAccounts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabAccountsImpl.class); - - private final LabAccountsClient innerClient; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - public LabAccountsImpl( - LabAccountsClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new LabAccountImpl(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); - return Utils.mapPage(inner, inner1 -> new LabAccountImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new LabAccountImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, expand, filter, top, orderby, context); - return Utils.mapPage(inner, inner1 -> new LabAccountImpl(inner1, this.manager())); - } - - public LabAccount getByResourceGroup(String resourceGroupName, String labAccountName) { - LabAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, labAccountName); - if (inner != null) { - return new LabAccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String labAccountName, String expand, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, labAccountName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new LabAccountImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String labAccountName) { - this.serviceClient().delete(resourceGroupName, labAccountName); - } - - public void delete(String resourceGroupName, String labAccountName, Context context) { - this.serviceClient().delete(resourceGroupName, labAccountName, context); - } - - public void createLab(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { - this.serviceClient().createLab(resourceGroupName, labAccountName, createLabProperties); - } - - public Response createLabWithResponse( - String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties, Context context) { - return this - .serviceClient() - .createLabWithResponse(resourceGroupName, labAccountName, createLabProperties, context); - } - - public GetRegionalAvailabilityResponse getRegionalAvailability(String resourceGroupName, String labAccountName) { - GetRegionalAvailabilityResponseInner inner = - this.serviceClient().getRegionalAvailability(resourceGroupName, labAccountName); - if (inner != null) { - return new GetRegionalAvailabilityResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getRegionalAvailabilityWithResponse( - String resourceGroupName, String labAccountName, Context context) { - Response inner = - this.serviceClient().getRegionalAvailabilityWithResponse(resourceGroupName, labAccountName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GetRegionalAvailabilityResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public LabAccount 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - String localExpand = null; - return this - .getByResourceGroupWithResponse(resourceGroupName, labAccountName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, labAccountName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - this.delete(resourceGroupName, labAccountName, 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 labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } - this.delete(resourceGroupName, labAccountName, context); - } - - private LabAccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } - - public LabAccountImpl define(String name) { - return new LabAccountImpl(name, this.manager()); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabImpl.java index 36bbd542a5aa6..42ff0d1f3c2d5 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabImpl.java @@ -4,24 +4,28 @@ package com.azure.resourcemanager.labservices.implementation; -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.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.AddUsersPayload; +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; import com.azure.resourcemanager.labservices.models.Lab; -import com.azure.resourcemanager.labservices.models.LabFragment; -import com.azure.resourcemanager.labservices.models.LabUserAccessMode; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; -import java.time.Duration; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.labservices.models.LabNetworkProfile; +import com.azure.resourcemanager.labservices.models.LabState; +import com.azure.resourcemanager.labservices.models.LabUpdate; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RosterProfile; +import com.azure.resourcemanager.labservices.models.SecurityProfile; +import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; import java.util.Collections; +import java.util.List; import java.util.Map; public final class LabImpl implements Lab, Lab.Definition, Lab.Update { private LabInner innerObject; - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -48,48 +52,52 @@ public Map tags() { } } - public Integer maxUsersInLab() { - return this.innerModel().maxUsersInLab(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public Integer userQuota() { - return this.innerModel().userQuota(); + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); } - public String invitationCode() { - return this.innerModel().invitationCode(); + public LabNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); } - public String createdByObjectId() { - return this.innerModel().createdByObjectId(); + public LabState state() { + return this.innerModel().state(); } - public Duration usageQuota() { - return this.innerModel().usageQuota(); + public AutoShutdownProfile autoShutdownProfile() { + return this.innerModel().autoShutdownProfile(); } - public LabUserAccessMode userAccessMode() { - return this.innerModel().userAccessMode(); + public ConnectionProfile connectionProfile() { + return this.innerModel().connectionProfile(); } - public String createdByUserPrincipalName() { - return this.innerModel().createdByUserPrincipalName(); + public VirtualMachineProfile virtualMachineProfile() { + return this.innerModel().virtualMachineProfile(); } - public OffsetDateTime createdDate() { - return this.innerModel().createdDate(); + public SecurityProfile securityProfile() { + return this.innerModel().securityProfile(); } - public String provisioningState() { - return this.innerModel().provisioningState(); + public RosterProfile rosterProfile() { + return this.innerModel().rosterProfile(); } - public String uniqueIdentifier() { - return this.innerModel().uniqueIdentifier(); + public String labPlanId() { + return this.innerModel().labPlanId(); } - public LatestOperationResult latestOperationResult() { - return this.innerModel().latestOperationResult(); + public String title() { + return this.innerModel().title(); + } + + public String description() { + return this.innerModel().description(); } public Region region() { @@ -104,21 +112,18 @@ public LabInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { + private com.azure.resourcemanager.labservices.LabServicesManager manager() { return this.serviceManager; } private String resourceGroupName; - private String labAccountName; - private String labName; - private LabFragment updateLab; + private LabUpdate updateBody; - public LabImpl withExistingLabaccount(String resourceGroupName, String labAccountName) { + public LabImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; - this.labAccountName = labAccountName; return this; } @@ -127,8 +132,7 @@ public Lab create() { serviceManager .serviceClient() .getLabs() - .createOrUpdateWithResponse(resourceGroupName, labAccountName, labName, this.innerModel(), Context.NONE) - .getValue(); + .createOrUpdate(resourceGroupName, labName, this.innerModel(), Context.NONE); return this; } @@ -137,88 +141,74 @@ public Lab create(Context context) { serviceManager .serviceClient() .getLabs() - .createOrUpdateWithResponse(resourceGroupName, labAccountName, labName, this.innerModel(), context) - .getValue(); + .createOrUpdate(resourceGroupName, labName, this.innerModel(), context); return this; } - LabImpl(String name, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + LabImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerObject = new LabInner(); this.serviceManager = serviceManager; this.labName = name; } public LabImpl update() { - this.updateLab = new LabFragment(); + this.updateBody = new LabUpdate(); return this; } public Lab apply() { this.innerObject = - serviceManager - .serviceClient() - .getLabs() - .updateWithResponse(resourceGroupName, labAccountName, labName, updateLab, Context.NONE) - .getValue(); + serviceManager.serviceClient().getLabs().update(resourceGroupName, labName, updateBody, Context.NONE); return this; } public Lab apply(Context context) { this.innerObject = - serviceManager - .serviceClient() - .getLabs() - .updateWithResponse(resourceGroupName, labAccountName, labName, updateLab, context) - .getValue(); + serviceManager.serviceClient().getLabs().update(resourceGroupName, labName, updateBody, context); return this; } - LabImpl(LabInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + LabImpl(LabInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labAccountName = Utils.getValueFromIdByName(innerObject.id(), "labaccounts"); this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); } public Lab refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getLabs() - .getWithResponse(resourceGroupName, labAccountName, labName, localExpand, Context.NONE) + .getByResourceGroupWithResponse(resourceGroupName, labName, Context.NONE) .getValue(); return this; } public Lab refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getLabs() - .getWithResponse(resourceGroupName, labAccountName, labName, localExpand, context) + .getByResourceGroupWithResponse(resourceGroupName, labName, context) .getValue(); return this; } - public void addUsers(AddUsersPayload addUsersPayload) { - serviceManager.labs().addUsers(resourceGroupName, labAccountName, labName, addUsersPayload); + public void publish() { + serviceManager.labs().publish(resourceGroupName, labName); } - public Response addUsersWithResponse(AddUsersPayload addUsersPayload, Context context) { - return serviceManager - .labs() - .addUsersWithResponse(resourceGroupName, labAccountName, labName, addUsersPayload, context); + public void publish(Context context) { + serviceManager.labs().publish(resourceGroupName, labName, context); } - public void register() { - serviceManager.labs().register(resourceGroupName, labAccountName, labName); + public void syncGroup() { + serviceManager.labs().syncGroup(resourceGroupName, labName); } - public Response registerWithResponse(Context context) { - return serviceManager.labs().registerWithResponse(resourceGroupName, labAccountName, labName, context); + public void syncGroup(Context context) { + serviceManager.labs().syncGroup(resourceGroupName, labName, context); } public LabImpl withRegion(Region location) { @@ -232,65 +222,100 @@ public LabImpl withRegion(String location) { } public LabImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public LabImpl withNetworkProfile(LabNetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public LabImpl withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { + if (isInCreateMode()) { + this.innerModel().withAutoShutdownProfile(autoShutdownProfile); + return this; + } else { + this.updateBody.withAutoShutdownProfile(autoShutdownProfile); + return this; + } + } + + public LabImpl withConnectionProfile(ConnectionProfile connectionProfile) { if (isInCreateMode()) { - this.innerModel().withTags(tags); + this.innerModel().withConnectionProfile(connectionProfile); return this; } else { - this.updateLab.withTags(tags); + this.updateBody.withConnectionProfile(connectionProfile); return this; } } - public LabImpl withMaxUsersInLab(Integer maxUsersInLab) { + public LabImpl withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { if (isInCreateMode()) { - this.innerModel().withMaxUsersInLab(maxUsersInLab); + this.innerModel().withVirtualMachineProfile(virtualMachineProfile); return this; } else { - this.updateLab.withMaxUsersInLab(maxUsersInLab); + this.updateBody.withVirtualMachineProfile(virtualMachineProfile); return this; } } - public LabImpl withUsageQuota(Duration usageQuota) { + public LabImpl withSecurityProfile(SecurityProfile securityProfile) { if (isInCreateMode()) { - this.innerModel().withUsageQuota(usageQuota); + this.innerModel().withSecurityProfile(securityProfile); return this; } else { - this.updateLab.withUsageQuota(usageQuota); + this.updateBody.withSecurityProfile(securityProfile); return this; } } - public LabImpl withUserAccessMode(LabUserAccessMode userAccessMode) { + public LabImpl withRosterProfile(RosterProfile rosterProfile) { if (isInCreateMode()) { - this.innerModel().withUserAccessMode(userAccessMode); + this.innerModel().withRosterProfile(rosterProfile); return this; } else { - this.updateLab.withUserAccessMode(userAccessMode); + this.updateBody.withRosterProfile(rosterProfile); return this; } } - public LabImpl withProvisioningState(String provisioningState) { + public LabImpl withLabPlanId(String labPlanId) { if (isInCreateMode()) { - this.innerModel().withProvisioningState(provisioningState); + this.innerModel().withLabPlanId(labPlanId); return this; } else { - this.updateLab.withProvisioningState(provisioningState); + this.updateBody.withLabPlanId(labPlanId); return this; } } - public LabImpl withUniqueIdentifier(String uniqueIdentifier) { + public LabImpl withTitle(String title) { if (isInCreateMode()) { - this.innerModel().withUniqueIdentifier(uniqueIdentifier); + this.innerModel().withTitle(title); return this; } else { - this.updateLab.withUniqueIdentifier(uniqueIdentifier); + this.updateBody.withTitle(title); return this; } } + public LabImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateBody.withDescription(description); + return this; + } + } + + public LabImpl withTags(List tags) { + this.updateBody.withTags(tags); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlanImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlanImpl.java new file mode 100644 index 0000000000000..a4ef92ed0a05d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlanImpl.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.LabPlan; +import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; +import com.azure.resourcemanager.labservices.models.LabPlanUpdate; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.SaveImageBody; +import com.azure.resourcemanager.labservices.models.SupportInfo; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LabPlanImpl implements LabPlan, LabPlan.Definition, LabPlan.Update { + private LabPlanInner innerObject; + + private final com.azure.resourcemanager.labservices.LabServicesManager 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ConnectionProfile defaultConnectionProfile() { + return this.innerModel().defaultConnectionProfile(); + } + + public AutoShutdownProfile defaultAutoShutdownProfile() { + return this.innerModel().defaultAutoShutdownProfile(); + } + + public LabPlanNetworkProfile defaultNetworkProfile() { + return this.innerModel().defaultNetworkProfile(); + } + + public List allowedRegions() { + List inner = this.innerModel().allowedRegions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String sharedGalleryId() { + return this.innerModel().sharedGalleryId(); + } + + public SupportInfo supportInfo() { + return this.innerModel().supportInfo(); + } + + public String linkedLmsInstance() { + return this.innerModel().linkedLmsInstance(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public LabPlanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String labPlanName; + + private LabPlanUpdate updateBody; + + public LabPlanImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LabPlan create() { + this.innerObject = + serviceManager + .serviceClient() + .getLabPlans() + .createOrUpdate(resourceGroupName, labPlanName, this.innerModel(), Context.NONE); + return this; + } + + public LabPlan create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLabPlans() + .createOrUpdate(resourceGroupName, labPlanName, this.innerModel(), context); + return this; + } + + LabPlanImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = new LabPlanInner(); + this.serviceManager = serviceManager; + this.labPlanName = name; + } + + public LabPlanImpl update() { + this.updateBody = new LabPlanUpdate(); + return this; + } + + public LabPlan apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLabPlans() + .update(resourceGroupName, labPlanName, updateBody, Context.NONE); + return this; + } + + public LabPlan apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getLabPlans().update(resourceGroupName, labPlanName, updateBody, context); + return this; + } + + LabPlanImpl(LabPlanInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.labPlanName = Utils.getValueFromIdByName(innerObject.id(), "labPlans"); + } + + public LabPlan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLabPlans() + .getByResourceGroupWithResponse(resourceGroupName, labPlanName, Context.NONE) + .getValue(); + return this; + } + + public LabPlan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLabPlans() + .getByResourceGroupWithResponse(resourceGroupName, labPlanName, context) + .getValue(); + return this; + } + + public void saveImage(SaveImageBody body) { + serviceManager.labPlans().saveImage(resourceGroupName, labPlanName, body); + } + + public void saveImage(SaveImageBody body, Context context) { + serviceManager.labPlans().saveImage(resourceGroupName, labPlanName, body, context); + } + + public LabPlanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LabPlanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LabPlanImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public LabPlanImpl withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { + if (isInCreateMode()) { + this.innerModel().withDefaultConnectionProfile(defaultConnectionProfile); + return this; + } else { + this.updateBody.withDefaultConnectionProfile(defaultConnectionProfile); + return this; + } + } + + public LabPlanImpl withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { + if (isInCreateMode()) { + this.innerModel().withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); + return this; + } else { + this.updateBody.withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); + return this; + } + } + + public LabPlanImpl withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { + if (isInCreateMode()) { + this.innerModel().withDefaultNetworkProfile(defaultNetworkProfile); + return this; + } else { + this.updateBody.withDefaultNetworkProfile(defaultNetworkProfile); + return this; + } + } + + public LabPlanImpl withAllowedRegions(List allowedRegions) { + if (isInCreateMode()) { + this.innerModel().withAllowedRegions(allowedRegions); + return this; + } else { + this.updateBody.withAllowedRegions(allowedRegions); + return this; + } + } + + public LabPlanImpl withSharedGalleryId(String sharedGalleryId) { + if (isInCreateMode()) { + this.innerModel().withSharedGalleryId(sharedGalleryId); + return this; + } else { + this.updateBody.withSharedGalleryId(sharedGalleryId); + return this; + } + } + + public LabPlanImpl withSupportInfo(SupportInfo supportInfo) { + if (isInCreateMode()) { + this.innerModel().withSupportInfo(supportInfo); + return this; + } else { + this.updateBody.withSupportInfo(supportInfo); + return this; + } + } + + public LabPlanImpl withLinkedLmsInstance(String linkedLmsInstance) { + if (isInCreateMode()) { + this.innerModel().withLinkedLmsInstance(linkedLmsInstance); + return this; + } else { + this.updateBody.withLinkedLmsInstance(linkedLmsInstance); + return this; + } + } + + public LabPlanImpl withTags(List tags) { + this.updateBody.withTags(tags); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansClientImpl.java similarity index 53% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountsClientImpl.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansClientImpl.java index 0c3b1b3e64241..f46e03e890559 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabAccountsClientImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansClientImpl.java @@ -34,168 +34,143 @@ 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.labservices.fluent.LabAccountsClient; -import com.azure.resourcemanager.labservices.fluent.models.GetRegionalAvailabilityResponseInner; -import com.azure.resourcemanager.labservices.fluent.models.LabAccountInner; -import com.azure.resourcemanager.labservices.models.CreateLabProperties; -import com.azure.resourcemanager.labservices.models.LabAccountFragment; -import com.azure.resourcemanager.labservices.models.ResponseWithContinuationLabAccount; +import com.azure.resourcemanager.labservices.fluent.LabPlansClient; +import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; +import com.azure.resourcemanager.labservices.models.LabPlanUpdate; +import com.azure.resourcemanager.labservices.models.PagedLabPlans; +import com.azure.resourcemanager.labservices.models.SaveImageBody; 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 LabAccountsClient. */ -public final class LabAccountsClientImpl implements LabAccountsClient { - private final ClientLogger logger = new ClientLogger(LabAccountsClientImpl.class); +/** An instance of this class provides access to all the operations defined in LabPlansClient. */ +public final class LabPlansClientImpl implements LabPlansClient { + private final ClientLogger logger = new ClientLogger(LabPlansClientImpl.class); /** The proxy service used to perform REST calls. */ - private final LabAccountsService service; + private final LabPlansService service; /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; + private final LabServicesClientImpl client; /** - * Initializes an instance of LabAccountsClientImpl. + * Initializes an instance of LabPlansClientImpl. * * @param client the instance of the service client containing this operation class. */ - LabAccountsClientImpl(ManagedLabsClientImpl client) { - this.service = - RestProxy.create(LabAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + LabPlansClientImpl(LabServicesClientImpl client) { + this.service = RestProxy.create(LabPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ManagedLabsClientLabAccounts to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for LabServicesClientLabPlans to be used by the proxy service to perform + * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientLab") - private interface LabAccountsService { + @ServiceInterface(name = "LabServicesClientLab") + private interface LabPlansService { @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labaccounts") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labPlans") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @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.LabServices" - + "/labaccounts") + + "/labPlans") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono> listByResourceGroup( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @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.LabServices" - + "/labaccounts/{labAccountName}") + + "/labPlans/{labPlanName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, + @PathParam("labPlanName") String labPlanName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}") - @ExpectedResponses({200, 201}) + + "/labPlans/{labPlanName}") + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabAccountInner labAccount, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @QueryParam("api-version") String apiVersion, + @PathParam("labPlanName") String labPlanName, + @BodyParam("application/json") LabPlanInner body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}") - @ExpectedResponses({200}) + + "/labPlans/{labPlanName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> update( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabAccountFragment labAccount, + @PathParam("labPlanName") String labPlanName, + @BodyParam("application/json") LabPlanUpdate body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( + @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/createLab") - @ExpectedResponses({200}) + + "/labPlans/{labPlanName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createLab( + Mono>> delete( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CreateLabProperties createLabProperties, + @PathParam("labPlanName") String labPlanName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/getRegionalAvailability") - @ExpectedResponses({200}) + + "/labPlans/{labPlanName}/saveImage") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getRegionalAvailability( + Mono>> saveImage( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @QueryParam("api-version") String apiVersion, + @PathParam("labPlanName") String labPlanName, + @BodyParam("application/json") SaveImageBody body, @HeaderParam("Accept") String accept, Context context); @@ -203,7 +178,7 @@ Mono> getRegionalAvailability( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( + Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -213,7 +188,7 @@ Mono> listBySubscriptionNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -221,20 +196,16 @@ Mono> listByResourceGroupNext( } /** - * List lab accounts in a subscription. + * Returns a list of all lab plans within a subscription. * - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans 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) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -254,15 +225,12 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), - expand, filter, - top, - orderby, - this.client.getApiVersion(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -275,21 +243,17 @@ private Mono> listSinglePageAsync( } /** - * List lab accounts in a subscription. + * Returns a list of all lab plans within a subscription. * - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans 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) { + private Mono> listSinglePageAsync(String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -307,12 +271,9 @@ private Mono> listSinglePageAsync( return service .list( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), - expand, filter, - top, - orderby, - this.client.getApiVersion(), accept, context) .map( @@ -327,114 +288,90 @@ private Mono> listSinglePageAsync( } /** - * List lab accounts in a subscription. + * Returns a list of all lab plans within a subscription. * - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String expand, String filter, Integer top, String orderby) { + private PagedFlux listAsync(String filter) { return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * List lab accounts in a subscription. + * Returns a list of all lab plans within a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String expand = null; + private PagedFlux listAsync() { final String filter = null; - final Integer top = null; - final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * List lab accounts in a subscription. + * Returns a list of all lab plans within a subscription. * - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String expand, String filter, Integer top, String orderby, Context context) { + private PagedFlux listAsync(String filter, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(expand, filter, top, orderby, context), + () -> listSinglePageAsync(filter, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * List lab accounts in a subscription. + * Returns a list of all lab plans within a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String expand = null; + public PagedIterable list() { 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)); } /** - * List lab accounts in a subscription. + * Returns a list of all lab plans within a subscription. * - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @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, Context context) { + return new PagedIterable<>(listAsync(filter, context)); } /** - * List lab accounts in a resource group. + * Returns a list of all lab plans for a subscription and resource group. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans 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) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -458,16 +395,12 @@ private Mono> listByResourceGroupSinglePageAsync( service .listByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - expand, - filter, - top, - orderby, - this.client.getApiVersion(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -480,22 +413,18 @@ private Mono> listByResourceGroupSinglePageAsync( } /** - * List lab accounts in a resource group. + * Returns a list of all lab plans for a subscription and resource group. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans 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) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -517,13 +446,9 @@ private Mono> listByResourceGroupSinglePageAsync( return service .listByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - expand, - filter, - top, - orderby, - this.client.getApiVersion(), accept, context) .map( @@ -538,120 +463,82 @@ private Mono> listByResourceGroupSinglePageAsync( } /** - * List lab accounts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List lab accounts in a resource group. + * Returns a list of all lab plans for a subscription and resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @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; + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * List lab accounts in a resource group. + * Returns a list of all lab plans for a subscription and resource group. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby, context), + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * List lab accounts in a resource group. + * Returns a list of all lab plans for a subscription and resource group. * - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @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)); + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * List lab accounts in a resource group. + * Returns a list of all lab plans for a subscription and resource group. * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans. */ @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)); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Get lab account. + * Retrieves the properties of a Lab Plan. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String labAccountName, String expand) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String labPlanName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -668,8 +555,8 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil @@ -678,31 +565,31 @@ private Mono> getByResourceGroupWithResponseAsync( service .getByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - expand, - this.client.getApiVersion(), + labPlanName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get lab account. + * Retrieves the properties of a Lab Plan. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String labAccountName, String expand, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String labPlanName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -719,64 +606,39 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - expand, - this.client.getApiVersion(), + labPlanName, accept, context); } /** - * Get lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String labAccountName, String expand) { - return getByResourceGroupWithResponseAsync(resourceGroupName, labAccountName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get lab account. + * Retrieves the properties of a Lab Plan. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String labAccountName) { - final String expand = null; - return getByResourceGroupWithResponseAsync(resourceGroupName, labAccountName, expand) + private Mono getByResourceGroupAsync(String resourceGroupName, String labPlanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, labPlanName) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -786,53 +648,55 @@ private Mono getByResourceGroupAsync(String resourceGroupName, } /** - * Get lab account. + * Retrieves the properties of a Lab Plan. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabAccountInner getByResourceGroup(String resourceGroupName, String labAccountName) { - final String expand = null; - return getByResourceGroupAsync(resourceGroupName, labAccountName, expand).block(); + public LabPlanInner getByResourceGroup(String resourceGroupName, String labPlanName) { + return getByResourceGroupAsync(resourceGroupName, labPlanName).block(); } /** - * Get lab account. + * Retrieves the properties of a Lab Plan. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String labAccountName, String expand, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, labAccountName, expand, context).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String labPlanName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, labPlanName, context).block(); } /** - * Create or replace an existing Lab Account. + * Operation to create or update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labAccountName, LabAccountInner labAccount) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labPlanName, LabPlanInner body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -849,13 +713,13 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } - if (labAccount == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccount is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - labAccount.validate(); + body.validate(); } final String accept = "application/json"; return FluxUtil @@ -864,31 +728,33 @@ private Mono> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), - labAccount, + labPlanName, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or replace an existing Lab Account. + * Operation to create or update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labAccountName, LabAccountInner labAccount, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -905,99 +771,210 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } - if (labAccount == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccount is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - labAccount.validate(); + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), - labAccount, + labPlanName, + body, accept, context); } /** - * Create or replace an existing Lab Account. + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabPlanInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labPlanName, LabPlanInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, this.client.getContext()); + } + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabPlanInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labPlanName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, context); + } + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabPlanInner> beginCreateOrUpdate( + String resourceGroupName, String labPlanName, LabPlanInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body).getSyncPoller(); + } + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabPlanInner> beginCreateOrUpdate( + String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body, context).getSyncPoller(); + } + + /** + * Operation to create or update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labAccountName, LabAccountInner labAccount) { - return createOrUpdateWithResponseAsync(resourceGroupName, labAccountName, labAccount) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono createOrUpdateAsync(String resourceGroupName, String labPlanName, LabPlanInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to create or update a Lab Plan resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Plans act as a permission container for creating labs via labs.azure.com on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labPlanName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or replace an existing Lab Account. + * Operation to create or update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabAccountInner createOrUpdate(String resourceGroupName, String labAccountName, LabAccountInner labAccount) { - return createOrUpdateAsync(resourceGroupName, labAccountName, labAccount).block(); + public LabPlanInner createOrUpdate(String resourceGroupName, String labPlanName, LabPlanInner body) { + return createOrUpdateAsync(resourceGroupName, labPlanName, body).block(); } /** - * Create or replace an existing Lab Account. + * Operation to create or update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return lab Plans act as a permission container for creating labs via labs.azure.com. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String labAccountName, LabAccountInner labAccount, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labAccountName, labAccount, context).block(); + public LabPlanInner createOrUpdate( + String resourceGroupName, String labPlanName, LabPlanInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, labPlanName, body, context).block(); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String labAccountName) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String labPlanName, LabPlanUpdate body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1014,39 +991,48 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), + labPlanName, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labAccountName, Context context) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1063,171 +1049,206 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), + labPlanName, + body, accept, context); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labAccountName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labAccountName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabPlanInner> beginUpdateAsync( + String resourceGroupName, String labPlanName, LabPlanUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, labPlanName, body); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, this.client.getContext()); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labAccountName, Context context) { + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabPlanInner> beginUpdateAsync( + String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labAccountName, context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, labPlanName, body, context); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + .getLroResult( + mono, this.client.getHttpPipeline(), LabPlanInner.class, LabPlanInner.class, context); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String labAccountName) { - return beginDeleteAsync(resourceGroupName, labAccountName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabPlanInner> beginUpdate( + String resourceGroupName, String labPlanName, LabPlanUpdate body) { + return beginUpdateAsync(resourceGroupName, labPlanName, body).getSyncPoller(); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com along with {@link Response} + * on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabPlanInner> beginUpdate( + String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, labPlanName, body, context).getSyncPoller(); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labAccountName) { - return beginDeleteAsync(resourceGroupName, labAccountName) + private Mono updateAsync(String resourceGroupName, String labPlanName, LabPlanUpdate body) { + return beginUpdateAsync(resourceGroupName, labPlanName, body) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return lab Plans act as a permission container for creating labs via labs.azure.com on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labAccountName, Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, context) + private Mono updateAsync( + String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, labPlanName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Plans act as a permission container for creating labs via labs.azure.com. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labAccountName) { - deleteAsync(resourceGroupName, labAccountName).block(); + public LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body) { + return updateAsync(resourceGroupName, labPlanName, body).block(); } /** - * Delete lab account. This operation can take a while to complete. + * Operation to update a Lab Plan resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Plans act as a permission container for creating labs via labs.azure.com. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labAccountName, Context context) { - deleteAsync(resourceGroupName, labAccountName, context).block(); + public LabPlanInner update(String resourceGroupName, String labPlanName, LabPlanUpdate body, Context context) { + return updateAsync(resourceGroupName, labPlanName, body, context).block(); } /** - * Modify properties of lab accounts. + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labAccountName, LabAccountFragment labAccount) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String labPlanName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1244,46 +1265,41 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labAccount == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccount is required and cannot be null.")); - } else { - labAccount.validate(); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .update( + .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), - labAccount, + labPlanName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Modify properties of lab accounts. + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labAccountName, LabAccountFragment labAccount, Context context) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labPlanName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1300,101 +1316,187 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - if (labAccount == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccount is required and cannot be null.")); - } else { - labAccount.validate(); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .update( + .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), - labAccount, + labPlanName, accept, context); } /** - * Modify properties of lab accounts. + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labPlanName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labPlanName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labPlanName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labPlanName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String labPlanName) { + return beginDeleteAsync(resourceGroupName, labPlanName).getSyncPoller(); + } + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String labPlanName, Context context) { + return beginDeleteAsync(resourceGroupName, labPlanName, context).getSyncPoller(); + } + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 updateAsync( - String resourceGroupName, String labAccountName, LabAccountFragment labAccount) { - return updateWithResponseAsync(resourceGroupName, labAccountName, labAccount) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono deleteAsync(String resourceGroupName, String labPlanName) { + return beginDeleteAsync(resourceGroupName, labPlanName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 labPlanName, Context context) { + return beginDeleteAsync(resourceGroupName, labPlanName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Modify properties of lab accounts. + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabAccountInner update(String resourceGroupName, String labAccountName, LabAccountFragment labAccount) { - return updateAsync(resourceGroupName, labAccountName, labAccount).block(); + public void delete(String resourceGroupName, String labPlanName) { + deleteAsync(resourceGroupName, labPlanName).block(); } /** - * Modify properties of lab accounts. + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labAccount Represents a lab account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String labAccountName, LabAccountFragment labAccount, Context context) { - return updateWithResponseAsync(resourceGroupName, labAccountName, labAccount, context).block(); + public void delete(String resourceGroupName, String labPlanName, Context context) { + deleteAsync(resourceGroupName, labPlanName, context).block(); } /** - * Create a lab in a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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> createLabWithResponseAsync( - String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { + private Mono>> saveImageWithResponseAsync( + String resourceGroupName, String labPlanName, SaveImageBody body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1411,47 +1513,47 @@ private Mono> createLabWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } - if (createLabProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter createLabProperties is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - createLabProperties.validate(); + body.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createLab( + .saveImage( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), - createLabProperties, + labPlanName, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create a lab in a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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> createLabWithResponseAsync( - String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties, Context context) { + private Mono>> saveImageWithResponseAsync( + String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1468,229 +1570,182 @@ private Mono> createLabWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labPlanName == null) { + return Mono.error(new IllegalArgumentException("Parameter labPlanName is required and cannot be null.")); } - if (createLabProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter createLabProperties is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - createLabProperties.validate(); + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createLab( + .saveImage( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - this.client.getApiVersion(), - createLabProperties, + labPlanName, + body, accept, context); } /** - * Create a lab in a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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 createLabAsync( - String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { - return createLabWithResponseAsync(resourceGroupName, labAccountName, createLabProperties) - .flatMap((Response res) -> Mono.empty()); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSaveImageAsync( + String resourceGroupName, String labPlanName, SaveImageBody body) { + Mono>> mono = saveImageWithResponseAsync(resourceGroupName, labPlanName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Create a lab in a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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) - public void createLab(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { - createLabAsync(resourceGroupName, labAccountName, createLabProperties).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSaveImageAsync( + String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + saveImageWithResponseAsync(resourceGroupName, labPlanName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Create a lab in a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createLabWithResponse( - String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties, Context context) { - return createLabWithResponseAsync(resourceGroupName, labAccountName, createLabProperties, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSaveImage( + String resourceGroupName, String labPlanName, SaveImageBody body) { + return beginSaveImageAsync(resourceGroupName, labPlanName, body).getSyncPoller(); } /** - * Get regional availability information for each size category configured under a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRegionalAvailabilityWithResponseAsync( - String resourceGroupName, String labAccountName) { - 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getRegionalAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSaveImage( + String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { + return beginSaveImageAsync(resourceGroupName, labPlanName, body, context).getSyncPoller(); } /** - * Get regional availability information for each size category configured under a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRegionalAvailabilityWithResponseAsync( - String resourceGroupName, String labAccountName, 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 (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getRegionalAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - this.client.getApiVersion(), - accept, - context); + private Mono saveImageAsync(String resourceGroupName, String labPlanName, SaveImageBody body) { + return beginSaveImageAsync(resourceGroupName, labPlanName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get regional availability information for each size category configured under a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getRegionalAvailabilityAsync( - String resourceGroupName, String labAccountName) { - return getRegionalAvailabilityWithResponseAsync(resourceGroupName, labAccountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono saveImageAsync( + String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { + return beginSaveImageAsync(resourceGroupName, labPlanName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get regional availability information for each size category configured under a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GetRegionalAvailabilityResponseInner getRegionalAvailability( - String resourceGroupName, String labAccountName) { - return getRegionalAvailabilityAsync(resourceGroupName, labAccountName).block(); + public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body) { + saveImageAsync(resourceGroupName, labPlanName, body).block(); } /** - * Get regional availability information for each size category configured under a lab account. + * Saves an image from a lab VM to the attached shared image gallery. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRegionalAvailabilityWithResponse( - String resourceGroupName, String labAccountName, Context context) { - return getRegionalAvailabilityWithResponseAsync(resourceGroupName, labAccountName, context).block(); + public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { + saveImageAsync(resourceGroupName, labPlanName, body, context).block(); } /** @@ -1700,10 +1755,10 @@ public Response getRegionalAvailabilityWit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1717,7 +1772,7 @@ private Mono> listBySubscriptionNextSinglePageAsy return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1737,11 +1792,10 @@ private Mono> listBySubscriptionNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1773,10 +1827,10 @@ private Mono> listBySubscriptionNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1790,7 +1844,7 @@ private Mono> listByResourceGroupNextSinglePageAs return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1810,11 +1864,10 @@ private Mono> listByResourceGroupNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of lab plans along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansImpl.java new file mode 100644 index 0000000000000..ee6f8bd4a1d4b --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabPlansImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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.labservices.fluent.LabPlansClient; +import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; +import com.azure.resourcemanager.labservices.models.LabPlan; +import com.azure.resourcemanager.labservices.models.LabPlans; +import com.azure.resourcemanager.labservices.models.SaveImageBody; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LabPlansImpl implements LabPlans { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlansImpl.class); + + private final LabPlansClient innerClient; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + public LabPlansImpl( + LabPlansClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LabPlanImpl(inner1, this.manager())); + } + + public LabPlan getByResourceGroup(String resourceGroupName, String labPlanName) { + LabPlanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, labPlanName); + if (inner != null) { + return new LabPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String labPlanName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, labPlanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LabPlanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String labPlanName) { + this.serviceClient().delete(resourceGroupName, labPlanName); + } + + public void delete(String resourceGroupName, String labPlanName, Context context) { + this.serviceClient().delete(resourceGroupName, labPlanName, context); + } + + public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body) { + this.serviceClient().saveImage(resourceGroupName, labPlanName, body); + } + + public void saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context) { + this.serviceClient().saveImage(resourceGroupName, labPlanName, body, context); + } + + public LabPlan 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 labPlanName = Utils.getValueFromIdByName(id, "labPlans"); + if (labPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, labPlanName, 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 labPlanName = Utils.getValueFromIdByName(id, "labPlans"); + if (labPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, labPlanName, 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 labPlanName = Utils.getValueFromIdByName(id, "labPlans"); + if (labPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); + } + this.delete(resourceGroupName, labPlanName, 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 labPlanName = Utils.getValueFromIdByName(id, "labPlans"); + if (labPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'labPlans'.", id))); + } + this.delete(resourceGroupName, labPlanName, context); + } + + private LabPlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } + + public LabPlanImpl define(String name) { + return new LabPlanImpl(name, this.manager()); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ManagedLabsClientBuilder.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientBuilder.java similarity index 74% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ManagedLabsClientBuilder.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientBuilder.java index 38ec53b9cc258..6459a4b3ec061 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ManagedLabsClientBuilder.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientBuilder.java @@ -15,21 +15,21 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the ManagedLabsClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ManagedLabsClientImpl.class}) -public final class ManagedLabsClientBuilder { +/** A builder for creating a new instance of the LabServicesClientImpl type. */ +@ServiceClientBuilder(serviceClients = {LabServicesClientImpl.class}) +public final class LabServicesClientBuilder { /* - * The subscription ID. + * The ID of the target subscription. */ private String subscriptionId; /** - * Sets The subscription ID. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. - * @return the ManagedLabsClientBuilder. + * @return the LabServicesClientBuilder. */ - public ManagedLabsClientBuilder subscriptionId(String subscriptionId) { + public LabServicesClientBuilder subscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } @@ -43,9 +43,9 @@ public ManagedLabsClientBuilder subscriptionId(String subscriptionId) { * Sets server parameter. * * @param endpoint the endpoint value. - * @return the ManagedLabsClientBuilder. + * @return the LabServicesClientBuilder. */ - public ManagedLabsClientBuilder endpoint(String endpoint) { + public LabServicesClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -59,9 +59,9 @@ public ManagedLabsClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the ManagedLabsClientBuilder. + * @return the LabServicesClientBuilder. */ - public ManagedLabsClientBuilder environment(AzureEnvironment environment) { + public LabServicesClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -75,9 +75,9 @@ public ManagedLabsClientBuilder environment(AzureEnvironment environment) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the ManagedLabsClientBuilder. + * @return the LabServicesClientBuilder. */ - public ManagedLabsClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public LabServicesClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -91,9 +91,9 @@ public ManagedLabsClientBuilder defaultPollInterval(Duration defaultPollInterval * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the ManagedLabsClientBuilder. + * @return the LabServicesClientBuilder. */ - public ManagedLabsClientBuilder pipeline(HttpPipeline pipeline) { + public LabServicesClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -107,19 +107,19 @@ public ManagedLabsClientBuilder pipeline(HttpPipeline pipeline) { * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the ManagedLabsClientBuilder. + * @return the LabServicesClientBuilder. */ - public ManagedLabsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public LabServicesClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of ManagedLabsClientImpl with the provided parameters. + * Builds an instance of LabServicesClientImpl with the provided parameters. * - * @return an instance of ManagedLabsClientImpl. + * @return an instance of LabServicesClientImpl. */ - public ManagedLabsClientImpl buildClient() { + public LabServicesClientImpl buildClient() { if (endpoint == null) { this.endpoint = "https://management.azure.com"; } @@ -138,8 +138,8 @@ public ManagedLabsClientImpl buildClient() { if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } - ManagedLabsClientImpl client = - new ManagedLabsClientImpl( + LabServicesClientImpl client = + new LabServicesClientImpl( pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); return client; } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ManagedLabsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientImpl.java similarity index 74% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ManagedLabsClientImpl.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientImpl.java index f0e8d53d0fa1b..fdfdc83df2205 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ManagedLabsClientImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesClientImpl.java @@ -21,16 +21,17 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.labservices.fluent.EnvironmentSettingsClient; -import com.azure.resourcemanager.labservices.fluent.EnvironmentsClient; -import com.azure.resourcemanager.labservices.fluent.GalleryImagesClient; -import com.azure.resourcemanager.labservices.fluent.GlobalUsersClient; -import com.azure.resourcemanager.labservices.fluent.LabAccountsClient; +import com.azure.resourcemanager.labservices.fluent.ImagesClient; +import com.azure.resourcemanager.labservices.fluent.LabPlansClient; +import com.azure.resourcemanager.labservices.fluent.LabServicesClient; import com.azure.resourcemanager.labservices.fluent.LabsClient; -import com.azure.resourcemanager.labservices.fluent.ManagedLabsClient; +import com.azure.resourcemanager.labservices.fluent.OperationResultsClient; import com.azure.resourcemanager.labservices.fluent.OperationsClient; -import com.azure.resourcemanager.labservices.fluent.ProviderOperationsClient; +import com.azure.resourcemanager.labservices.fluent.SchedulesClient; +import com.azure.resourcemanager.labservices.fluent.SkusClient; +import com.azure.resourcemanager.labservices.fluent.UsagesClient; import com.azure.resourcemanager.labservices.fluent.UsersClient; +import com.azure.resourcemanager.labservices.fluent.VirtualMachinesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -41,16 +42,16 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the ManagedLabsClientImpl type. */ -@ServiceClient(builder = ManagedLabsClientBuilder.class) -public final class ManagedLabsClientImpl implements ManagedLabsClient { - private final ClientLogger logger = new ClientLogger(ManagedLabsClientImpl.class); +/** Initializes a new instance of the LabServicesClientImpl type. */ +@ServiceClient(builder = LabServicesClientBuilder.class) +public final class LabServicesClientImpl implements LabServicesClient { + private final ClientLogger logger = new ClientLogger(LabServicesClientImpl.class); - /** The subscription ID. */ + /** The ID of the target subscription. */ private final String subscriptionId; /** - * Gets The subscription ID. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -118,40 +119,28 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The ProviderOperationsClient object to access its operations. */ - private final ProviderOperationsClient providerOperations; + /** The ImagesClient object to access its operations. */ + private final ImagesClient images; /** - * Gets the ProviderOperationsClient object to access its operations. + * Gets the ImagesClient object to access its operations. * - * @return the ProviderOperationsClient object. + * @return the ImagesClient object. */ - public ProviderOperationsClient getProviderOperations() { - return this.providerOperations; + public ImagesClient getImages() { + return this.images; } - /** The GlobalUsersClient object to access its operations. */ - private final GlobalUsersClient globalUsers; + /** The LabPlansClient object to access its operations. */ + private final LabPlansClient labPlans; /** - * Gets the GlobalUsersClient object to access its operations. + * Gets the LabPlansClient object to access its operations. * - * @return the GlobalUsersClient object. + * @return the LabPlansClient object. */ - public GlobalUsersClient getGlobalUsers() { - return this.globalUsers; - } - - /** The LabAccountsClient object to access its operations. */ - private final LabAccountsClient labAccounts; - - /** - * Gets the LabAccountsClient object to access its operations. - * - * @return the LabAccountsClient object. - */ - public LabAccountsClient getLabAccounts() { - return this.labAccounts; + public LabPlansClient getLabPlans() { + return this.labPlans; } /** The OperationsClient object to access its operations. */ @@ -166,18 +155,6 @@ public OperationsClient getOperations() { return this.operations; } - /** The GalleryImagesClient object to access its operations. */ - private final GalleryImagesClient galleryImages; - - /** - * Gets the GalleryImagesClient object to access its operations. - * - * @return the GalleryImagesClient object. - */ - public GalleryImagesClient getGalleryImages() { - return this.galleryImages; - } - /** The LabsClient object to access its operations. */ private final LabsClient labs; @@ -190,28 +167,28 @@ public LabsClient getLabs() { return this.labs; } - /** The EnvironmentSettingsClient object to access its operations. */ - private final EnvironmentSettingsClient environmentSettings; + /** The OperationResultsClient object to access its operations. */ + private final OperationResultsClient operationResults; /** - * Gets the EnvironmentSettingsClient object to access its operations. + * Gets the OperationResultsClient object to access its operations. * - * @return the EnvironmentSettingsClient object. + * @return the OperationResultsClient object. */ - public EnvironmentSettingsClient getEnvironmentSettings() { - return this.environmentSettings; + public OperationResultsClient getOperationResults() { + return this.operationResults; } - /** The EnvironmentsClient object to access its operations. */ - private final EnvironmentsClient environments; + /** The SchedulesClient object to access its operations. */ + private final SchedulesClient schedules; /** - * Gets the EnvironmentsClient object to access its operations. + * Gets the SchedulesClient object to access its operations. * - * @return the EnvironmentsClient object. + * @return the SchedulesClient object. */ - public EnvironmentsClient getEnvironments() { - return this.environments; + public SchedulesClient getSchedules() { + return this.schedules; } /** The UsersClient object to access its operations. */ @@ -226,17 +203,53 @@ public UsersClient getUsers() { return this.users; } + /** The VirtualMachinesClient object to access its operations. */ + private final VirtualMachinesClient virtualMachines; + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + public VirtualMachinesClient getVirtualMachines() { + return this.virtualMachines; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + /** - * Initializes an instance of ManagedLabsClient client. + * Initializes an instance of LabServicesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The subscription ID. + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - ManagedLabsClientImpl( + LabServicesClientImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, @@ -248,16 +261,17 @@ public UsersClient getUsers() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-10-15"; - this.providerOperations = new ProviderOperationsClientImpl(this); - this.globalUsers = new GlobalUsersClientImpl(this); - this.labAccounts = new LabAccountsClientImpl(this); + this.apiVersion = "2021-11-15-preview"; + this.images = new ImagesClientImpl(this); + this.labPlans = new LabPlansClientImpl(this); this.operations = new OperationsClientImpl(this); - this.galleryImages = new GalleryImagesClientImpl(this); this.labs = new LabsClientImpl(this); - this.environmentSettings = new EnvironmentSettingsClientImpl(this); - this.environments = new EnvironmentsClientImpl(this); + this.operationResults = new OperationResultsClientImpl(this); + this.schedules = new SchedulesClientImpl(this); this.users = new UsersClientImpl(this); + this.virtualMachines = new VirtualMachinesClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.skus = new SkusClientImpl(this); } /** diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesSkuImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesSkuImpl.java new file mode 100644 index 0000000000000..714b6f286c75f --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabServicesSkuImpl.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; +import com.azure.resourcemanager.labservices.models.LabServicesSku; +import com.azure.resourcemanager.labservices.models.LabServicesSkuCapabilities; +import com.azure.resourcemanager.labservices.models.LabServicesSkuCapacity; +import com.azure.resourcemanager.labservices.models.LabServicesSkuCost; +import com.azure.resourcemanager.labservices.models.LabServicesSkuRestrictions; +import com.azure.resourcemanager.labservices.models.LabServicesSkuTier; +import java.util.Collections; +import java.util.List; + +public final class LabServicesSkuImpl implements LabServicesSku { + private LabServicesSkuInner innerObject; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + LabServicesSkuImpl( + LabServicesSkuInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public LabServicesSkuTier tier() { + return this.innerModel().tier(); + } + + public String size() { + return this.innerModel().size(); + } + + public String family() { + return this.innerModel().family(); + } + + public LabServicesSkuCapacity capacity() { + return this.innerModel().capacity(); + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List costs() { + List inner = this.innerModel().costs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public LabServicesSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsClientImpl.java index 3e7d57f587491..a2fefb18bc2d9 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsClientImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsClientImpl.java @@ -36,9 +36,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.labservices.fluent.LabsClient; import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.AddUsersPayload; -import com.azure.resourcemanager.labservices.models.LabFragment; -import com.azure.resourcemanager.labservices.models.ResponseWithContinuationLab; +import com.azure.resourcemanager.labservices.models.LabUpdate; +import com.azure.resourcemanager.labservices.models.PagedLabs; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -51,141 +50,138 @@ public final class LabsClientImpl implements LabsClient { private final LabsService service; /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; + private final LabServicesClientImpl client; /** * Initializes an instance of LabsClientImpl. * * @param client the instance of the service client containing this operation class. */ - LabsClientImpl(ManagedLabsClientImpl client) { + LabsClientImpl(LabServicesClientImpl client) { this.service = RestProxy.create(LabsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ManagedLabsClientLabs to be used by the proxy service to perform REST + * The interface defining all the services for LabServicesClientLabs to be used by the proxy service to perform REST * calls. */ @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientLab") + @ServiceInterface(name = "LabServicesClientLab") private interface LabsService { @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labs") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @QueryParam("$expand") String expand, @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$orderby") String orderby, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, - @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.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}") - @ExpectedResponses({200, 201}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}") + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabInner lab, + @BodyParam("application/json") LabInner body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}") - @ExpectedResponses({202, 204}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( + Mono>> update( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, - @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LabUpdate body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}") - @ExpectedResponses({200}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> delete( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LabFragment lab, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/addUsers") - @ExpectedResponses({200}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/publish") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> addUsers( + Mono>> publish( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AddUsersPayload addUsersPayload, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/register") - @ExpectedResponses({200}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/syncGroup") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> register( + Mono>> syncGroup( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -193,7 +189,17 @@ Mono> register( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -201,22 +207,16 @@ Mono> listNext( } /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String labAccountName, String expand, String filter, Integer top, String orderby) { + private Mono> listSinglePageAsync(String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -229,13 +229,6 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -243,14 +236,9 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - expand, filter, - top, - orderby, - this.client.getApiVersion(), accept, context)) .>map( @@ -266,29 +254,17 @@ private Mono> listSinglePageAsync( } /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + private Mono> listSinglePageAsync(String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -301,26 +277,14 @@ private Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, - labAccountName, - expand, filter, - top, - orderby, - this.client.getApiVersion(), accept, context) .map( @@ -335,138 +299,90 @@ private Mono> listSinglePageAsync( } /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String labAccountName, String expand, String filter, Integer top, String orderby) { + private PagedFlux listAsync(String filter) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labAccountName) { - final String expand = null; + private PagedFlux listAsync() { final String filter = null; - final Integer top = null; - final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + private PagedFlux listAsync(String filter, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(filter, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labAccountName) { - final String expand = null; + public PagedIterable list() { final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labAccountName, expand, filter, top, orderby)); + return new PagedIterable<>(listAsync(filter)); } /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labAccountName, expand, filter, top, orderby, context)); + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); } /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String expand) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -483,46 +399,43 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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 - .get( + .listByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - labName, - expand, - 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())); } /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String expand, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -539,128 +452,102 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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 - .get( + .listByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - labName, - expand, - this.client.getApiVersion(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labAccountName, String labName, String expand) { - return getWithResponseAsync(resourceGroupName, labAccountName, labName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labAccountName, String labName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labAccountName, labName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner get(String resourceGroupName, String labAccountName, String labName) { - final String expand = null; - return getAsync(resourceGroupName, labAccountName, labName, expand).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Get lab. + * Returns a list of all labs in a resource group. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lab. + * @return paged list of labs. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String labAccountName, String labName, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labAccountName, labName, expand, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Create or replace an existing Lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, LabInner lab) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String labName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -677,51 +564,40 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); - } else { - lab.validate(); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createOrUpdate( + .getByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), - lab, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or replace an existing Lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, LabInner lab, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String labName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -738,48 +614,36 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); - } else { - lab.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .getByResourceGroup( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), - lab, accept, context); } /** - * Create or replace an existing Lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labAccountName, String labName, LabInner lab) { - return createOrUpdateWithResponseAsync(resourceGroupName, labAccountName, labName, lab) + private Mono getByResourceGroupAsync(String resourceGroupName, String labName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, labName) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -791,55 +655,54 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing Lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, LabInner lab) { - return createOrUpdateAsync(resourceGroupName, labAccountName, labName, lab).block(); + public LabInner getByResourceGroup(String resourceGroupName, String labName) { + return getByResourceGroupAsync(resourceGroupName, labName).block(); } /** - * Create or replace an existing Lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String labAccountName, String labName, LabInner lab, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labAccountName, labName, lab, context).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String labName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, labName, context).block(); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labAccountName, String labName) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, LabInner body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -856,44 +719,47 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .createOrUpdate( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, LabInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -910,187 +776,202 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .createOrUpdate( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), + body, accept, context); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labAccountName, String labName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, labAccountName, labName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, LabInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, labName, body); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, this.client.getContext()); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labAccountName, String labName, Context context) { + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, LabInner body, Context context) { context = this.client.mergeContext(context); Mono>> mono = - deleteWithResponseAsync(resourceGroupName, labAccountName, labName, context); + createOrUpdateWithResponseAsync(resourceGroupName, labName, body, context); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + .getLroResult( + mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, context); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabInner> beginCreateOrUpdate( + String resourceGroupName, String labName, LabInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, body).getSyncPoller(); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabInner> beginCreateOrUpdate( + String resourceGroupName, String labName, LabInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, body, context).getSyncPoller(); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labAccountName, String labName) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName) + private Mono createOrUpdateAsync(String resourceGroupName, String labName, LabInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, body) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the lab resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labAccountName, String labName, Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, context) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, LabInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labAccountName, String labName) { - deleteAsync(resourceGroupName, labAccountName, labName).block(); + public LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body) { + return createOrUpdateAsync(resourceGroupName, labName, body).block(); } /** - * Delete lab. This operation can take a while to complete. + * Operation to create or update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labAccountName, String labName, Context context) { - deleteAsync(resourceGroupName, labAccountName, labName, context).block(); + public LabInner createOrUpdate(String resourceGroupName, String labName, LabInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, labName, body, context).block(); } /** - * Modify properties of labs. + * Operation to update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, LabFragment lab) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String labName, LabUpdate body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1107,16 +988,13 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - lab.validate(); + body.validate(); } final String accept = "application/json"; return FluxUtil @@ -1125,33 +1003,32 @@ private Mono> updateWithResponseAsync( service .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), - lab, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Modify properties of labs. + * Operation to update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, LabFragment lab, Context context) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String labName, LabUpdate body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1168,109 +1045,196 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (lab == null) { - return Mono.error(new IllegalArgumentException("Parameter lab is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - lab.validate(); + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), - lab, + body, accept, context); } /** - * Modify properties of labs. + * Operation to update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabInner> beginUpdateAsync( + String resourceGroupName, String labName, LabUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, labName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, this.client.getContext()); + } + + /** + * Operation to update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LabInner> beginUpdateAsync( + String resourceGroupName, String labName, LabUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, labName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LabInner.class, LabInner.class, context); + } + + /** + * Operation to update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabInner> beginUpdate( + String resourceGroupName, String labName, LabUpdate body) { + return beginUpdateAsync(resourceGroupName, labName, body).getSyncPoller(); + } + + /** + * Operation to update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LabInner> beginUpdate( + String resourceGroupName, String labName, LabUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, labName, body, context).getSyncPoller(); + } + + /** + * Operation to update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String labAccountName, String labName, LabFragment lab) { - return updateWithResponseAsync(resourceGroupName, labAccountName, labName, lab) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono updateAsync(String resourceGroupName, String labName, LabUpdate body) { + return beginUpdateAsync(resourceGroupName, labName, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the lab resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String labName, LabUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, labName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Modify properties of labs. + * Operation to update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public LabInner update(String resourceGroupName, String labAccountName, String labName, LabFragment lab) { - return updateAsync(resourceGroupName, labAccountName, labName, lab).block(); + public LabInner update(String resourceGroupName, String labName, LabUpdate body) { + return updateAsync(resourceGroupName, labName, body).block(); } /** - * Modify properties of labs. + * Operation to update a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param lab Represents a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a lab. + * @return the lab resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String labAccountName, String labName, LabFragment lab, Context context) { - return updateWithResponseAsync(resourceGroupName, labAccountName, labName, lab, context).block(); + public LabInner update(String resourceGroupName, String labName, LabUpdate body, Context context) { + return updateAsync(resourceGroupName, labName, body, context).block(); } /** - * Add users to a lab. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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> addUsersWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, AddUsersPayload addUsersPayload) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String labName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1287,56 +1251,40 @@ private Mono> addUsersWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (addUsersPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter addUsersPayload is required and cannot be null.")); - } else { - addUsersPayload.validate(); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .addUsers( + .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), - addUsersPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Add users to a lab. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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> addUsersWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - AddUsersPayload addUsersPayload, - Context context) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1353,110 +1301,180 @@ private Mono> addUsersWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (addUsersPayload == null) { - return Mono - .error(new IllegalArgumentException("Parameter addUsersPayload is required and cannot be null.")); - } else { - addUsersPayload.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .addUsers( + .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), - addUsersPayload, accept, context); } /** - * Add users to a lab. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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 addUsersAsync( - String resourceGroupName, String labAccountName, String labName, AddUsersPayload addUsersPayload) { - return addUsersWithResponseAsync(resourceGroupName, labAccountName, labName, addUsersPayload) - .flatMap((Response res) -> Mono.empty()); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String labName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Add users to a lab. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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) - public void addUsers( - String resourceGroupName, String labAccountName, String labName, AddUsersPayload addUsersPayload) { - addUsersAsync(resourceGroupName, labAccountName, labName, addUsersPayload).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Add users to a lab. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addUsersWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - AddUsersPayload addUsersPayload, - Context context) { - return addUsersWithResponseAsync(resourceGroupName, labAccountName, labName, addUsersPayload, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName) { + return beginDeleteAsync(resourceGroupName, labName).getSyncPoller(); } /** - * Register to managed lab. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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> registerWithResponseAsync( - String resourceGroupName, String labAccountName, String labName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, Context context) { + return beginDeleteAsync(resourceGroupName, labName, context).getSyncPoller(); + } + + /** + * Operation to delete a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return beginDeleteAsync(resourceGroupName, labName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return beginDeleteAsync(resourceGroupName, labName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, labName).block(); + } + + /** + * Operation to delete a lab resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, Context context) { + deleteAsync(resourceGroupName, labName, context).block(); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> publishWithResponseAsync(String resourceGroupName, String labName) { + 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) { @@ -1469,9 +1487,6 @@ private Mono> registerWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } @@ -1480,33 +1495,32 @@ private Mono> registerWithResponseAsync( .withContext( context -> service - .register( + .publish( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Register to managed lab. + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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> registerWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, Context context) { + private Mono>> publishWithResponseAsync( + String resourceGroupName, String labName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1523,74 +1537,470 @@ private Mono> registerWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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 - .register( + .publish( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, + accept, + context); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync(String resourceGroupName, String labName) { + Mono>> mono = publishWithResponseAsync(resourceGroupName, labName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPublishAsync( + String resourceGroupName, String labName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = publishWithResponseAsync(resourceGroupName, labName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String labName) { + return beginPublishAsync(resourceGroupName, labName).getSyncPoller(); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPublish(String resourceGroupName, String labName, Context context) { + return beginPublishAsync(resourceGroupName, labName, context).getSyncPoller(); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publishAsync(String resourceGroupName, String labName) { + return beginPublishAsync(resourceGroupName, labName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 publishAsync(String resourceGroupName, String labName, Context context) { + return beginPublishAsync(resourceGroupName, labName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publish(String resourceGroupName, String labName) { + publishAsync(resourceGroupName, labName).block(); + } + + /** + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 publish(String resourceGroupName, String labName, Context context) { + publishAsync(resourceGroupName, labName, context).block(); + } + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> syncGroupWithResponseAsync(String resourceGroupName, String labName) { + 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 + .syncGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> syncGroupWithResponseAsync( + String resourceGroupName, String labName, 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 + .syncGroup( + this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, accept, context); } /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSyncGroupAsync(String resourceGroupName, String labName) { + Mono>> mono = syncGroupWithResponseAsync(resourceGroupName, labName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSyncGroupAsync( + String resourceGroupName, String labName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = syncGroupWithResponseAsync(resourceGroupName, labName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSyncGroup(String resourceGroupName, String labName) { + return beginSyncGroupAsync(resourceGroupName, labName).getSyncPoller(); + } + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSyncGroup( + String resourceGroupName, String labName, Context context) { + return beginSyncGroupAsync(resourceGroupName, labName, context).getSyncPoller(); + } + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 syncGroupAsync(String resourceGroupName, String labName) { + return beginSyncGroupAsync(resourceGroupName, labName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action used to manually kick off an AAD group sync job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 syncGroupAsync(String resourceGroupName, String labName, Context context) { + return beginSyncGroupAsync(resourceGroupName, labName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action used to manually kick off an AAD group sync job. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono registerAsync(String resourceGroupName, String labAccountName, String labName) { - return registerWithResponseAsync(resourceGroupName, labAccountName, labName) - .flatMap((Response res) -> Mono.empty()); + public void syncGroup(String resourceGroupName, String labName) { + syncGroupAsync(resourceGroupName, labName).block(); } /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 register(String resourceGroupName, String labAccountName, String labName) { - registerAsync(resourceGroupName, labAccountName, labName).block(); + public void syncGroup(String resourceGroupName, String labName, Context context) { + syncGroupAsync(resourceGroupName, labName, 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 paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Register to managed lab. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response registerWithResponse( - String resourceGroupName, String labAccountName, String labName, Context context) { - return registerWithResponseAsync(resourceGroupName, labAccountName, labName, context).block(); + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** @@ -1600,10 +2010,10 @@ public Response registerWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1615,7 +2025,8 @@ private Mono> listNextSinglePageAsync(String nextLink) { } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1636,10 +2047,10 @@ 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 paged list of labs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1652,7 +2063,7 @@ private Mono> listNextSinglePageAsync(String nextLink, C final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsImpl.java index 794b71043f71c..a84ab0c3d0710 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/LabsImpl.java @@ -11,7 +11,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.labservices.fluent.LabsClient; import com.azure.resourcemanager.labservices.fluent.models.LabInner; -import com.azure.resourcemanager.labservices.models.AddUsersPayload; import com.azure.resourcemanager.labservices.models.Lab; import com.azure.resourcemanager.labservices.models.Labs; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -21,33 +20,35 @@ public final class LabsImpl implements Labs { private final LabsClient innerClient; - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - public LabsImpl(LabsClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + public LabsImpl(LabsClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labAccountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labAccountName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, labAccountName, expand, filter, top, orderby, context); + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); } - public Lab get(String resourceGroupName, String labAccountName, String labName) { - LabInner inner = this.serviceClient().get(resourceGroupName, labAccountName, labName); + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LabImpl(inner1, this.manager())); + } + + public Lab getByResourceGroup(String resourceGroupName, String labName) { + LabInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, labName); if (inner != null) { return new LabImpl(inner, this.manager()); } else { @@ -55,10 +56,9 @@ public Lab get(String resourceGroupName, String labAccountName, String labName) } } - public Response getWithResponse( - String resourceGroupName, String labAccountName, String labName, String expand, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String labName, Context context) { Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labAccountName, labName, expand, context); + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, labName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -70,37 +70,28 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String labAccountName, String labName) { - this.serviceClient().delete(resourceGroupName, labAccountName, labName); + public void deleteByResourceGroup(String resourceGroupName, String labName) { + this.serviceClient().delete(resourceGroupName, labName); } - public void delete(String resourceGroupName, String labAccountName, String labName, Context context) { - this.serviceClient().delete(resourceGroupName, labAccountName, labName, context); + public void delete(String resourceGroupName, String labName, Context context) { + this.serviceClient().delete(resourceGroupName, labName, context); } - public void addUsers( - String resourceGroupName, String labAccountName, String labName, AddUsersPayload addUsersPayload) { - this.serviceClient().addUsers(resourceGroupName, labAccountName, labName, addUsersPayload); + public void publish(String resourceGroupName, String labName) { + this.serviceClient().publish(resourceGroupName, labName); } - public Response addUsersWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - AddUsersPayload addUsersPayload, - Context context) { - return this - .serviceClient() - .addUsersWithResponse(resourceGroupName, labAccountName, labName, addUsersPayload, context); + public void publish(String resourceGroupName, String labName, Context context) { + this.serviceClient().publish(resourceGroupName, labName, context); } - public void register(String resourceGroupName, String labAccountName, String labName) { - this.serviceClient().register(resourceGroupName, labAccountName, labName); + public void syncGroup(String resourceGroupName, String labName) { + this.serviceClient().syncGroup(resourceGroupName, labName); } - public Response registerWithResponse( - String resourceGroupName, String labAccountName, String labName, Context context) { - return this.serviceClient().registerWithResponse(resourceGroupName, labAccountName, labName, context); + public void syncGroup(String resourceGroupName, String labName, Context context) { + this.serviceClient().syncGroup(resourceGroupName, labName, context); } public Lab getById(String id) { @@ -112,13 +103,6 @@ public Lab getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -126,11 +110,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.getWithResponse(resourceGroupName, labAccountName, labName, localExpand, Context.NONE).getValue(); + return this.getByResourceGroupWithResponse(resourceGroupName, labName, 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 @@ -139,13 +122,6 @@ public Response getByIdWithResponse(String id, String expand, Context conte String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -153,7 +129,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.getWithResponse(resourceGroupName, labAccountName, labName, expand, context); + return this.getByResourceGroupWithResponse(resourceGroupName, labName, context); } public void deleteById(String id) { @@ -165,13 +141,6 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -179,7 +148,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - this.delete(resourceGroupName, labAccountName, labName, Context.NONE); + this.delete(resourceGroupName, labName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -191,13 +160,6 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -205,14 +167,14 @@ public void deleteByIdWithResponse(String id, Context context) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id))); } - this.delete(resourceGroupName, labAccountName, labName, context); + this.delete(resourceGroupName, labName, context); } private LabsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { + private com.azure.resourcemanager.labservices.LabServicesManager manager() { return this.serviceManager; } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListEnvironmentsResponseImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListEnvironmentsResponseImpl.java deleted file mode 100644 index dda16ce8bca6d..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListEnvironmentsResponseImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.ListEnvironmentsResponseInner; -import com.azure.resourcemanager.labservices.models.EnvironmentDetails; -import com.azure.resourcemanager.labservices.models.ListEnvironmentsResponse; -import java.util.Collections; -import java.util.List; - -public final class ListEnvironmentsResponseImpl implements ListEnvironmentsResponse { - private ListEnvironmentsResponseInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - ListEnvironmentsResponseImpl( - ListEnvironmentsResponseInner innerObject, - com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List environments() { - List inner = this.innerModel().environments(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ListEnvironmentsResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListLabsResponseImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListLabsResponseImpl.java deleted file mode 100644 index bcd4d99626a7b..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ListLabsResponseImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.ListLabsResponseInner; -import com.azure.resourcemanager.labservices.models.LabDetails; -import com.azure.resourcemanager.labservices.models.ListLabsResponse; -import java.util.Collections; -import java.util.List; - -public final class ListLabsResponseImpl implements ListLabsResponse { - private ListLabsResponseInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - ListLabsResponseImpl( - ListLabsResponseInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List labs() { - List inner = this.innerModel().labs(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ListLabsResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationBatchStatusResponseImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationBatchStatusResponseImpl.java deleted file mode 100644 index 996b741e11c13..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationBatchStatusResponseImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.OperationBatchStatusResponseInner; -import com.azure.resourcemanager.labservices.models.OperationBatchStatusResponse; -import com.azure.resourcemanager.labservices.models.OperationBatchStatusResponseItem; -import java.util.Collections; -import java.util.List; - -public final class OperationBatchStatusResponseImpl implements OperationBatchStatusResponse { - private OperationBatchStatusResponseInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - OperationBatchStatusResponseImpl( - OperationBatchStatusResponseInner innerObject, - com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List items() { - List inner = this.innerModel().items(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OperationBatchStatusResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationImpl.java new file mode 100644 index 0000000000000..a92d06733a31a --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationImpl.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.labservices.implementation; + +import com.azure.resourcemanager.labservices.fluent.models.OperationInner; +import com.azure.resourcemanager.labservices.models.ActionType; +import com.azure.resourcemanager.labservices.models.Operation; +import com.azure.resourcemanager.labservices.models.OperationDisplay; +import com.azure.resourcemanager.labservices.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationMetadataImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationMetadataImpl.java deleted file mode 100644 index 01ffff02a27dd..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationMetadataImpl.java +++ /dev/null @@ -1,37 +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.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.labservices.models.OperationMetadata; -import com.azure.resourcemanager.labservices.models.OperationMetadataDisplay; - -public final class OperationMetadataImpl implements OperationMetadata { - private OperationMetadataInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - OperationMetadataImpl( - OperationMetadataInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public OperationMetadataDisplay display() { - return this.innerModel().display(); - } - - public OperationMetadataInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultImpl.java index 38ad7aded50c2..81bab961368f5 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultImpl.java @@ -4,26 +4,48 @@ package com.azure.resourcemanager.labservices.implementation; +import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; -import com.azure.resourcemanager.labservices.models.OperationError; import com.azure.resourcemanager.labservices.models.OperationResult; +import com.azure.resourcemanager.labservices.models.OperationStatus; +import java.time.OffsetDateTime; public final class OperationResultImpl implements OperationResult { private OperationResultInner innerObject; - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; OperationResultImpl( - OperationResultInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + OperationResultInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String status() { + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationStatus status() { return this.innerModel().status(); } - public OperationError error() { + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Float percentComplete() { + return this.innerModel().percentComplete(); + } + + public ManagementError error() { return this.innerModel().error(); } @@ -31,7 +53,7 @@ public OperationResultInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { + private com.azure.resourcemanager.labservices.LabServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsClientImpl.java new file mode 100644 index 0000000000000..3146f009721d1 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsClientImpl.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.labservices.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.labservices.fluent.OperationResultsClient; +import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationResultsClient. */ +public final class OperationResultsClientImpl implements OperationResultsClient { + private final ClientLogger logger = new ClientLogger(OperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationResultsService service; + + /** The service client containing this operation class. */ + private final LabServicesClientImpl client; + + /** + * Initializes an instance of OperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationResultsClientImpl(LabServicesClientImpl client) { + this.service = + RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LabServicesClientOperationResults to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "LabServicesClientOpe") + private interface OperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/operationResults/{operationResultId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("operationResultId") String operationResultId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / 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 long running operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String operationResultId) { + 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 (operationResultId == null) { + return Mono + .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + operationResultId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a long running operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String operationResultId, 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 (operationResultId == null) { + return Mono + .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + operationResultId, + accept, + context); + } + + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / 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 long running operation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String operationResultId) { + return getWithResponseAsync(operationResultId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / 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 long running operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultInner get(String operationResultId) { + return getAsync(operationResultId).block(); + } + + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a long running operation result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String operationResultId, Context context) { + return getWithResponseAsync(operationResultId, context).block(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsImpl.java new file mode 100644 index 0000000000000..3139788681d79 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationResultsImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +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.labservices.fluent.OperationResultsClient; +import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; +import com.azure.resourcemanager.labservices.models.OperationResult; +import com.azure.resourcemanager.labservices.models.OperationResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationResultsImpl implements OperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultsImpl.class); + + private final OperationResultsClient innerClient; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + public OperationResultsImpl( + OperationResultsClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationResult get(String operationResultId) { + OperationResultInner inner = this.serviceClient().get(operationResultId); + if (inner != null) { + return new OperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String operationResultId, Context context) { + Response inner = this.serviceClient().getWithResponse(operationResultId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationStatusResponseImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationStatusResponseImpl.java deleted file mode 100644 index f6433a511917c..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationStatusResponseImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.implementation; - -import com.azure.resourcemanager.labservices.fluent.models.OperationStatusResponseInner; -import com.azure.resourcemanager.labservices.models.OperationStatusResponse; - -public final class OperationStatusResponseImpl implements OperationStatusResponse { - private OperationStatusResponseInner innerObject; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - OperationStatusResponseImpl( - OperationStatusResponseInner innerObject, - com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String status() { - return this.innerModel().status(); - } - - public OperationStatusResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsClientImpl.java index 84e384c6549c7..d81328e66bc01 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsClientImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsClientImpl.java @@ -16,6 +16,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; @@ -23,7 +27,8 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.labservices.fluent.OperationsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; +import com.azure.resourcemanager.labservices.fluent.models.OperationInner; +import com.azure.resourcemanager.labservices.models.OperationListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ @@ -34,184 +39,235 @@ public final class OperationsClientImpl implements OperationsClient { private final OperationsService service; /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; + private final LabServicesClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(ManagedLabsClientImpl client) { + OperationsClientImpl(LabServicesClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ManagedLabsClientOperations to be used by the proxy service to + * The interface defining all the services for LabServicesClientOperations to be used by the proxy service to * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientOpe") + @ServiceInterface(name = "LabServicesClientOpe") private interface OperationsService { @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{locationName}/operations" - + "/{operationName}") + @Get("/providers/Microsoft.LabServices/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> list( @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, - @PathParam("operationName") String operationName, @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); } /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String operationName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationName == null) { - return Mono.error(new IllegalArgumentException("Parameter operationName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - locationName, - operationName, - this.client.getApiVersion(), - accept, - context)) + context -> service.list(this.client.getEndpoint(), 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())); } /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String operationName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (operationName == null) { - return Mono.error(new IllegalArgumentException("Parameter operationName 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(), - locationName, - operationName, - this.client.getApiVersion(), - accept, - context); + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of all operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String operationName) { - return getWithResponseAsync(locationName, operationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns a list of all operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultInner get(String locationName, String operationName) { - return getAsync(locationName, operationName).block(); + 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 operation. + * Get the next page of items. * - * @param locationName The name of the location. - * @param operationName The name of the operation. + * @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 operation. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String operationName, Context context) { - return getWithResponseAsync(locationName, operationName, context).block(); + 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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsImpl.java index 000df61cf0a4e..3c411f711f877 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/OperationsImpl.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.labservices.implementation; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.labservices.fluent.OperationsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; -import com.azure.resourcemanager.labservices.models.OperationResult; +import com.azure.resourcemanager.labservices.fluent.models.OperationInner; +import com.azure.resourcemanager.labservices.models.Operation; import com.azure.resourcemanager.labservices.models.Operations; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -19,42 +18,29 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + OperationsClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public OperationResult get(String locationName, String operationName) { - OperationResultInner inner = this.serviceClient().get(locationName, operationName); - if (inner != null) { - return new OperationResultImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public Response getWithResponse(String locationName, String operationName, Context context) { - Response inner = - this.serviceClient().getWithResponse(locationName, operationName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OperationResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { + private com.azure.resourcemanager.labservices.LabServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ProviderOperationsImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ProviderOperationsImpl.java deleted file mode 100644 index 23d5ace142bc1..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ProviderOperationsImpl.java +++ /dev/null @@ -1,46 +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.labservices.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.ProviderOperationsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.labservices.models.OperationMetadata; -import com.azure.resourcemanager.labservices.models.ProviderOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ProviderOperationsImpl implements ProviderOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderOperationsImpl.class); - - private final ProviderOperationsClient innerClient; - - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; - - public ProviderOperationsImpl( - ProviderOperationsClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationMetadataImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationMetadataImpl(inner1, this.manager())); - } - - private ProviderOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ScheduleImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ScheduleImpl.java new file mode 100644 index 0000000000000..e1d8c87be63f0 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ScheduleImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import com.azure.resourcemanager.labservices.models.Schedule; +import com.azure.resourcemanager.labservices.models.ScheduleUpdate; +import java.time.OffsetDateTime; + +public final class ScheduleImpl implements Schedule, Schedule.Definition, Schedule.Update { + private ScheduleInner innerObject; + + private final com.azure.resourcemanager.labservices.LabServicesManager 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime startAt() { + return this.innerModel().startAt(); + } + + public OffsetDateTime stopAt() { + return this.innerModel().stopAt(); + } + + public RecurrencePattern recurrencePattern() { + return this.innerModel().recurrencePattern(); + } + + public String timeZoneId() { + return this.innerModel().timeZoneId(); + } + + public String notes() { + return this.innerModel().notes(); + } + + public ScheduleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String labName; + + private String scheduleName; + + private ScheduleUpdate updateBody; + + public ScheduleImpl withExistingLab(String resourceGroupName, String labName) { + this.resourceGroupName = resourceGroupName; + this.labName = labName; + return this; + } + + public Schedule create() { + this.innerObject = + serviceManager + .serviceClient() + .getSchedules() + .createOrUpdateWithResponse(resourceGroupName, labName, scheduleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Schedule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSchedules() + .createOrUpdateWithResponse(resourceGroupName, labName, scheduleName, this.innerModel(), context) + .getValue(); + return this; + } + + ScheduleImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = new ScheduleInner(); + this.serviceManager = serviceManager; + this.scheduleName = name; + } + + public ScheduleImpl update() { + this.updateBody = new ScheduleUpdate(); + return this; + } + + public Schedule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSchedules() + .updateWithResponse(resourceGroupName, labName, scheduleName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public Schedule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSchedules() + .updateWithResponse(resourceGroupName, labName, scheduleName, updateBody, context) + .getValue(); + return this; + } + + ScheduleImpl(ScheduleInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); + this.scheduleName = Utils.getValueFromIdByName(innerObject.id(), "schedules"); + } + + public Schedule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSchedules() + .getWithResponse(resourceGroupName, labName, scheduleName, Context.NONE) + .getValue(); + return this; + } + + public Schedule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSchedules() + .getWithResponse(resourceGroupName, labName, scheduleName, context) + .getValue(); + return this; + } + + public ScheduleImpl withStartAt(OffsetDateTime startAt) { + if (isInCreateMode()) { + this.innerModel().withStartAt(startAt); + return this; + } else { + this.updateBody.withStartAt(startAt); + return this; + } + } + + public ScheduleImpl withStopAt(OffsetDateTime stopAt) { + if (isInCreateMode()) { + this.innerModel().withStopAt(stopAt); + return this; + } else { + this.updateBody.withStopAt(stopAt); + return this; + } + } + + public ScheduleImpl withRecurrencePattern(RecurrencePattern recurrencePattern) { + if (isInCreateMode()) { + this.innerModel().withRecurrencePattern(recurrencePattern); + return this; + } else { + this.updateBody.withRecurrencePattern(recurrencePattern); + return this; + } + } + + public ScheduleImpl withTimeZoneId(String timeZoneId) { + if (isInCreateMode()) { + this.innerModel().withTimeZoneId(timeZoneId); + return this; + } else { + this.updateBody.withTimeZoneId(timeZoneId); + return this; + } + } + + public ScheduleImpl withNotes(String notes) { + if (isInCreateMode()) { + this.innerModel().withNotes(notes); + return this; + } else { + this.updateBody.withNotes(notes); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImagesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesClientImpl.java similarity index 51% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImagesClientImpl.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesClientImpl.java index 98cebea222cbe..e9ef6db0f15e8 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/GalleryImagesClientImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesClientImpl.java @@ -27,126 +27,127 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.GalleryImagesClient; -import com.azure.resourcemanager.labservices.fluent.models.GalleryImageInner; -import com.azure.resourcemanager.labservices.models.GalleryImageFragment; -import com.azure.resourcemanager.labservices.models.ResponseWithContinuationGalleryImage; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.labservices.fluent.SchedulesClient; +import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; +import com.azure.resourcemanager.labservices.models.PagedSchedules; +import com.azure.resourcemanager.labservices.models.ScheduleUpdate; +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 GalleryImagesClient. */ -public final class GalleryImagesClientImpl implements GalleryImagesClient { - private final ClientLogger logger = new ClientLogger(GalleryImagesClientImpl.class); +/** An instance of this class provides access to all the operations defined in SchedulesClient. */ +public final class SchedulesClientImpl implements SchedulesClient { + private final ClientLogger logger = new ClientLogger(SchedulesClientImpl.class); /** The proxy service used to perform REST calls. */ - private final GalleryImagesService service; + private final SchedulesService service; /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; + private final LabServicesClientImpl client; /** - * Initializes an instance of GalleryImagesClientImpl. + * Initializes an instance of SchedulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - GalleryImagesClientImpl(ManagedLabsClientImpl client) { + SchedulesClientImpl(LabServicesClientImpl client) { this.service = - RestProxy.create(GalleryImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + RestProxy.create(SchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ManagedLabsClientGalleryImages to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for LabServicesClientSchedules to be used by the proxy service to perform + * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientGal") - private interface GalleryImagesService { + @ServiceInterface(name = "LabServicesClientSch") + private interface SchedulesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/galleryimages") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/schedules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> listByLab( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @QueryParam("$expand") String expand, + @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.LabServices" - + "/labaccounts/{labAccountName}/galleryimages/{galleryImageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/schedules/{scheduleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> get( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, + @PathParam("labName") String labName, + @PathParam("scheduleName") String scheduleName, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/galleryimages/{galleryImageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/schedules/{scheduleName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono> createOrUpdate( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageInner galleryImage, + @PathParam("labName") String labName, + @PathParam("scheduleName") String scheduleName, + @BodyParam("application/json") ScheduleInner body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/galleryimages/{galleryImageName}") - @ExpectedResponses({200, 204}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/schedules/{scheduleName}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono> update( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, + @PathParam("labName") String labName, + @PathParam("scheduleName") String scheduleName, + @BodyParam("application/json") ScheduleUpdate body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/galleryimages/{galleryImageName}") - @ExpectedResponses({200}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/schedules/{scheduleName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> delete( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageFragment galleryImage, + @PathParam("labName") String labName, + @PathParam("scheduleName") String scheduleName, @HeaderParam("Accept") String accept, Context context); @@ -154,7 +155,7 @@ Mono> update( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listByLabNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -162,22 +163,20 @@ Mono> listNext( } /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String labAccountName, String expand, String filter, Integer top, String orderby) { + private Mono> listByLabSinglePageAsync( + String resourceGroupName, String labName, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -194,27 +193,24 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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( + .listByLab( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - expand, + labName, filter, - top, - orderby, - this.client.getApiVersion(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -227,29 +223,21 @@ private Mono> listSinglePageAsync( } /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + private Mono> listByLabSinglePageAsync( + String resourceGroupName, String labName, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -266,22 +254,19 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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( + .listByLab( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - expand, + labName, filter, - top, - orderby, - this.client.getApiVersion(), accept, context) .map( @@ -296,138 +281,117 @@ private Mono> listSinglePageAsync( } /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String labAccountName, String expand, String filter, Integer top, String orderby) { + private PagedFlux listByLabAsync(String resourceGroupName, String labName, String filter) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), + nextLink -> listByLabNextSinglePageAsync(nextLink)); } /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labAccountName) { - final String expand = null; + private PagedFlux listByLabAsync(String resourceGroupName, String labName) { final String filter = null; - final Integer top = null; - final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), + nextLink -> listByLabNextSinglePageAsync(nextLink)); } /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + private PagedFlux listByLabAsync( + String resourceGroupName, String labName, String filter, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter, context), + nextLink -> listByLabNextSinglePageAsync(nextLink, context)); } /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labAccountName) { - final String expand = null; + public PagedIterable listByLab(String resourceGroupName, String labName) { final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labAccountName, expand, filter, top, orderby)); + return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter)); } /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, labAccountName, expand, filter, top, orderby, context)); + public PagedIterable listByLab( + String resourceGroupName, String labName, String filter, Context context) { + return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter, context)); } /** - * Get gallery image. + * Returns the properties of a lab Schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labAccountName, String galleryImageName, String expand) { + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String scheduleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -444,12 +408,11 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil @@ -458,33 +421,34 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - expand, - this.client.getApiVersion(), + labName, + scheduleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get gallery image. + * Returns the properties of a lab Schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labAccountName, String galleryImageName, String expand, Context context) { + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String scheduleName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -501,71 +465,45 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - expand, - this.client.getApiVersion(), + labName, + scheduleName, accept, context); } /** - * Get gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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) - private Mono getAsync( - String resourceGroupName, String labAccountName, String galleryImageName, String expand) { - return getWithResponseAsync(resourceGroupName, labAccountName, galleryImageName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get gallery image. + * Returns the properties of a lab Schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labAccountName, String galleryImageName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labAccountName, galleryImageName, expand) + private Mono getAsync(String resourceGroupName, String labName, String scheduleName) { + return getWithResponseAsync(resourceGroupName, labName, scheduleName) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -575,56 +513,62 @@ private Mono getAsync(String resourceGroupName, String labAcc } /** - * Get gallery image. + * Returns the properties of a lab Schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner get(String resourceGroupName, String labAccountName, String galleryImageName) { - final String expand = null; - return getAsync(resourceGroupName, labAccountName, galleryImageName, expand).block(); + public ScheduleInner get(String resourceGroupName, String labName, String scheduleName) { + return getAsync(resourceGroupName, labName, scheduleName).block(); } /** - * Get gallery image. + * Returns the properties of a lab Schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String labAccountName, String galleryImageName, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, labAccountName, galleryImageName, expand, context).block(); + public Response getWithResponse( + String resourceGroupName, String labName, String scheduleName, Context context) { + return getWithResponseAsync(resourceGroupName, labName, scheduleName, context).block(); } /** - * Create or replace an existing Gallery Image. + * Operation to create or update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage) { + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String scheduleName, ScheduleInner body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -641,17 +585,16 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - galleryImage.validate(); + body.validate(); } final String accept = "application/json"; return FluxUtil @@ -660,37 +603,36 @@ private Mono> createOrUpdateWithResponseAsync( service .createOrUpdate( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - this.client.getApiVersion(), - galleryImage, + labName, + scheduleName, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or replace an existing Gallery Image. + * Operation to create or update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String scheduleName, ScheduleInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -707,51 +649,53 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - galleryImage.validate(); + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - this.client.getApiVersion(), - galleryImage, + labName, + scheduleName, + body, accept, context); } /** - * Create or replace an existing Gallery Image. + * Operation to create or update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage) { - return createOrUpdateWithResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String scheduleName, ScheduleInner body) { + return createOrUpdateWithResponseAsync(resourceGroupName, labName, scheduleName, body) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -761,62 +705,65 @@ private Mono createOrUpdateAsync( } /** - * Create or replace an existing Gallery Image. + * Operation to create or update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner createOrUpdate( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage) { - return createOrUpdateAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).block(); + public ScheduleInner createOrUpdate( + String resourceGroupName, String labName, String scheduleName, ScheduleInner body) { + return createOrUpdateAsync(resourceGroupName, labName, scheduleName, body).block(); } /** - * Create or replace an existing Gallery Image. + * Operation to create or update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String labAccountName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, labAccountName, galleryImageName, galleryImage, context) - .block(); + public Response createOrUpdateWithResponse( + String resourceGroupName, String labName, String scheduleName, ScheduleInner body, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, labName, scheduleName, body, context).block(); } /** - * Delete gallery image. + * Operation to update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String labAccountName, String galleryImageName) { + private Mono> updateWithResponseAsync( + String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -833,45 +780,54 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .delete( + .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - this.client.getApiVersion(), + labName, + scheduleName, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete gallery image. + * Operation to update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String labAccountName, String galleryImageName, Context context) { + private Mono> updateWithResponseAsync( + String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -888,92 +844,118 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - this.client.getApiVersion(), + labName, + scheduleName, + body, accept, context); } /** - * Delete gallery image. + * Operation to update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String labAccountName, String galleryImageName) { - return deleteWithResponseAsync(resourceGroupName, labAccountName, galleryImageName) - .flatMap((Response res) -> Mono.empty()); + private Mono updateAsync( + String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body) { + return updateWithResponseAsync(resourceGroupName, labName, scheduleName, body) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); } /** - * Delete gallery image. + * Operation to update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 for automatically turning virtual machines in a lab on and off at specified times. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String labAccountName, String galleryImageName) { - deleteAsync(resourceGroupName, labAccountName, galleryImageName).block(); + public ScheduleInner update(String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body) { + return updateAsync(resourceGroupName, labName, scheduleName, body).block(); } /** - * Delete gallery image. + * Operation to update a lab schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String labAccountName, String galleryImageName, Context context) { - return deleteWithResponseAsync(resourceGroupName, labAccountName, galleryImageName, context).block(); + public Response updateWithResponse( + String resourceGroupName, String labName, String scheduleName, ScheduleUpdate body, Context context) { + return updateWithResponseAsync(resourceGroupName, labName, scheduleName, body, context).block(); } /** - * Modify properties of gallery images. + * Operation to delete a schedule resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, String scheduleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -990,56 +972,46 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .update( + .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - this.client.getApiVersion(), - galleryImage, + labName, + scheduleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Modify properties of gallery images. + * Operation to delete a schedule resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String galleryImageName, - GalleryImageFragment galleryImage, - Context context) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String labName, String scheduleName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1056,99 +1028,187 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); + if (scheduleName == null) { + return Mono.error(new IllegalArgumentException("Parameter scheduleName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .update( + .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, - galleryImageName, - this.client.getApiVersion(), - galleryImage, + labName, + scheduleName, accept, context); } /** - * Modify properties of gallery images. + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labName, String scheduleName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, scheduleName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete a schedule resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String labName, String scheduleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, labName, scheduleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String scheduleName) { + return beginDeleteAsync(resourceGroupName, labName, scheduleName).getSyncPoller(); + } + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String labName, String scheduleName, Context context) { + return beginDeleteAsync(resourceGroupName, labName, scheduleName, context).getSyncPoller(); + } + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 updateAsync( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { - return updateWithResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono deleteAsync(String resourceGroupName, String labName, String scheduleName) { + return beginDeleteAsync(resourceGroupName, labName, scheduleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a schedule resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 scheduleName, Context context) { + return beginDeleteAsync(resourceGroupName, labName, scheduleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Modify properties of gallery images. + * Operation to delete a schedule resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner update( - String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { - return updateAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).block(); + public void delete(String resourceGroupName, String labName, String scheduleName) { + deleteAsync(resourceGroupName, labName, scheduleName).block(); } /** - * Modify properties of gallery images. + * Operation to delete a schedule resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param galleryImage Represents an image from the Azure Marketplace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an image from the Azure Marketplace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String galleryImageName, - GalleryImageFragment galleryImage, - Context context) { - return updateWithResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage, context) - .block(); + public void delete(String resourceGroupName, String labName, String scheduleName, Context context) { + deleteAsync(resourceGroupName, labName, scheduleName, context).block(); } /** @@ -1158,10 +1218,10 @@ 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 paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByLabNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1173,8 +1233,8 @@ private Mono> listNextSinglePageAsync(String ne } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listByLabNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -1194,10 +1254,10 @@ 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 paged list of schedules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByLabNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1210,7 +1270,7 @@ private Mono> listNextSinglePageAsync(String ne final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByLabNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesImpl.java new file mode 100644 index 0000000000000..3651bc5894a3d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SchedulesImpl.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.labservices.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.labservices.fluent.SchedulesClient; +import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; +import com.azure.resourcemanager.labservices.models.Schedule; +import com.azure.resourcemanager.labservices.models.Schedules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SchedulesImpl implements Schedules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchedulesImpl.class); + + private final SchedulesClient innerClient; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + public SchedulesImpl( + SchedulesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLab(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName); + return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByLab(resourceGroupName, labName, filter, context); + return Utils.mapPage(inner, inner1 -> new ScheduleImpl(inner1, this.manager())); + } + + public Schedule get(String resourceGroupName, String labName, String scheduleName) { + ScheduleInner inner = this.serviceClient().get(resourceGroupName, labName, scheduleName); + if (inner != null) { + return new ScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String labName, String scheduleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labName, scheduleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ScheduleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String labName, String scheduleName) { + this.serviceClient().delete(resourceGroupName, labName, scheduleName); + } + + public void delete(String resourceGroupName, String labName, String scheduleName, Context context) { + this.serviceClient().delete(resourceGroupName, labName, scheduleName, context); + } + + public Schedule 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 scheduleName = Utils.getValueFromIdByName(id, "schedules"); + if (scheduleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, scheduleName, 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 scheduleName = Utils.getValueFromIdByName(id, "schedules"); + if (scheduleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + } + return this.getWithResponse(resourceGroupName, labName, scheduleName, 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 scheduleName = Utils.getValueFromIdByName(id, "schedules"); + if (scheduleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + } + this.delete(resourceGroupName, labName, scheduleName, 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 scheduleName = Utils.getValueFromIdByName(id, "schedules"); + if (scheduleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedules'.", id))); + } + this.delete(resourceGroupName, labName, scheduleName, context); + } + + private SchedulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } + + public ScheduleImpl define(String name) { + return new ScheduleImpl(name, this.manager()); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ProviderOperationsClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusClientImpl.java similarity index 60% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ProviderOperationsClientImpl.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusClientImpl.java index a518d1b820fb8..50df92c21d189 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/ProviderOperationsClientImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusClientImpl.java @@ -26,46 +26,47 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.ProviderOperationsClient; -import com.azure.resourcemanager.labservices.fluent.models.OperationMetadataInner; -import com.azure.resourcemanager.labservices.models.ProviderOperationResult; +import com.azure.resourcemanager.labservices.fluent.SkusClient; +import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; +import com.azure.resourcemanager.labservices.models.PagedLabServicesSkus; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ProviderOperationsClient. */ -public final class ProviderOperationsClientImpl implements ProviderOperationsClient { - private final ClientLogger logger = new ClientLogger(ProviderOperationsClientImpl.class); +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); /** The proxy service used to perform REST calls. */ - private final ProviderOperationsService service; + private final SkusService service; /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; + private final LabServicesClientImpl client; /** - * Initializes an instance of ProviderOperationsClientImpl. + * Initializes an instance of SkusClientImpl. * * @param client the instance of the service client containing this operation class. */ - ProviderOperationsClientImpl(ManagedLabsClientImpl client) { - this.service = - RestProxy.create(ProviderOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + SkusClientImpl(LabServicesClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ManagedLabsClientProviderOperations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for LabServicesClientSkus to be used by the proxy service to perform REST + * calls. */ @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientPro") - private interface ProviderOperationsService { + @ServiceInterface(name = "LabServicesClientSku") + private interface SkusService { @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.LabServices/operations") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/skus") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @@ -73,7 +74,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -81,25 +82,42 @@ Mono> listNext( } /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync(String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + filter, + accept, + context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -112,26 +130,40 @@ private Mono> listSinglePageAsync() { } /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * + * @param filter The filter to apply to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + filter, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -144,56 +176,74 @@ private Mono> listSinglePageAsync(Context } /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. + * + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services skus. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of all the Azure Lab Services resource SKUs. * * @throws 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 paged list of lab services skus. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * + * @param filter The filter to apply to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return paged list of lab services skus. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(String filter, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * * @throws 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 paged list of lab services skus. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); } /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * + * @param filter The filter to apply to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return paged list of lab services skus. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); } /** @@ -203,10 +253,11 @@ 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 paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -219,7 +270,7 @@ private Mono> listNextSinglePageAsync(Stri final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -239,10 +290,11 @@ 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 paged list of lab services skus along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusImpl.java new file mode 100644 index 0000000000000..531502d393fcf --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/SkusImpl.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.labservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.SkusClient; +import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; +import com.azure.resourcemanager.labservices.models.LabServicesSku; +import com.azure.resourcemanager.labservices.models.Skus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SkusImpl implements Skus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new LabServicesSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new LabServicesSkuImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsageImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsageImpl.java new file mode 100644 index 0000000000000..971f9f44d1ee5 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsageImpl.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.labservices.implementation; + +import com.azure.resourcemanager.labservices.fluent.models.UsageInner; +import com.azure.resourcemanager.labservices.models.Usage; +import com.azure.resourcemanager.labservices.models.UsageName; +import com.azure.resourcemanager.labservices.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Long currentValue() { + return this.innerModel().currentValue(); + } + + public Long limit() { + return this.innerModel().limit(); + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..7d1275df68037 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesClientImpl.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.UsagesClient; +import com.azure.resourcemanager.labservices.fluent.models.UsageInner; +import com.azure.resourcemanager.labservices.models.ListUsagesResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final LabServicesClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(LabServicesClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LabServicesClientUsages to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "LabServicesClientUsa") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + filter, + 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())); + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync( + String location, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, String filter) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location, filter), + nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + final String filter = null; + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location, filter), + nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, String filter, Context context) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location, filter, context), + nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + final String filter = null; + return new PagedIterable<>(listByLocationAsync(location, filter)); + } + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, String filter, Context context) { + return new PagedIterable<>(listByLocationAsync(location, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(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.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(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 + .listByLocationNext(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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..945f799f6a08c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsagesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.UsagesClient; +import com.azure.resourcemanager.labservices.fluent.models.UsageInner; +import com.azure.resourcemanager.labservices.models.Usage; +import com.azure.resourcemanager.labservices.models.Usages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, String filter, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, filter, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UserImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UserImpl.java index ea3e237677edd..1c64223673fe3 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UserImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UserImpl.java @@ -4,20 +4,22 @@ package com.azure.resourcemanager.labservices.implementation; -import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.azure.resourcemanager.labservices.models.LatestOperationResult; +import com.azure.resourcemanager.labservices.models.InvitationState; +import com.azure.resourcemanager.labservices.models.InviteBody; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.RegistrationState; import com.azure.resourcemanager.labservices.models.User; -import com.azure.resourcemanager.labservices.models.UserFragment; +import com.azure.resourcemanager.labservices.models.UserUpdate; import java.time.Duration; -import java.util.Collections; -import java.util.Map; +import java.time.OffsetDateTime; public final class UserImpl implements User, User.Definition, User.Update { private UserInner innerObject; - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -31,80 +33,60 @@ public String type() { return this.innerModel().type(); } - public String location() { - return this.innerModel().location(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String displayName() { + return this.innerModel().displayName(); } public String email() { return this.innerModel().email(); } - public String familyName() { - return this.innerModel().familyName(); + public RegistrationState registrationState() { + return this.innerModel().registrationState(); } - public String givenName() { - return this.innerModel().givenName(); + public InvitationState invitationState() { + return this.innerModel().invitationState(); } - public String tenantId() { - return this.innerModel().tenantId(); + public OffsetDateTime invitationSent() { + return this.innerModel().invitationSent(); } public Duration totalUsage() { return this.innerModel().totalUsage(); } - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public String uniqueIdentifier() { - return this.innerModel().uniqueIdentifier(); - } - - public LatestOperationResult latestOperationResult() { - return this.innerModel().latestOperationResult(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); + public Duration additionalUsageQuota() { + return this.innerModel().additionalUsageQuota(); } public UserInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { + private com.azure.resourcemanager.labservices.LabServicesManager manager() { return this.serviceManager; } private String resourceGroupName; - private String labAccountName; - private String labName; private String username; - private UserFragment updateUser; + private UserUpdate updateBody; - public UserImpl withExistingLab(String resourceGroupName, String labAccountName, String labName) { + public UserImpl withExistingLab(String resourceGroupName, String labName) { this.resourceGroupName = resourceGroupName; - this.labAccountName = labAccountName; this.labName = labName; return this; } @@ -114,9 +96,7 @@ public User create() { serviceManager .serviceClient() .getUsers() - .createOrUpdateWithResponse( - resourceGroupName, labAccountName, labName, username, this.innerModel(), Context.NONE) - .getValue(); + .createOrUpdate(resourceGroupName, labName, username, this.innerModel(), Context.NONE); return this; } @@ -125,20 +105,18 @@ public User create(Context context) { serviceManager .serviceClient() .getUsers() - .createOrUpdateWithResponse( - resourceGroupName, labAccountName, labName, username, this.innerModel(), context) - .getValue(); + .createOrUpdate(resourceGroupName, labName, username, this.innerModel(), context); return this; } - UserImpl(String name, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + UserImpl(String name, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerObject = new UserInner(); this.serviceManager = serviceManager; this.username = name; } public UserImpl update() { - this.updateUser = new UserFragment(); + this.updateBody = new UserUpdate(); return this; } @@ -147,88 +125,63 @@ public User apply() { serviceManager .serviceClient() .getUsers() - .updateWithResponse(resourceGroupName, labAccountName, labName, username, updateUser, Context.NONE) - .getValue(); + .update(resourceGroupName, labName, username, updateBody, Context.NONE); return this; } public User apply(Context context) { this.innerObject = - serviceManager - .serviceClient() - .getUsers() - .updateWithResponse(resourceGroupName, labAccountName, labName, username, updateUser, context) - .getValue(); + serviceManager.serviceClient().getUsers().update(resourceGroupName, labName, username, updateBody, context); return this; } - UserImpl(UserInner innerObject, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + UserImpl(UserInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.labAccountName = Utils.getValueFromIdByName(innerObject.id(), "labaccounts"); this.labName = Utils.getValueFromIdByName(innerObject.id(), "labs"); this.username = Utils.getValueFromIdByName(innerObject.id(), "users"); } public User refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getUsers() - .getWithResponse(resourceGroupName, labAccountName, labName, username, localExpand, Context.NONE) + .getWithResponse(resourceGroupName, labName, username, Context.NONE) .getValue(); return this; } public User refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() .getUsers() - .getWithResponse(resourceGroupName, labAccountName, labName, username, localExpand, context) + .getWithResponse(resourceGroupName, labName, username, context) .getValue(); return this; } - public UserImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; + public void invite(InviteBody body) { + serviceManager.users().invite(resourceGroupName, labName, username, body); } - public UserImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public UserImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateUser.withTags(tags); - return this; - } + public void invite(InviteBody body, Context context) { + serviceManager.users().invite(resourceGroupName, labName, username, body, context); } - public UserImpl withProvisioningState(String provisioningState) { - if (isInCreateMode()) { - this.innerModel().withProvisioningState(provisioningState); - return this; - } else { - this.updateUser.withProvisioningState(provisioningState); - return this; - } + public UserImpl withEmail(String email) { + this.innerModel().withEmail(email); + return this; } - public UserImpl withUniqueIdentifier(String uniqueIdentifier) { + public UserImpl withAdditionalUsageQuota(Duration additionalUsageQuota) { if (isInCreateMode()) { - this.innerModel().withUniqueIdentifier(uniqueIdentifier); + this.innerModel().withAdditionalUsageQuota(additionalUsageQuota); return this; } else { - this.updateUser.withUniqueIdentifier(uniqueIdentifier); + this.updateBody.withAdditionalUsageQuota(additionalUsageQuota); return this; } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersClientImpl.java index 764b2fa3b1636..b373ac30f49ce 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersClientImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -35,8 +36,9 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.labservices.fluent.UsersClient; import com.azure.resourcemanager.labservices.fluent.models.UserInner; -import com.azure.resourcemanager.labservices.models.ResponseWithContinuationUser; -import com.azure.resourcemanager.labservices.models.UserFragment; +import com.azure.resourcemanager.labservices.models.InviteBody; +import com.azure.resourcemanager.labservices.models.PagedUsers; +import com.azure.resourcemanager.labservices.models.UserUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -49,113 +51,121 @@ public final class UsersClientImpl implements UsersClient { private final UsersService service; /** The service client containing this operation class. */ - private final ManagedLabsClientImpl client; + private final LabServicesClientImpl client; /** * Initializes an instance of UsersClientImpl. * * @param client the instance of the service client containing this operation class. */ - UsersClientImpl(ManagedLabsClientImpl client) { + UsersClientImpl(LabServicesClientImpl client) { this.service = RestProxy.create(UsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ManagedLabsClientUsers to be used by the proxy service to perform + * The interface defining all the services for LabServicesClientUsers to be used by the proxy service to perform * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ManagedLabsClientUse") + @ServiceInterface(name = "LabServicesClientUse") private interface UsersService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/users") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/users") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> listByLab( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @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.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/users/{userName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/users/{userName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, @PathParam("userName") String username, - @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.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/users/{userName}") - @ExpectedResponses({200, 201}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/users/{userName}") + @ExpectedResponses({200, 201, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, @PathParam("userName") String username, + @BodyParam("application/json") UserInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/users/{userName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UserInner user, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("userName") String username, + @BodyParam("application/json") UserUpdate body, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/users/{userName}") - @ExpectedResponses({202, 204}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/users/{userName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices" - + "/labaccounts/{labAccountName}/labs/{labName}/users/{userName}") - @ExpectedResponses({200}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/users/{userName}/invite") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> invite( @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("labAccountName") String labAccountName, @PathParam("labName") String labName, @PathParam("userName") String username, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UserFragment user, + @BodyParam("application/json") InviteBody body, @HeaderParam("Accept") String accept, Context context); @@ -163,7 +173,7 @@ Mono> update( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listByLabNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -171,29 +181,20 @@ Mono> listNext( } /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby) { + private Mono> listByLabSinglePageAsync( + String resourceGroupName, String labName, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -210,9 +211,6 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } @@ -221,17 +219,13 @@ private Mono> listSinglePageAsync( .withContext( context -> service - .list( + .listByLab( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - expand, filter, - top, - orderby, - this.client.getApiVersion(), accept, context)) .>map( @@ -247,31 +241,21 @@ private Mono> listSinglePageAsync( } /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + private Mono> listByLabSinglePageAsync( + String resourceGroupName, String labName, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -288,26 +272,19 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName 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( + .listByLab( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, - expand, filter, - top, - orderby, - this.client.getApiVersion(), accept, context) .map( @@ -322,154 +299,115 @@ private Mono> listSinglePageAsync( } /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby) { + private PagedFlux listByLabAsync(String resourceGroupName, String labName, String filter) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), + nextLink -> listByLabNextSinglePageAsync(nextLink)); } /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String labAccountName, String labName) { - final String expand = null; + private PagedFlux listByLabAsync(String resourceGroupName, String labName) { final String filter = null; - final Integer top = null; - final String orderby = null; return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby), - nextLink -> listNextSinglePageAsync(nextLink)); + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), + nextLink -> listByLabNextSinglePageAsync(nextLink)); } /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { + private PagedFlux listByLabAsync( + String resourceGroupName, String labName, String filter, Context context) { return new PagedFlux<>( - () -> - listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter, context), + nextLink -> listByLabNextSinglePageAsync(nextLink, context)); } /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String labAccountName, String labName) { - final String expand = null; + public PagedIterable listByLab(String resourceGroupName, String labName) { final String filter = null; - final Integer top = null; - final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby)); + return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter)); } /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - return new PagedIterable<>( - listAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby, context)); + public PagedIterable listByLab( + String resourceGroupName, String labName, String filter, Context context) { + return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter, context)); } /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String username, String expand) { + private Mono> getWithResponseAsync(String resourceGroupName, String labName, String username) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -486,9 +424,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } @@ -502,40 +437,33 @@ private Mono> getWithResponseAsync( service .get( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - expand, - this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String username, - String expand, - Context context) { + String resourceGroupName, String labName, String username, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -552,9 +480,6 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } @@ -566,34 +491,31 @@ private Mono> getWithResponseAsync( return service .get( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - expand, - this.client.getApiVersion(), accept, context); } /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return user of a lab that can register for and use virtual machines within the lab on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String labAccountName, String labName, String username, String expand) { - return getWithResponseAsync(resourceGroupName, labAccountName, labName, username, expand) + private Mono getAsync(String resourceGroupName, String labName, String username) { + return getWithResponseAsync(resourceGroupName, labName, username) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -605,90 +527,121 @@ private Mono getAsync( } /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return user of a lab that can register for and use virtual machines within the lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String labAccountName, String labName, String username) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, labAccountName, labName, username, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public UserInner get(String resourceGroupName, String labName, String username) { + return getAsync(resourceGroupName, labName, username).block(); } /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner get(String resourceGroupName, String labAccountName, String labName, String username) { - final String expand = null; - return getAsync(resourceGroupName, labAccountName, labName, username, expand).block(); + public Response getWithResponse( + String resourceGroupName, String labName, String username, Context context) { + return getWithResponseAsync(resourceGroupName, labName, username, context).block(); } /** - * Get user. + * Operation to create or update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - String expand, - Context context) { - return getWithResponseAsync(resourceGroupName, labAccountName, labName, username, expand, context).block(); + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String username, UserInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + username, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or replace an existing User. + * Operation to create or update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String username, UserInner user) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String labName, String username, UserInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -705,8 +658,240 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + username, + body, + accept, + context); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UserInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, String username, UserInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, username, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, this.client.getContext()); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UserInner> beginCreateOrUpdateAsync( + String resourceGroupName, String labName, String username, UserInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, labName, username, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, context); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UserInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String username, UserInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body).getSyncPoller(); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UserInner> beginCreateOrUpdate( + String resourceGroupName, String labName, String username, UserInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body, context).getSyncPoller(); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String username, UserInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String labName, String username, UserInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, labName, username, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner createOrUpdate(String resourceGroupName, String labName, String username, UserInner body) { + return createOrUpdateAsync(resourceGroupName, labName, username, body).block(); + } + + /** + * Operation to create or update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner createOrUpdate( + String resourceGroupName, String labName, String username, UserInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, labName, username, body, context).block(); + } + + /** + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String labName, String username, UserUpdate body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); @@ -714,52 +899,47 @@ private Mono> createOrUpdateWithResponseAsync( if (username == null) { return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - user.validate(); + body.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .createOrUpdate( + .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - this.client.getApiVersion(), - user, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or replace an existing User. + * Operation to update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String username, - UserInner user, - Context context) { + private Mono>> updateWithResponseAsync( + String resourceGroupName, String labName, String username, UserUpdate body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -776,123 +956,221 @@ private Mono> createOrUpdateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } if (username == null) { return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - user.validate(); + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .update( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - this.client.getApiVersion(), - user, + body, accept, context); } /** - * Create or replace an existing User. + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UserInner> beginUpdateAsync( + String resourceGroupName, String labName, String username, UserUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, labName, username, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, this.client.getContext()); + } + + /** + * Operation to update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UserInner> beginUpdateAsync( + String resourceGroupName, String labName, String username, UserUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, labName, username, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, context); + } + + /** + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UserInner> beginUpdate( + String resourceGroupName, String labName, String username, UserUpdate body) { + return beginUpdateAsync(resourceGroupName, labName, username, body).getSyncPoller(); + } + + /** + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UserInner> beginUpdate( + String resourceGroupName, String labName, String username, UserUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, labName, username, body, context).getSyncPoller(); + } + + /** + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String labAccountName, String labName, String username, UserInner user) { - return createOrUpdateWithResponseAsync(resourceGroupName, labAccountName, labName, username, user) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono updateAsync(String resourceGroupName, String labName, String username, UserUpdate body) { + return beginUpdateAsync(resourceGroupName, labName, username, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or replace an existing User. + * Operation to update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return user of a lab that can register for and use virtual machines within the lab on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner createOrUpdate( - String resourceGroupName, String labAccountName, String labName, String username, UserInner user) { - return createOrUpdateAsync(resourceGroupName, labAccountName, labName, username, user).block(); + private Mono updateAsync( + String resourceGroupName, String labName, String username, UserUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, labName, username, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or replace an existing User. + * Operation to update a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a lab that can register for and use virtual machines within the lab. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner update(String resourceGroupName, String labName, String username, UserUpdate body) { + return updateAsync(resourceGroupName, labName, username, body).block(); + } + + /** + * Operation to update a lab user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return user of a lab that can register for and use virtual machines within the lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - UserInner user, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, labAccountName, labName, username, user, context) - .block(); + public UserInner update( + String resourceGroupName, String labName, String username, UserUpdate body, Context context) { + return updateAsync(resourceGroupName, labName, username, body, context).block(); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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 labAccountName, String labName, String username) { + String resourceGroupName, String labName, String username) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -909,9 +1187,6 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } @@ -925,33 +1200,32 @@ private Mono>> deleteWithResponseAsync( service .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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 labAccountName, String labName, String username, Context context) { + String resourceGroupName, String labName, String username, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -968,9 +1242,6 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } @@ -982,189 +1253,184 @@ private Mono>> deleteWithResponseAsync( return service .delete( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - this.client.getApiVersion(), accept, context); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labAccountName, String labName, String username) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, labAccountName, labName, username); + String resourceGroupName, String labName, String username) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username); 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()); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String labAccountName, String labName, String username, Context context) { + String resourceGroupName, String labName, String username, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, labAccountName, labName, username, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, labName, username, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, String username) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, username).getSyncPoller(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String labName, String username) { + return beginDeleteAsync(resourceGroupName, labName, username).getSyncPoller(); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String resourceGroupName, String labAccountName, String labName, String username, Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, username, context).getSyncPoller(); + String resourceGroupName, String labName, String username, Context context) { + return beginDeleteAsync(resourceGroupName, labName, username, context).getSyncPoller(); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 labAccountName, String labName, String username) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, username) + private Mono deleteAsync(String resourceGroupName, String labName, String username) { + return beginDeleteAsync(resourceGroupName, labName, username) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 labAccountName, String labName, String username, Context context) { - return beginDeleteAsync(resourceGroupName, labAccountName, labName, username, context) + private Mono deleteAsync(String resourceGroupName, String labName, String username, Context context) { + return beginDeleteAsync(resourceGroupName, labName, username, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 labAccountName, String labName, String username) { - deleteAsync(resourceGroupName, labAccountName, labName, username).block(); + public void delete(String resourceGroupName, String labName, String username) { + deleteAsync(resourceGroupName, labName, username).block(); } /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 labAccountName, String labName, String username, Context context) { - deleteAsync(resourceGroupName, labAccountName, labName, username, context).block(); + public void delete(String resourceGroupName, String labName, String username, Context context) { + deleteAsync(resourceGroupName, labName, username, context).block(); } /** - * Modify properties of users. + * Operation to invite a user to a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String labAccountName, String labName, String username, UserFragment user) { + private Mono>> inviteWithResponseAsync( + String resourceGroupName, String labName, String username, InviteBody body) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1181,61 +1447,52 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } if (username == null) { return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - user.validate(); + body.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .update( + .invite( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - this.client.getApiVersion(), - user, + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Modify properties of users. + * Operation to invite a user to a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String labAccountName, - String labName, - String username, - UserFragment user, - Context context) { + private Mono>> inviteWithResponseAsync( + String resourceGroupName, String labName, String username, InviteBody body, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1252,105 +1509,194 @@ private Mono> updateWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (labAccountName == null) { - return Mono.error(new IllegalArgumentException("Parameter labAccountName is required and cannot be null.")); - } if (labName == null) { return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); } if (username == null) { return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); } - if (user == null) { - return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { - user.validate(); + body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .update( + .invite( this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - labAccountName, labName, username, - this.client.getApiVersion(), - user, + body, accept, context); } /** - * Modify properties of users. + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginInviteAsync( + String resourceGroupName, String labName, String username, InviteBody body) { + Mono>> mono = inviteWithResponseAsync(resourceGroupName, labName, username, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginInviteAsync( + String resourceGroupName, String labName, String username, InviteBody body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + inviteWithResponseAsync(resourceGroupName, labName, username, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginInvite( + String resourceGroupName, String labName, String username, InviteBody body) { + return beginInviteAsync(resourceGroupName, labName, username, body).getSyncPoller(); + } + + /** + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginInvite( + String resourceGroupName, String labName, String username, InviteBody body, Context context) { + return beginInviteAsync(resourceGroupName, labName, username, body, context).getSyncPoller(); + } + + /** + * Operation to invite a user to a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String labAccountName, String labName, String username, UserFragment user) { - return updateWithResponseAsync(resourceGroupName, labAccountName, labName, username, user) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono inviteAsync(String resourceGroupName, String labName, String username, InviteBody body) { + return beginInviteAsync(resourceGroupName, labName, username, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Modify properties of users. + * Operation to invite a user to a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner update( - String resourceGroupName, String labAccountName, String labName, String username, UserFragment user) { - return updateAsync(resourceGroupName, labAccountName, labName, username, user).block(); + private Mono inviteAsync( + String resourceGroupName, String labName, String username, InviteBody body, Context context) { + return beginInviteAsync(resourceGroupName, labName, username, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 invite(String resourceGroupName, String labName, String username, InviteBody body) { + inviteAsync(resourceGroupName, labName, username, body).block(); } /** - * Modify properties of users. + * Operation to invite a user to a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param user The User registered to a lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the User registered to a lab. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - UserFragment user, - Context context) { - return updateWithResponseAsync(resourceGroupName, labAccountName, labName, username, user, context).block(); + public void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context) { + inviteAsync(resourceGroupName, labName, username, body, context).block(); } /** @@ -1360,10 +1706,10 @@ 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 paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByLabNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1375,7 +1721,7 @@ private Mono> listNextSinglePageAsync(String nextLink) } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listByLabNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1396,10 +1742,10 @@ 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 paged list of users along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByLabNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1412,7 +1758,7 @@ private Mono> listNextSinglePageAsync(String nextLink, final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByLabNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersImpl.java index 616134e6efde8..1e5b8ca7555ae 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersImpl.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/UsersImpl.java @@ -11,6 +11,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.labservices.fluent.UsersClient; import com.azure.resourcemanager.labservices.fluent.models.UserInner; +import com.azure.resourcemanager.labservices.models.InviteBody; import com.azure.resourcemanager.labservices.models.User; import com.azure.resourcemanager.labservices.models.Users; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -20,36 +21,25 @@ public final class UsersImpl implements Users { private final UsersClient innerClient; - private final com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager; + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; - public UsersImpl(UsersClient innerClient, com.azure.resourcemanager.labservices.ManagedLabsManager serviceManager) { + public UsersImpl(UsersClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String labAccountName, String labName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, labAccountName, labName); + public PagedIterable listByLab(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName); return Utils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, labAccountName, labName, expand, filter, top, orderby, context); + public PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context) { + PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName, filter, context); return Utils.mapPage(inner, inner1 -> new UserImpl(inner1, this.manager())); } - public User get(String resourceGroupName, String labAccountName, String labName, String username) { - UserInner inner = this.serviceClient().get(resourceGroupName, labAccountName, labName, username); + public User get(String resourceGroupName, String labName, String username) { + UserInner inner = this.serviceClient().get(resourceGroupName, labName, username); if (inner != null) { return new UserImpl(inner, this.manager()); } else { @@ -57,15 +47,8 @@ public User get(String resourceGroupName, String labAccountName, String labName, } } - public Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - String expand, - Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, labAccountName, labName, username, expand, context); + public Response getWithResponse(String resourceGroupName, String labName, String username, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, labName, username, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -77,13 +60,20 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String labAccountName, String labName, String username) { - this.serviceClient().delete(resourceGroupName, labAccountName, labName, username); + public void delete(String resourceGroupName, String labName, String username) { + this.serviceClient().delete(resourceGroupName, labName, username); } - public void delete( - String resourceGroupName, String labAccountName, String labName, String username, Context context) { - this.serviceClient().delete(resourceGroupName, labAccountName, labName, username, context); + public void delete(String resourceGroupName, String labName, String username, Context context) { + this.serviceClient().delete(resourceGroupName, labName, username, context); + } + + public void invite(String resourceGroupName, String labName, String username, InviteBody body) { + this.serviceClient().invite(resourceGroupName, labName, username, body); + } + + public void invite(String resourceGroupName, String labName, String username, InviteBody body, Context context) { + this.serviceClient().invite(resourceGroupName, labName, username, body, context); } public User getById(String id) { @@ -95,13 +85,6 @@ public User getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -116,13 +99,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, labAccountName, labName, username, localExpand, Context.NONE) - .getValue(); + return this.getWithResponse(resourceGroupName, labName, username, 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 @@ -131,13 +111,6 @@ public Response getByIdWithResponse(String id, String expand, Context cont String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -152,7 +125,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, labAccountName, labName, username, expand, context); + return this.getWithResponse(resourceGroupName, labName, username, context); } public void deleteById(String id) { @@ -164,13 +137,6 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -185,7 +151,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } - this.delete(resourceGroupName, labAccountName, labName, username, Context.NONE); + this.delete(resourceGroupName, labName, username, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -197,13 +163,6 @@ public void deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String labAccountName = Utils.getValueFromIdByName(id, "labaccounts"); - if (labAccountName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'labaccounts'.", id))); - } String labName = Utils.getValueFromIdByName(id, "labs"); if (labName == null) { throw logger @@ -218,14 +177,14 @@ public void deleteByIdWithResponse(String id, Context context) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); } - this.delete(resourceGroupName, labAccountName, labName, username, context); + this.delete(resourceGroupName, labName, username, context); } private UsersClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.labservices.ManagedLabsManager manager() { + private com.azure.resourcemanager.labservices.LabServicesManager manager() { return this.serviceManager; } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachineImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachineImpl.java new file mode 100644 index 0000000000000..c97ab7308f226 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachineImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.labservices.models.ProvisioningState; +import com.azure.resourcemanager.labservices.models.VirtualMachine; +import com.azure.resourcemanager.labservices.models.VirtualMachineConnectionProfile; +import com.azure.resourcemanager.labservices.models.VirtualMachineState; +import com.azure.resourcemanager.labservices.models.VirtualMachineType; + +public final class VirtualMachineImpl implements VirtualMachine { + private VirtualMachineInner innerObject; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + VirtualMachineImpl( + VirtualMachineInner innerObject, com.azure.resourcemanager.labservices.LabServicesManager 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualMachineState state() { + return this.innerModel().state(); + } + + public VirtualMachineConnectionProfile connectionProfile() { + return this.innerModel().connectionProfile(); + } + + public String claimedByUserId() { + return this.innerModel().claimedByUserId(); + } + + public VirtualMachineType vmType() { + return this.innerModel().vmType(); + } + + public VirtualMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesClientImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesClientImpl.java new file mode 100644 index 0000000000000..76cf2340485f6 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesClientImpl.java @@ -0,0 +1,2062 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.implementation; + +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; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.labservices.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.labservices.models.PagedVirtualMachines; +import com.azure.resourcemanager.labservices.models.ResetPasswordBody; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +public final class VirtualMachinesClientImpl implements VirtualMachinesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachinesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachinesService service; + + /** The service client containing this operation class. */ + private final LabServicesClientImpl client; + + /** + * Initializes an instance of VirtualMachinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachinesClientImpl(LabServicesClientImpl client) { + this.service = + RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for LabServicesClientVirtualMachines to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "LabServicesClientVir") + private interface VirtualMachinesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLab( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/virtualMachines/{virtualMachineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/virtualMachines/{virtualMachineName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/virtualMachines/{virtualMachineName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/virtualMachines/{virtualMachineName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/virtualMachines/{virtualMachineName}/redeploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> redeploy( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs" + + "/{labName}/virtualMachines/{virtualMachineName}/resetPassword") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetPassword( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("labName") String labName, + @PathParam("virtualMachineName") String virtualMachineName, + @BodyParam("application/json") ResetPasswordBody body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLabNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabSinglePageAsync( + String resourceGroupName, String labName, String filter) { + 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 + .listByLab( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + 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())); + } + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabSinglePageAsync( + String resourceGroupName, String labName, String filter, 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 + .listByLab( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLabAsync(String resourceGroupName, String labName, String filter) { + return new PagedFlux<>( + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), + nextLink -> listByLabNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLabAsync(String resourceGroupName, String labName) { + final String filter = null; + return new PagedFlux<>( + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter), + nextLink -> listByLabNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLabAsync( + String resourceGroupName, String labName, String filter, Context context) { + return new PagedFlux<>( + () -> listByLabSinglePageAsync(resourceGroupName, labName, filter, context), + nextLink -> listByLabNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLab(String resourceGroupName, String labName) { + final String filter = null; + return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter)); + } + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLab( + String resourceGroupName, String labName, String filter, Context context) { + return new PagedIterable<>(listByLabAsync(resourceGroupName, labName, filter, context)); + } + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtual machine resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtual machine resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context); + } + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtual machine resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String labName, String virtualMachineName) { + return getWithResponseAsync(resourceGroupName, labName, virtualMachineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtual machine resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner get(String resourceGroupName, String labName, String virtualMachineName) { + return getAsync(resourceGroupName, labName, virtualMachineName).block(); + } + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 virtual machine resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, labName, virtualMachineName, context).block(); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String labName, String virtualMachineName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, labName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String labName, String virtualMachineName) { + return beginStartAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginStartAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String labName, String virtualMachineName) { + return beginStartAsync(resourceGroupName, labName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginStartAsync(resourceGroupName, labName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String labName, String virtualMachineName) { + startAsync(resourceGroupName, labName, virtualMachineName).block(); + } + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String labName, String virtualMachineName, Context context) { + startAsync(resourceGroupName, labName, virtualMachineName, context).block(); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String labName, String virtualMachineName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, labName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String labName, String virtualMachineName) { + return beginStopAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginStopAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String labName, String virtualMachineName) { + return beginStopAsync(resourceGroupName, labName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginStopAsync(resourceGroupName, labName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String labName, String virtualMachineName) { + stopAsync(resourceGroupName, labName, virtualMachineName).block(); + } + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String labName, String virtualMachineName, Context context) { + stopAsync(resourceGroupName, labName, virtualMachineName, context).block(); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> reimageWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> reimageWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String labName, String virtualMachineName) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, labName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String labName, String virtualMachineName) { + return beginReimageAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginReimageAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 reimageAsync(String resourceGroupName, String labName, String virtualMachineName) { + return beginReimageAsync(resourceGroupName, labName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 reimageAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginReimageAsync(resourceGroupName, labName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String labName, String virtualMachineName) { + reimageAsync(resourceGroupName, labName, virtualMachineName).block(); + } + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage(String resourceGroupName, String labName, String virtualMachineName, Context context) { + reimageAsync(resourceGroupName, labName, virtualMachineName, context).block(); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> redeployWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .redeploy( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> redeployWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .redeploy( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + accept, + context); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String labName, String virtualMachineName) { + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, labName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRedeployAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + redeployWithResponseAsync(resourceGroupName, labName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String labName, String virtualMachineName) { + return beginRedeployAsync(resourceGroupName, labName, virtualMachineName).getSyncPoller(); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRedeploy( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginRedeployAsync(resourceGroupName, labName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 redeployAsync(String resourceGroupName, String labName, String virtualMachineName) { + return beginRedeployAsync(resourceGroupName, labName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 redeployAsync( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + return beginRedeployAsync(resourceGroupName, labName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String labName, String virtualMachineName) { + redeployAsync(resourceGroupName, labName, virtualMachineName).block(); + } + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context) { + redeployAsync(resourceGroupName, labName, virtualMachineName, context).block(); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> resetPasswordWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetPassword( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> resetPasswordWithResponseAsync( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (labName == null) { + return Mono.error(new IllegalArgumentException("Parameter labName is required and cannot be null.")); + } + if (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetPassword( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + labName, + virtualMachineName, + body, + accept, + context); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResetPasswordAsync( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { + Mono>> mono = + resetPasswordWithResponseAsync(resourceGroupName, labName, virtualMachineName, body); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResetPasswordAsync( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetPasswordWithResponseAsync(resourceGroupName, labName, virtualMachineName, body, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { + return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body).getSyncPoller(); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { + return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body, context).getSyncPoller(); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetPasswordAsync( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { + return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resetPasswordAsync( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { + return beginResetPasswordAsync(resourceGroupName, labName, virtualMachineName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { + resetPasswordAsync(resourceGroupName, labName, virtualMachineName, body).block(); + } + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { + resetPasswordAsync(resourceGroupName, labName, virtualMachineName, body, 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 paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabNextSinglePageAsync(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.listByLabNext(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 paged list of lab services virtual machines along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLabNextSinglePageAsync(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 + .listByLabNext(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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesImpl.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesImpl.java new file mode 100644 index 0000000000000..b6998cfb5ec5c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/VirtualMachinesImpl.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.labservices.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.labservices.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.labservices.models.ResetPasswordBody; +import com.azure.resourcemanager.labservices.models.VirtualMachine; +import com.azure.resourcemanager.labservices.models.VirtualMachines; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualMachinesImpl implements VirtualMachines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinesImpl.class); + + private final VirtualMachinesClient innerClient; + + private final com.azure.resourcemanager.labservices.LabServicesManager serviceManager; + + public VirtualMachinesImpl( + VirtualMachinesClient innerClient, com.azure.resourcemanager.labservices.LabServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLab(String resourceGroupName, String labName) { + PagedIterable inner = this.serviceClient().listByLab(resourceGroupName, labName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByLab( + String resourceGroupName, String labName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByLab(resourceGroupName, labName, filter, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public VirtualMachine get(String resourceGroupName, String labName, String virtualMachineName) { + VirtualMachineInner inner = this.serviceClient().get(resourceGroupName, labName, virtualMachineName); + if (inner != null) { + return new VirtualMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String labName, String virtualMachineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, labName, virtualMachineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void start(String resourceGroupName, String labName, String virtualMachineName) { + this.serviceClient().start(resourceGroupName, labName, virtualMachineName); + } + + public void start(String resourceGroupName, String labName, String virtualMachineName, Context context) { + this.serviceClient().start(resourceGroupName, labName, virtualMachineName, context); + } + + public void stop(String resourceGroupName, String labName, String virtualMachineName) { + this.serviceClient().stop(resourceGroupName, labName, virtualMachineName); + } + + public void stop(String resourceGroupName, String labName, String virtualMachineName, Context context) { + this.serviceClient().stop(resourceGroupName, labName, virtualMachineName, context); + } + + public void reimage(String resourceGroupName, String labName, String virtualMachineName) { + this.serviceClient().reimage(resourceGroupName, labName, virtualMachineName); + } + + public void reimage(String resourceGroupName, String labName, String virtualMachineName, Context context) { + this.serviceClient().reimage(resourceGroupName, labName, virtualMachineName, context); + } + + public void redeploy(String resourceGroupName, String labName, String virtualMachineName) { + this.serviceClient().redeploy(resourceGroupName, labName, virtualMachineName); + } + + public void redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context) { + this.serviceClient().redeploy(resourceGroupName, labName, virtualMachineName, context); + } + + public void resetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body) { + this.serviceClient().resetPassword(resourceGroupName, labName, virtualMachineName, body); + } + + public void resetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context) { + this.serviceClient().resetPassword(resourceGroupName, labName, virtualMachineName, body, context); + } + + private VirtualMachinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.labservices.LabServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/package-info.java index df6e543c1676c..9f41a464c19ac 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/package-info.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/implementation/package-info.java @@ -2,5 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for ManagedLabsClient. The Managed Labs Client. */ +/** Package containing the implementations for LabServicesClient. REST API for managing Azure Lab Services images. */ package com.azure.resourcemanager.labservices.implementation; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ActionType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ActionType.java new file mode 100644 index 0000000000000..5b64ac876510c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ActionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddRemove.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddRemove.java deleted file mode 100644 index 13ad6f35ea3e0..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddRemove.java +++ /dev/null @@ -1,34 +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.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for AddRemove. */ -public final class AddRemove extends ExpandableStringEnum { - /** Static value Add for AddRemove. */ - public static final AddRemove ADD = fromString("Add"); - - /** Static value Remove for AddRemove. */ - public static final AddRemove REMOVE = fromString("Remove"); - - /** - * Creates or finds a AddRemove from its string representation. - * - * @param name a name to look for. - * @return the corresponding AddRemove. - */ - @JsonCreator - public static AddRemove fromString(String name) { - return fromString(name, AddRemove.class); - } - - /** @return known AddRemove values. */ - public static Collection values() { - return values(AddRemove.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddUsersPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddUsersPayload.java deleted file mode 100644 index 50c3f49263d01..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AddUsersPayload.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Payload for Add Users operation on a Lab. */ -@Fluent -public final class AddUsersPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AddUsersPayload.class); - - /* - * List of user emails addresses to add to the lab. - */ - @JsonProperty(value = "emailAddresses", required = true) - private List emailAddresses; - - /** - * Get the emailAddresses property: List of user emails addresses to add to the lab. - * - * @return the emailAddresses value. - */ - public List emailAddresses() { - return this.emailAddresses; - } - - /** - * Set the emailAddresses property: List of user emails addresses to add to the lab. - * - * @param emailAddresses the emailAddresses value to set. - * @return the AddUsersPayload object itself. - */ - public AddUsersPayload withEmailAddresses(List emailAddresses) { - this.emailAddresses = emailAddresses; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (emailAddresses() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property emailAddresses in model AddUsersPayload")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AutoShutdownProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AutoShutdownProfile.java new file mode 100644 index 0000000000000..4ed699bbaf4a9 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/AutoShutdownProfile.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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.Duration; + +/** Profile for how to handle shutting down virtual machines. */ +@Fluent +public final class AutoShutdownProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoShutdownProfile.class); + + /* + * Whether shutdown on disconnect is enabled + */ + @JsonProperty(value = "shutdownOnDisconnect") + private EnableState shutdownOnDisconnect; + + /* + * Whether a VM will get shutdown when it hasn't been connected to after a + * period of time. + */ + @JsonProperty(value = "shutdownWhenNotConnected") + private EnableState shutdownWhenNotConnected; + + /* + * Whether a VM will get shutdown when it has idled for a period of time. + */ + @JsonProperty(value = "shutdownOnIdle") + private ShutdownOnIdleMode shutdownOnIdle; + + /* + * The amount of time a VM will stay running after a user disconnects if + * this behavior is enabled. + */ + @JsonProperty(value = "disconnectDelay") + private Duration disconnectDelay; + + /* + * The amount of time a VM will stay running before it is shutdown if no + * connection is made and this behavior is enabled. + */ + @JsonProperty(value = "noConnectDelay") + private Duration noConnectDelay; + + /* + * The amount of time a VM will idle before it is shutdown if this behavior + * is enabled. + */ + @JsonProperty(value = "idleDelay") + private Duration idleDelay; + + /** + * Get the shutdownOnDisconnect property: Whether shutdown on disconnect is enabled. + * + * @return the shutdownOnDisconnect value. + */ + public EnableState shutdownOnDisconnect() { + return this.shutdownOnDisconnect; + } + + /** + * Set the shutdownOnDisconnect property: Whether shutdown on disconnect is enabled. + * + * @param shutdownOnDisconnect the shutdownOnDisconnect value to set. + * @return the AutoShutdownProfile object itself. + */ + public AutoShutdownProfile withShutdownOnDisconnect(EnableState shutdownOnDisconnect) { + this.shutdownOnDisconnect = shutdownOnDisconnect; + return this; + } + + /** + * Get the shutdownWhenNotConnected property: Whether a VM will get shutdown when it hasn't been connected to after + * a period of time. + * + * @return the shutdownWhenNotConnected value. + */ + public EnableState shutdownWhenNotConnected() { + return this.shutdownWhenNotConnected; + } + + /** + * Set the shutdownWhenNotConnected property: Whether a VM will get shutdown when it hasn't been connected to after + * a period of time. + * + * @param shutdownWhenNotConnected the shutdownWhenNotConnected value to set. + * @return the AutoShutdownProfile object itself. + */ + public AutoShutdownProfile withShutdownWhenNotConnected(EnableState shutdownWhenNotConnected) { + this.shutdownWhenNotConnected = shutdownWhenNotConnected; + return this; + } + + /** + * Get the shutdownOnIdle property: Whether a VM will get shutdown when it has idled for a period of time. + * + * @return the shutdownOnIdle value. + */ + public ShutdownOnIdleMode shutdownOnIdle() { + return this.shutdownOnIdle; + } + + /** + * Set the shutdownOnIdle property: Whether a VM will get shutdown when it has idled for a period of time. + * + * @param shutdownOnIdle the shutdownOnIdle value to set. + * @return the AutoShutdownProfile object itself. + */ + public AutoShutdownProfile withShutdownOnIdle(ShutdownOnIdleMode shutdownOnIdle) { + this.shutdownOnIdle = shutdownOnIdle; + return this; + } + + /** + * Get the disconnectDelay property: The amount of time a VM will stay running after a user disconnects if this + * behavior is enabled. + * + * @return the disconnectDelay value. + */ + public Duration disconnectDelay() { + return this.disconnectDelay; + } + + /** + * Set the disconnectDelay property: The amount of time a VM will stay running after a user disconnects if this + * behavior is enabled. + * + * @param disconnectDelay the disconnectDelay value to set. + * @return the AutoShutdownProfile object itself. + */ + public AutoShutdownProfile withDisconnectDelay(Duration disconnectDelay) { + this.disconnectDelay = disconnectDelay; + return this; + } + + /** + * Get the noConnectDelay property: The amount of time a VM will stay running before it is shutdown if no connection + * is made and this behavior is enabled. + * + * @return the noConnectDelay value. + */ + public Duration noConnectDelay() { + return this.noConnectDelay; + } + + /** + * Set the noConnectDelay property: The amount of time a VM will stay running before it is shutdown if no connection + * is made and this behavior is enabled. + * + * @param noConnectDelay the noConnectDelay value to set. + * @return the AutoShutdownProfile object itself. + */ + public AutoShutdownProfile withNoConnectDelay(Duration noConnectDelay) { + this.noConnectDelay = noConnectDelay; + return this; + } + + /** + * Get the idleDelay property: The amount of time a VM will idle before it is shutdown if this behavior is enabled. + * + * @return the idleDelay value. + */ + public Duration idleDelay() { + return this.idleDelay; + } + + /** + * Set the idleDelay property: The amount of time a VM will idle before it is shutdown if this behavior is enabled. + * + * @param idleDelay the idleDelay value to set. + * @return the AutoShutdownProfile object itself. + */ + public AutoShutdownProfile withIdleDelay(Duration idleDelay) { + this.idleDelay = idleDelay; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConfigurationState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConfigurationState.java deleted file mode 100644 index 6ed7cf9b84f61..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConfigurationState.java +++ /dev/null @@ -1,34 +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.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConfigurationState. */ -public final class ConfigurationState extends ExpandableStringEnum { - /** Static value NotApplicable for ConfigurationState. */ - public static final ConfigurationState NOT_APPLICABLE = fromString("NotApplicable"); - - /** Static value Completed for ConfigurationState. */ - public static final ConfigurationState COMPLETED = fromString("Completed"); - - /** - * Creates or finds a ConfigurationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConfigurationState. - */ - @JsonCreator - public static ConfigurationState fromString(String name) { - return fromString(name, ConfigurationState.class); - } - - /** @return known ConfigurationState values. */ - public static Collection values() { - return values(ConfigurationState.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionProfile.java new file mode 100644 index 0000000000000..a6d2ae482a95b --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionProfile.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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; + +/** Connection profile for how users connect to lab virtual machines. */ +@Fluent +public final class ConnectionProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionProfile.class); + + /* + * The enabled access level for Web Access over SSH. + */ + @JsonProperty(value = "webSshAccess") + private ConnectionType webSshAccess; + + /* + * The enabled access level for Web Access over RDP. + */ + @JsonProperty(value = "webRdpAccess") + private ConnectionType webRdpAccess; + + /* + * The enabled access level for Client Access over SSH. + */ + @JsonProperty(value = "clientSshAccess") + private ConnectionType clientSshAccess; + + /* + * The enabled access level for Client Access over RDP. + */ + @JsonProperty(value = "clientRdpAccess") + private ConnectionType clientRdpAccess; + + /** + * Get the webSshAccess property: The enabled access level for Web Access over SSH. + * + * @return the webSshAccess value. + */ + public ConnectionType webSshAccess() { + return this.webSshAccess; + } + + /** + * Set the webSshAccess property: The enabled access level for Web Access over SSH. + * + * @param webSshAccess the webSshAccess value to set. + * @return the ConnectionProfile object itself. + */ + public ConnectionProfile withWebSshAccess(ConnectionType webSshAccess) { + this.webSshAccess = webSshAccess; + return this; + } + + /** + * Get the webRdpAccess property: The enabled access level for Web Access over RDP. + * + * @return the webRdpAccess value. + */ + public ConnectionType webRdpAccess() { + return this.webRdpAccess; + } + + /** + * Set the webRdpAccess property: The enabled access level for Web Access over RDP. + * + * @param webRdpAccess the webRdpAccess value to set. + * @return the ConnectionProfile object itself. + */ + public ConnectionProfile withWebRdpAccess(ConnectionType webRdpAccess) { + this.webRdpAccess = webRdpAccess; + return this; + } + + /** + * Get the clientSshAccess property: The enabled access level for Client Access over SSH. + * + * @return the clientSshAccess value. + */ + public ConnectionType clientSshAccess() { + return this.clientSshAccess; + } + + /** + * Set the clientSshAccess property: The enabled access level for Client Access over SSH. + * + * @param clientSshAccess the clientSshAccess value to set. + * @return the ConnectionProfile object itself. + */ + public ConnectionProfile withClientSshAccess(ConnectionType clientSshAccess) { + this.clientSshAccess = clientSshAccess; + return this; + } + + /** + * Get the clientRdpAccess property: The enabled access level for Client Access over RDP. + * + * @return the clientRdpAccess value. + */ + public ConnectionType clientRdpAccess() { + return this.clientRdpAccess; + } + + /** + * Set the clientRdpAccess property: The enabled access level for Client Access over RDP. + * + * @param clientRdpAccess the clientRdpAccess value to set. + * @return the ConnectionProfile object itself. + */ + public ConnectionProfile withClientRdpAccess(ConnectionType clientRdpAccess) { + this.clientRdpAccess = clientRdpAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionType.java new file mode 100644 index 0000000000000..2398502e21d33 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ConnectionType.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ConnectionType. */ +public enum ConnectionType { + /** Enum value Public. */ + PUBLIC("Public"), + + /** Enum value Private. */ + PRIVATE("Private"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ConnectionType instance. */ + private final String value; + + ConnectionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ConnectionType instance. + * + * @param value the serialized value to parse. + * @return the parsed ConnectionType object, or null if unable to parse. + */ + @JsonCreator + public static ConnectionType fromString(String value) { + ConnectionType[] items = ConnectionType.values(); + for (ConnectionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateLabProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateLabProperties.java deleted file mode 100644 index 02ff494729a02..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateLabProperties.java +++ /dev/null @@ -1,172 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Properties for creating a managed lab and a default environment setting. */ -@Fluent -public final class CreateLabProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateLabProperties.class); - - /* - * Settings related to creating an environment setting - */ - @JsonProperty(value = "environmentSettingCreationParameters") - private EnvironmentSettingCreationParameters environmentSettingCreationParameters; - - /* - * Settings related to creating a lab - */ - @JsonProperty(value = "labCreationParameters", required = true) - private LabCreationParameters labCreationParameters; - - /* - * The name of the resource - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * The location of the resource - */ - @JsonProperty(value = "location") - private String location; - - /* - * The tags of the resource. - */ - @JsonProperty(value = "tags") - private Map tags; - - /** - * Get the environmentSettingCreationParameters property: Settings related to creating an environment setting. - * - * @return the environmentSettingCreationParameters value. - */ - public EnvironmentSettingCreationParameters environmentSettingCreationParameters() { - return this.environmentSettingCreationParameters; - } - - /** - * Set the environmentSettingCreationParameters property: Settings related to creating an environment setting. - * - * @param environmentSettingCreationParameters the environmentSettingCreationParameters value to set. - * @return the CreateLabProperties object itself. - */ - public CreateLabProperties withEnvironmentSettingCreationParameters( - EnvironmentSettingCreationParameters environmentSettingCreationParameters) { - this.environmentSettingCreationParameters = environmentSettingCreationParameters; - return this; - } - - /** - * Get the labCreationParameters property: Settings related to creating a lab. - * - * @return the labCreationParameters value. - */ - public LabCreationParameters labCreationParameters() { - return this.labCreationParameters; - } - - /** - * Set the labCreationParameters property: Settings related to creating a lab. - * - * @param labCreationParameters the labCreationParameters value to set. - * @return the CreateLabProperties object itself. - */ - public CreateLabProperties withLabCreationParameters(LabCreationParameters labCreationParameters) { - this.labCreationParameters = labCreationParameters; - return this; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource. - * - * @param name the name value to set. - * @return the CreateLabProperties object itself. - */ - public CreateLabProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the location property: The location of the resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location of the resource. - * - * @param location the location value to set. - * @return the CreateLabProperties object itself. - */ - public CreateLabProperties 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 CreateLabProperties object itself. - */ - public CreateLabProperties withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (environmentSettingCreationParameters() != null) { - environmentSettingCreationParameters().validate(); - } - if (labCreationParameters() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property labCreationParameters in model CreateLabProperties")); - } else { - labCreationParameters().validate(); - } - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model CreateLabProperties")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateOption.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateOption.java new file mode 100644 index 0000000000000..b71b324c9c6e0 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/CreateOption.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for CreateOption. */ +public enum CreateOption { + /** Enum value Image. */ + IMAGE("Image"), + + /** Enum value TemplateVM. */ + TEMPLATE_VM("TemplateVM"); + + /** The actual serialized value for a CreateOption instance. */ + private final String value; + + CreateOption(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CreateOption instance. + * + * @param value the serialized value to parse. + * @return the parsed CreateOption object, or null if unable to parse. + */ + @JsonCreator + public static CreateOption fromString(String value) { + CreateOption[] items = CreateOption.values(); + for (CreateOption item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVmFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Credentials.java similarity index 54% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVmFragment.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Credentials.java index e59405dca589d..f771f84b95d8a 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVmFragment.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Credentials.java @@ -9,26 +9,26 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of a Reference Vm. */ +/** Credentials for a user on a lab VM. */ @Fluent -public final class ReferenceVmFragment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReferenceVmFragment.class); +public final class Credentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Credentials.class); /* - * The username of the virtual machine + * The username to use when signing in to lab VMs. */ - @JsonProperty(value = "userName") + @JsonProperty(value = "username", required = true) private String username; /* - * The password of the virtual machine. This will be set to null in GET - * resource API + * The password for the user. This is required for the TemplateVM + * createOption. */ @JsonProperty(value = "password") private String password; /** - * Get the username property: The username of the virtual machine. + * Get the username property: The username to use when signing in to lab VMs. * * @return the username value. */ @@ -37,18 +37,18 @@ public String username() { } /** - * Set the username property: The username of the virtual machine. + * Set the username property: The username to use when signing in to lab VMs. * * @param username the username value to set. - * @return the ReferenceVmFragment object itself. + * @return the Credentials object itself. */ - public ReferenceVmFragment withUsername(String username) { + public Credentials withUsername(String username) { this.username = username; return this; } /** - * Get the password property: The password of the virtual machine. This will be set to null in GET resource API. + * Get the password property: The password for the user. This is required for the TemplateVM createOption. * * @return the password value. */ @@ -57,12 +57,12 @@ public String password() { } /** - * Set the password property: The password of the virtual machine. This will be set to null in GET resource API. + * Set the password property: The password for the user. This is required for the TemplateVM createOption. * * @param password the password value to set. - * @return the ReferenceVmFragment object itself. + * @return the Credentials object itself. */ - public ReferenceVmFragment withPassword(String password) { + public Credentials withPassword(String password) { this.password = password; return this; } @@ -73,5 +73,10 @@ public ReferenceVmFragment withPassword(String password) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (username() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property username in model Credentials")); + } } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnableState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnableState.java new file mode 100644 index 0000000000000..4c0aae95c00cb --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnableState.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for EnableState. */ +public enum EnableState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a EnableState instance. */ + private final String value; + + EnableState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EnableState instance. + * + * @param value the serialized value to parse. + * @return the parsed EnableState object, or null if unable to parse. + */ + @JsonCreator + public static EnableState fromString(String value) { + EnableState[] items = EnableState.values(); + for (EnableState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environment.java deleted file mode 100644 index b3e8ee1362efd..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environment.java +++ /dev/null @@ -1,431 +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.labservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentInner; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of Environment. */ -public interface Environment { - /** - * 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 resourceSets property: The set of a VM and the setting id it was created for. - * - * @return the resourceSets value. - */ - ResourceSet resourceSets(); - - /** - * Gets the claimedByUserObjectId property: The AAD object Id of the user who has claimed the environment. - * - * @return the claimedByUserObjectId value. - */ - String claimedByUserObjectId(); - - /** - * Gets the claimedByUserPrincipalId property: The user principal Id of the user who has claimed the environment. - * - * @return the claimedByUserPrincipalId value. - */ - String claimedByUserPrincipalId(); - - /** - * Gets the claimedByUsername property: The name or email address of the user who has claimed the environment. - * - * @return the claimedByUsername value. - */ - String claimedByUsername(); - - /** - * Gets the isClaimed property: Is the environment claimed or not. - * - * @return the isClaimed value. - */ - Boolean isClaimed(); - - /** - * Gets the lastKnownPowerState property: Last known power state of the environment. - * - * @return the lastKnownPowerState value. - */ - String lastKnownPowerState(); - - /** - * Gets the networkInterface property: Network details of the environment. - * - * @return the networkInterface value. - */ - NetworkInterface networkInterface(); - - /** - * Gets the totalUsage property: How long the environment has been used by a lab user. - * - * @return the totalUsage value. - */ - Duration totalUsage(); - - /** - * Gets the passwordLastReset property: When the password was last reset on the environment. - * - * @return the passwordLastReset value. - */ - OffsetDateTime passwordLastReset(); - - /** - * 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 latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - LatestOperationResult latestOperationResult(); - - /** - * 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.labservices.fluent.models.EnvironmentInner object. - * - * @return the inner object. - */ - EnvironmentInner innerModel(); - - /** The entirety of the Environment definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { - } - /** The Environment definition stages. */ - interface DefinitionStages { - /** The first stage of the Environment definition. */ - interface Blank extends WithLocation { - } - /** The stage of the Environment 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 Environment definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, labAccountName, labName, environmentSettingName. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @return the next definition stage. - */ - WithCreate withExistingEnvironmentsetting( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - } - /** - * The stage of the Environment 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.WithResourceSets, - DefinitionStages.WithProvisioningState, - DefinitionStages.WithUniqueIdentifier { - /** - * Executes the create request. - * - * @return the created resource. - */ - Environment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Environment create(Context context); - } - /** The stage of the Environment 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 Environment definition allowing to specify resourceSets. */ - interface WithResourceSets { - /** - * Specifies the resourceSets property: The set of a VM and the setting id it was created for. - * - * @param resourceSets The set of a VM and the setting id it was created for. - * @return the next definition stage. - */ - WithCreate withResourceSets(ResourceSet resourceSets); - } - /** The stage of the Environment definition allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - WithCreate withProvisioningState(String provisioningState); - } - /** The stage of the Environment definition allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - WithCreate withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Begins update for the Environment resource. - * - * @return the stage of resource update. - */ - Environment.Update update(); - - /** The template for Environment update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithResourceSets, - UpdateStages.WithProvisioningState, - UpdateStages.WithUniqueIdentifier { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Environment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Environment apply(Context context); - } - /** The Environment update stages. */ - interface UpdateStages { - /** The stage of the Environment 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 Environment update allowing to specify resourceSets. */ - interface WithResourceSets { - /** - * Specifies the resourceSets property: The set of a VM and the setting id it was created for. - * - * @param resourceSets The set of a VM and the setting id it was created for. - * @return the next definition stage. - */ - Update withResourceSets(ResourceSetFragment resourceSets); - } - /** The stage of the Environment update allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - Update withProvisioningState(String provisioningState); - } - /** The stage of the Environment update allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - Update withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Environment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Environment refresh(Context context); - - /** - * Claims the environment and assigns it to the user. - * - * @throws com.azure.core.management.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 claim(); - - /** - * Claims the environment and assigns it to the user. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 claimWithResponse(Context context); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword(ResetPasswordPayload resetPasswordPayload); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword(ResetPasswordPayload resetPasswordPayload, Context context); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(Context context); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentDetails.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentDetails.java deleted file mode 100644 index d172a6f899fe3..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentDetails.java +++ /dev/null @@ -1,171 +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.labservices.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.Duration; -import java.time.OffsetDateTime; - -/** This represents the details about a User's environment and its state. */ -@Immutable -public final class EnvironmentDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentDetails.class); - - /* - * Name of the Environment - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Description of the Environment - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Resource Id of the environment - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The provisioning state of the environment. This also includes LabIsFull - * and NotYetProvisioned status. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Details of backing DTL virtual machine with compute and network details. - */ - @JsonProperty(value = "virtualMachineDetails", access = JsonProperty.Access.WRITE_ONLY) - private VirtualMachineDetails virtualMachineDetails; - - /* - * The details of the latest operation. ex: status, error - */ - @JsonProperty(value = "latestOperationResult", access = JsonProperty.Access.WRITE_ONLY) - private LatestOperationResult latestOperationResult; - - /* - * Publishing state of the environment setting Possible values are - * Creating, Created, Failed - */ - @JsonProperty(value = "environmentState", access = JsonProperty.Access.WRITE_ONLY) - private String environmentState; - - /* - * How long the environment has been used by a lab user - */ - @JsonProperty(value = "totalUsage", access = JsonProperty.Access.WRITE_ONLY) - private Duration totalUsage; - - /* - * When the password was last reset on the environment. - */ - @JsonProperty(value = "passwordLastReset", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime passwordLastReset; - - /** - * Get the name property: Name of the Environment. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the description property: Description of the Environment. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the id property: Resource Id of the environment. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the provisioningState property: The provisioning state of the environment. This also includes LabIsFull and - * NotYetProvisioned status. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the virtualMachineDetails property: Details of backing DTL virtual machine with compute and network details. - * - * @return the virtualMachineDetails value. - */ - public VirtualMachineDetails virtualMachineDetails() { - return this.virtualMachineDetails; - } - - /** - * Get the latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - public LatestOperationResult latestOperationResult() { - return this.latestOperationResult; - } - - /** - * Get the environmentState property: Publishing state of the environment setting Possible values are Creating, - * Created, Failed. - * - * @return the environmentState value. - */ - public String environmentState() { - return this.environmentState; - } - - /** - * Get the totalUsage property: How long the environment has been used by a lab user. - * - * @return the totalUsage value. - */ - public Duration totalUsage() { - return this.totalUsage; - } - - /** - * Get the passwordLastReset property: When the password was last reset on the environment. - * - * @return the passwordLastReset value. - */ - public OffsetDateTime passwordLastReset() { - return this.passwordLastReset; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachineDetails() != null) { - virtualMachineDetails().validate(); - } - if (latestOperationResult() != null) { - latestOperationResult().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentFragment.java deleted file mode 100644 index 4107f5c420ea3..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentFragment.java +++ /dev/null @@ -1,123 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Represents an environment instance. */ -@JsonFlatten -@Fluent -public class EnvironmentFragment extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentFragment.class); - - /* - * The set of a VM and the setting id it was created for - */ - @JsonProperty(value = "properties.resourceSets") - private ResourceSetFragment resourceSets; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /** - * Get the resourceSets property: The set of a VM and the setting id it was created for. - * - * @return the resourceSets value. - */ - public ResourceSetFragment resourceSets() { - return this.resourceSets; - } - - /** - * Set the resourceSets property: The set of a VM and the setting id it was created for. - * - * @param resourceSets the resourceSets value to set. - * @return the EnvironmentFragment object itself. - */ - public EnvironmentFragment withResourceSets(ResourceSetFragment resourceSets) { - this.resourceSets = resourceSets; - return this; - } - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the EnvironmentFragment object itself. - */ - public EnvironmentFragment withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the EnvironmentFragment object itself. - */ - public EnvironmentFragment withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentFragment withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentFragment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceSets() != null) { - resourceSets().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentOperationsPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentOperationsPayload.java deleted file mode 100644 index 22e4be0a1ce99..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentOperationsPayload.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Represents payload for any Environment operations like get, start, stop, connect. */ -@Fluent -public final class EnvironmentOperationsPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentOperationsPayload.class); - - /* - * The resourceId of the environment - */ - @JsonProperty(value = "environmentId", required = true) - private String environmentId; - - /** - * Get the environmentId property: The resourceId of the environment. - * - * @return the environmentId value. - */ - public String environmentId() { - return this.environmentId; - } - - /** - * Set the environmentId property: The resourceId of the environment. - * - * @param environmentId the environmentId value to set. - * @return the EnvironmentOperationsPayload object itself. - */ - public EnvironmentOperationsPayload withEnvironmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (environmentId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property environmentId in model EnvironmentOperationsPayload")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSetting.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSetting.java deleted file mode 100644 index 836930a22fe99..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSetting.java +++ /dev/null @@ -1,481 +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.labservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentSettingInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of EnvironmentSetting. */ -public interface EnvironmentSetting { - /** - * 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 publishingState property: Describes the readiness of this environment setting. - * - * @return the publishingState value. - */ - PublishingState publishingState(); - - /** - * Gets the configurationState property: Describes the user's progress in configuring their environment setting. - * - * @return the configurationState value. - */ - ConfigurationState configurationState(); - - /** - * Gets the description property: Describes the environment and its resource settings. - * - * @return the description value. - */ - String description(); - - /** - * Gets the title property: Brief title describing the environment and its resource settings. - * - * @return the title value. - */ - String title(); - - /** - * Gets the resourceSettings property: The resource specific settings. - * - * @return the resourceSettings value. - */ - ResourceSettings resourceSettings(); - - /** - * Gets the lastChanged property: Time when the template VM was last changed. - * - * @return the lastChanged value. - */ - OffsetDateTime lastChanged(); - - /** - * Gets the lastPublished property: Time when the template VM was last sent for publishing. - * - * @return the lastPublished value. - */ - OffsetDateTime lastPublished(); - - /** - * 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 latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - LatestOperationResult latestOperationResult(); - - /** - * 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.labservices.fluent.models.EnvironmentSettingInner object. - * - * @return the inner object. - */ - EnvironmentSettingInner innerModel(); - - /** The entirety of the EnvironmentSetting definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { - } - /** The EnvironmentSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the EnvironmentSetting definition. */ - interface Blank extends WithLocation { - } - /** The stage of the EnvironmentSetting 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 EnvironmentSetting definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, labAccountName, labName. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @return the next definition stage. - */ - WithCreate withExistingLab(String resourceGroupName, String labAccountName, String labName); - } - /** - * The stage of the EnvironmentSetting 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.WithConfigurationState, - DefinitionStages.WithDescription, - DefinitionStages.WithTitle, - DefinitionStages.WithResourceSettings, - DefinitionStages.WithProvisioningState, - DefinitionStages.WithUniqueIdentifier { - /** - * Executes the create request. - * - * @return the created resource. - */ - EnvironmentSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - EnvironmentSetting create(Context context); - } - /** The stage of the EnvironmentSetting 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 EnvironmentSetting definition allowing to specify configurationState. */ - interface WithConfigurationState { - /** - * Specifies the configurationState property: Describes the user's progress in configuring their environment - * setting. - * - * @param configurationState Describes the user's progress in configuring their environment setting. - * @return the next definition stage. - */ - WithCreate withConfigurationState(ConfigurationState configurationState); - } - /** The stage of the EnvironmentSetting definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: Describes the environment and its resource settings. - * - * @param description Describes the environment and its resource settings. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - /** The stage of the EnvironmentSetting definition allowing to specify title. */ - interface WithTitle { - /** - * Specifies the title property: Brief title describing the environment and its resource settings. - * - * @param title Brief title describing the environment and its resource settings. - * @return the next definition stage. - */ - WithCreate withTitle(String title); - } - /** The stage of the EnvironmentSetting definition allowing to specify resourceSettings. */ - interface WithResourceSettings { - /** - * Specifies the resourceSettings property: The resource specific settings. - * - * @param resourceSettings The resource specific settings. - * @return the next definition stage. - */ - WithCreate withResourceSettings(ResourceSettings resourceSettings); - } - /** The stage of the EnvironmentSetting definition allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - WithCreate withProvisioningState(String provisioningState); - } - /** The stage of the EnvironmentSetting definition allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - WithCreate withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Begins update for the EnvironmentSetting resource. - * - * @return the stage of resource update. - */ - EnvironmentSetting.Update update(); - - /** The template for EnvironmentSetting update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithConfigurationState, - UpdateStages.WithDescription, - UpdateStages.WithTitle, - UpdateStages.WithResourceSettings, - UpdateStages.WithProvisioningState, - UpdateStages.WithUniqueIdentifier { - /** - * Executes the update request. - * - * @return the updated resource. - */ - EnvironmentSetting apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - EnvironmentSetting apply(Context context); - } - /** The EnvironmentSetting update stages. */ - interface UpdateStages { - /** The stage of the EnvironmentSetting 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 EnvironmentSetting update allowing to specify configurationState. */ - interface WithConfigurationState { - /** - * Specifies the configurationState property: Describes the user's progress in configuring their environment - * setting. - * - * @param configurationState Describes the user's progress in configuring their environment setting. - * @return the next definition stage. - */ - Update withConfigurationState(ConfigurationState configurationState); - } - /** The stage of the EnvironmentSetting update allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: Describes the environment and its resource settings. - * - * @param description Describes the environment and its resource settings. - * @return the next definition stage. - */ - Update withDescription(String description); - } - /** The stage of the EnvironmentSetting update allowing to specify title. */ - interface WithTitle { - /** - * Specifies the title property: Brief title describing the environment and its resource settings. - * - * @param title Brief title describing the environment and its resource settings. - * @return the next definition stage. - */ - Update withTitle(String title); - } - /** The stage of the EnvironmentSetting update allowing to specify resourceSettings. */ - interface WithResourceSettings { - /** - * Specifies the resourceSettings property: The resource specific settings. - * - * @param resourceSettings The resource specific settings. - * @return the next definition stage. - */ - Update withResourceSettings(ResourceSettingsFragment resourceSettings); - } - /** The stage of the EnvironmentSetting update allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - Update withProvisioningState(String provisioningState); - } - /** The stage of the EnvironmentSetting update allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - Update withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - EnvironmentSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - EnvironmentSetting refresh(Context context); - - /** - * Claims a random environment for a user in an environment settings. - * - * @throws com.azure.core.management.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 claimAny(); - - /** - * Claims a random environment for a user in an environment settings. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 claimAnyWithResponse(Context context); - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 publish(PublishPayload publishPayload); - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 publishWithResponse(PublishPayload publishPayload, Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingCreationParameters.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingCreationParameters.java deleted file mode 100644 index 3ec6cf841c734..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingCreationParameters.java +++ /dev/null @@ -1,60 +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.labservices.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; - -/** Settings related to creating an environment setting. */ -@Fluent -public final class EnvironmentSettingCreationParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentSettingCreationParameters.class); - - /* - * The resource specific settings - */ - @JsonProperty(value = "resourceSettingCreationParameters", required = true) - private ResourceSettingCreationParameters resourceSettingCreationParameters; - - /** - * Get the resourceSettingCreationParameters property: The resource specific settings. - * - * @return the resourceSettingCreationParameters value. - */ - public ResourceSettingCreationParameters resourceSettingCreationParameters() { - return this.resourceSettingCreationParameters; - } - - /** - * Set the resourceSettingCreationParameters property: The resource specific settings. - * - * @param resourceSettingCreationParameters the resourceSettingCreationParameters value to set. - * @return the EnvironmentSettingCreationParameters object itself. - */ - public EnvironmentSettingCreationParameters withResourceSettingCreationParameters( - ResourceSettingCreationParameters resourceSettingCreationParameters) { - this.resourceSettingCreationParameters = resourceSettingCreationParameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceSettingCreationParameters() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property resourceSettingCreationParameters in model" - + " EnvironmentSettingCreationParameters")); - } else { - resourceSettingCreationParameters().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingFragment.java deleted file mode 100644 index 696bc09971de6..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettingFragment.java +++ /dev/null @@ -1,201 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Represents settings of an environment, from which environment instances would be created. */ -@JsonFlatten -@Fluent -public class EnvironmentSettingFragment extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentSettingFragment.class); - - /* - * Describes the user's progress in configuring their environment setting - */ - @JsonProperty(value = "properties.configurationState") - private ConfigurationState configurationState; - - /* - * Describes the environment and its resource settings - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * Brief title describing the environment and its resource settings - */ - @JsonProperty(value = "properties.title") - private String title; - - /* - * The resource specific settings - */ - @JsonProperty(value = "properties.resourceSettings") - private ResourceSettingsFragment resourceSettings; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /** - * Get the configurationState property: Describes the user's progress in configuring their environment setting. - * - * @return the configurationState value. - */ - public ConfigurationState configurationState() { - return this.configurationState; - } - - /** - * Set the configurationState property: Describes the user's progress in configuring their environment setting. - * - * @param configurationState the configurationState value to set. - * @return the EnvironmentSettingFragment object itself. - */ - public EnvironmentSettingFragment withConfigurationState(ConfigurationState configurationState) { - this.configurationState = configurationState; - return this; - } - - /** - * Get the description property: Describes the environment and its resource settings. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Describes the environment and its resource settings. - * - * @param description the description value to set. - * @return the EnvironmentSettingFragment object itself. - */ - public EnvironmentSettingFragment withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the title property: Brief title describing the environment and its resource settings. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Brief title describing the environment and its resource settings. - * - * @param title the title value to set. - * @return the EnvironmentSettingFragment object itself. - */ - public EnvironmentSettingFragment withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the resourceSettings property: The resource specific settings. - * - * @return the resourceSettings value. - */ - public ResourceSettingsFragment resourceSettings() { - return this.resourceSettings; - } - - /** - * Set the resourceSettings property: The resource specific settings. - * - * @param resourceSettings the resourceSettings value to set. - * @return the EnvironmentSettingFragment object itself. - */ - public EnvironmentSettingFragment withResourceSettings(ResourceSettingsFragment resourceSettings) { - this.resourceSettings = resourceSettings; - return this; - } - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the EnvironmentSettingFragment object itself. - */ - public EnvironmentSettingFragment withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the EnvironmentSettingFragment object itself. - */ - public EnvironmentSettingFragment withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentSettingFragment withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public EnvironmentSettingFragment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceSettings() != null) { - resourceSettings().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettings.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettings.java deleted file mode 100644 index 192c038496d16..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSettings.java +++ /dev/null @@ -1,313 +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.labservices.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 EnvironmentSettings. */ -public interface EnvironmentSettings { - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @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 the response of a list operation. - */ - PagedIterable list(String resourceGroupName, String labAccountName, String labName); - - /** - * List environment setting in a given lab. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 setting. - */ - EnvironmentSetting get( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Get environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 setting. - */ - Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - Context context); - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, String labName, String environmentSettingName); - - /** - * Delete environment setting. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 claimAny(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Claims a random environment for a user in an environment settings. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 claimAnyWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 publish( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload); - - /** - * Provisions/deprovisions required resources for an environment setting based on current state of the - * lab/environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param publishPayload Payload for Publish operation on EnvironmentSetting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 publishWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - PublishPayload publishPayload, - Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * Starts a template by starting all resources inside the template. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - Context context); - - /** - * Get environment setting. - * - * @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 environment setting. - */ - EnvironmentSetting getById(String id); - - /** - * Get environment setting. - * - * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=publishingState)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 setting. - */ - Response getByIdWithResponse(String id, String expand, Context context); - - /** - * Delete environment setting. 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 environment setting. 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 EnvironmentSetting resource. - * - * @param name resource name. - * @return the first stage of the new EnvironmentSetting definition. - */ - EnvironmentSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSize.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSize.java deleted file mode 100644 index 4862fd1044b56..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSize.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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.math.BigDecimal; -import java.util.List; - -/** Represents a size category supported by this Lab Account (small, medium or large). */ -@Fluent -public final class EnvironmentSize { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentSize.class); - - /* - * The size category - */ - @JsonProperty(value = "name") - private ManagedLabVmSize name; - - /* - * Represents a set of compute sizes that can serve this given size type - */ - @JsonProperty(value = "vmSizes") - private List vmSizes; - - /* - * The pay-as-you-go dollar price per hour this size will cost. It does not - * include discounts and may not reflect the actual price the size will - * cost. This is the maximum price of all prices within this tier. - */ - @JsonProperty(value = "maxPrice", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal maxPrice; - - /* - * The number of cores a VM of this size has. This is the minimum number of - * cores within this tier. - */ - @JsonProperty(value = "minNumberOfCores", access = JsonProperty.Access.WRITE_ONLY) - private Integer minNumberOfCores; - - /* - * The amount of memory available (in GB). This is the minimum amount of - * memory within this tier. - */ - @JsonProperty(value = "minMemory", access = JsonProperty.Access.WRITE_ONLY) - private Double minMemory; - - /** - * Get the name property: The size category. - * - * @return the name value. - */ - public ManagedLabVmSize name() { - return this.name; - } - - /** - * Set the name property: The size category. - * - * @param name the name value to set. - * @return the EnvironmentSize object itself. - */ - public EnvironmentSize withName(ManagedLabVmSize name) { - this.name = name; - return this; - } - - /** - * Get the vmSizes property: Represents a set of compute sizes that can serve this given size type. - * - * @return the vmSizes value. - */ - public List vmSizes() { - return this.vmSizes; - } - - /** - * Set the vmSizes property: Represents a set of compute sizes that can serve this given size type. - * - * @param vmSizes the vmSizes value to set. - * @return the EnvironmentSize object itself. - */ - public EnvironmentSize withVmSizes(List vmSizes) { - this.vmSizes = vmSizes; - return this; - } - - /** - * Get the maxPrice property: The pay-as-you-go dollar price per hour this size will cost. It does not include - * discounts and may not reflect the actual price the size will cost. This is the maximum price of all prices within - * this tier. - * - * @return the maxPrice value. - */ - public BigDecimal maxPrice() { - return this.maxPrice; - } - - /** - * Get the minNumberOfCores property: The number of cores a VM of this size has. This is the minimum number of cores - * within this tier. - * - * @return the minNumberOfCores value. - */ - public Integer minNumberOfCores() { - return this.minNumberOfCores; - } - - /** - * Get the minMemory property: The amount of memory available (in GB). This is the minimum amount of memory within - * this tier. - * - * @return the minMemory value. - */ - public Double minMemory() { - return this.minMemory; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmSizes() != null) { - vmSizes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSizeFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSizeFragment.java deleted file mode 100644 index fd2aeb9b08ca0..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/EnvironmentSizeFragment.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a size category supported by this Lab Account (small, medium or large). */ -@Fluent -public final class EnvironmentSizeFragment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentSizeFragment.class); - - /* - * The size category - */ - @JsonProperty(value = "name") - private ManagedLabVmSize name; - - /* - * Represents a set of compute sizes that can serve this given size type - */ - @JsonProperty(value = "vmSizes") - private List vmSizes; - - /** - * Get the name property: The size category. - * - * @return the name value. - */ - public ManagedLabVmSize name() { - return this.name; - } - - /** - * Set the name property: The size category. - * - * @param name the name value to set. - * @return the EnvironmentSizeFragment object itself. - */ - public EnvironmentSizeFragment withName(ManagedLabVmSize name) { - this.name = name; - return this; - } - - /** - * Get the vmSizes property: Represents a set of compute sizes that can serve this given size type. - * - * @return the vmSizes value. - */ - public List vmSizes() { - return this.vmSizes; - } - - /** - * Set the vmSizes property: Represents a set of compute sizes that can serve this given size type. - * - * @param vmSizes the vmSizes value to set. - * @return the EnvironmentSizeFragment object itself. - */ - public EnvironmentSizeFragment withVmSizes(List vmSizes) { - this.vmSizes = vmSizes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (vmSizes() != null) { - vmSizes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environments.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environments.java deleted file mode 100644 index cdb5145a1b425..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Environments.java +++ /dev/null @@ -1,361 +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.labservices.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 Environments. */ -public interface Environments { - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - PagedIterable list( - String resourceGroupName, String labAccountName, String labName, String environmentSettingName); - - /** - * List environments in a given environment setting. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String expand, - String filter, - Integer top, - String orderby, - Context context); - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Environment get( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Get environment. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - String expand, - Context context); - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Delete environment. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 claim( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Claims the environment and assigns it to the user. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 claimWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - ResetPasswordPayload resetPasswordPayload, - Context context); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param environmentSettingName The name of the environment Setting. - * @param environmentName The name of the environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop( - String resourceGroupName, - String labAccountName, - String labName, - String environmentSettingName, - String environmentName, - Context context); - - /** - * Get environment. - * - * @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 environment. - */ - Environment getById(String id); - - /** - * Get environment. - * - * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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. - */ - Response getByIdWithResponse(String id, String expand, Context context); - - /** - * Delete environment. 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 environment. 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 Environment resource. - * - * @param name resource name. - * @return the first stage of the new Environment definition. - */ - Environment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImage.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImage.java deleted file mode 100644 index a6f4f9a47aaa6..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImage.java +++ /dev/null @@ -1,394 +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.labservices.models; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.GalleryImageInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of GalleryImage. */ -public interface GalleryImage { - /** - * 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 author property: The author of the gallery image. - * - * @return the author value. - */ - String author(); - - /** - * Gets the createdDate property: The creation date of the gallery image. - * - * @return the createdDate value. - */ - OffsetDateTime createdDate(); - - /** - * Gets the description property: The description of the gallery image. - * - * @return the description value. - */ - 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. - * - * @return the icon value. - */ - String icon(); - - /** - * Gets the isEnabled property: Indicates whether this gallery image is enabled. - * - * @return the isEnabled value. - */ - Boolean isEnabled(); - - /** - * Gets the isOverride property: Indicates whether this gallery has been overridden for this lab account. - * - * @return the isOverride value. - */ - Boolean isOverride(); - - /** - * Gets the planId property: The third party plan that applies to this image. - * - * @return the planId value. - */ - String planId(); - - /** - * Gets the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic deployment. - * - * @return the isPlanAuthorized value. - */ - Boolean isPlanAuthorized(); - - /** - * 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 latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - LatestOperationResult latestOperationResult(); - - /** - * 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.labservices.fluent.models.GalleryImageInner object. - * - * @return the inner object. - */ - GalleryImageInner innerModel(); - - /** The entirety of the GalleryImage definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { - } - /** The GalleryImage definition stages. */ - interface DefinitionStages { - /** The first stage of the GalleryImage definition. */ - interface Blank extends WithLocation { - } - /** The stage of the GalleryImage 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 GalleryImage definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, labAccountName. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @return the next definition stage. - */ - WithCreate withExistingLabaccount(String resourceGroupName, String labAccountName); - } - /** - * The stage of the GalleryImage 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.WithIsEnabled, - DefinitionStages.WithIsOverride, - DefinitionStages.WithIsPlanAuthorized, - DefinitionStages.WithProvisioningState, - DefinitionStages.WithUniqueIdentifier { - /** - * Executes the create request. - * - * @return the created resource. - */ - GalleryImage create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - GalleryImage create(Context context); - } - /** The stage of the GalleryImage 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 GalleryImage definition allowing to specify isEnabled. */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether this gallery image is enabled.. - * - * @param isEnabled Indicates whether this gallery image is enabled. - * @return the next definition stage. - */ - WithCreate withIsEnabled(Boolean isEnabled); - } - /** The stage of the GalleryImage definition allowing to specify isOverride. */ - interface WithIsOverride { - /** - * Specifies the isOverride property: Indicates whether this gallery has been overridden for this lab - * account. - * - * @param isOverride Indicates whether this gallery has been overridden for this lab account. - * @return the next definition stage. - */ - WithCreate withIsOverride(Boolean isOverride); - } - /** The stage of the GalleryImage definition allowing to specify isPlanAuthorized. */ - interface WithIsPlanAuthorized { - /** - * Specifies the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic - * deployment.. - * - * @param isPlanAuthorized Indicates if the plan has been authorized for programmatic deployment. - * @return the next definition stage. - */ - WithCreate withIsPlanAuthorized(Boolean isPlanAuthorized); - } - /** The stage of the GalleryImage definition allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - WithCreate withProvisioningState(String provisioningState); - } - /** The stage of the GalleryImage definition allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - WithCreate withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Begins update for the GalleryImage resource. - * - * @return the stage of resource update. - */ - GalleryImage.Update update(); - - /** The template for GalleryImage update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithIsEnabled, - UpdateStages.WithIsOverride, - UpdateStages.WithIsPlanAuthorized, - UpdateStages.WithProvisioningState, - UpdateStages.WithUniqueIdentifier { - /** - * Executes the update request. - * - * @return the updated resource. - */ - GalleryImage apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - GalleryImage apply(Context context); - } - /** The GalleryImage update stages. */ - interface UpdateStages { - /** The stage of the GalleryImage 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 GalleryImage update allowing to specify isEnabled. */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether this gallery image is enabled.. - * - * @param isEnabled Indicates whether this gallery image is enabled. - * @return the next definition stage. - */ - Update withIsEnabled(Boolean isEnabled); - } - /** The stage of the GalleryImage update allowing to specify isOverride. */ - interface WithIsOverride { - /** - * Specifies the isOverride property: Indicates whether this gallery has been overridden for this lab - * account. - * - * @param isOverride Indicates whether this gallery has been overridden for this lab account. - * @return the next definition stage. - */ - Update withIsOverride(Boolean isOverride); - } - /** The stage of the GalleryImage update allowing to specify isPlanAuthorized. */ - interface WithIsPlanAuthorized { - /** - * Specifies the isPlanAuthorized property: Indicates if the plan has been authorized for programmatic - * deployment.. - * - * @param isPlanAuthorized Indicates if the plan has been authorized for programmatic deployment. - * @return the next definition stage. - */ - Update withIsPlanAuthorized(Boolean isPlanAuthorized); - } - /** The stage of the GalleryImage update allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - Update withProvisioningState(String provisioningState); - } - /** The stage of the GalleryImage update allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - Update withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - GalleryImage refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - GalleryImage refresh(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImageFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImageFragment.java deleted file mode 100644 index f95fda97031a0..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImageFragment.java +++ /dev/null @@ -1,172 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Represents an image from the Azure Marketplace. */ -@JsonFlatten -@Fluent -public class GalleryImageFragment extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageFragment.class); - - /* - * Indicates whether this gallery image is enabled. - */ - @JsonProperty(value = "properties.isEnabled") - private Boolean isEnabled; - - /* - * Indicates whether this gallery has been overridden for this lab account - */ - @JsonProperty(value = "properties.isOverride") - private Boolean isOverride; - - /* - * Indicates if the plan has been authorized for programmatic deployment. - */ - @JsonProperty(value = "properties.isPlanAuthorized") - private Boolean isPlanAuthorized; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /** - * Get the isEnabled property: Indicates whether this gallery image is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether this gallery image is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the GalleryImageFragment object itself. - */ - public GalleryImageFragment withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the isOverride property: Indicates whether this gallery has been overridden for this lab account. - * - * @return the isOverride value. - */ - public Boolean isOverride() { - return this.isOverride; - } - - /** - * Set the isOverride property: Indicates whether this gallery has been overridden for this lab account. - * - * @param isOverride the isOverride value to set. - * @return the GalleryImageFragment object itself. - */ - public GalleryImageFragment withIsOverride(Boolean isOverride) { - this.isOverride = isOverride; - 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 GalleryImageFragment object itself. - */ - public GalleryImageFragment 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; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the GalleryImageFragment object itself. - */ - public GalleryImageFragment withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the GalleryImageFragment object itself. - */ - public GalleryImageFragment withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageFragment withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public GalleryImageFragment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetEnvironmentResponse.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetEnvironmentResponse.java deleted file mode 100644 index ddd41cdac2720..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetEnvironmentResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.GetEnvironmentResponseInner; - -/** An immutable client-side representation of GetEnvironmentResponse. */ -public interface GetEnvironmentResponse { - /** - * Gets the environment property: Details of the environment. - * - * @return the environment value. - */ - EnvironmentDetails environment(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.GetEnvironmentResponseInner object. - * - * @return the inner object. - */ - GetEnvironmentResponseInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetPersonalPreferencesResponse.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetPersonalPreferencesResponse.java deleted file mode 100644 index 97a6ae6e82a15..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetPersonalPreferencesResponse.java +++ /dev/null @@ -1,32 +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.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.GetPersonalPreferencesResponseInner; -import java.util.List; - -/** An immutable client-side representation of GetPersonalPreferencesResponse. */ -public interface GetPersonalPreferencesResponse { - /** - * Gets the id property: Id to be used by the cache orchestrator. - * - * @return the id value. - */ - String id(); - - /** - * Gets the favoriteLabResourceIds property: Array of favorite lab resource ids. - * - * @return the favoriteLabResourceIds value. - */ - List favoriteLabResourceIds(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.GetPersonalPreferencesResponseInner object. - * - * @return the inner object. - */ - GetPersonalPreferencesResponseInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetRegionalAvailabilityResponse.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetRegionalAvailabilityResponse.java deleted file mode 100644 index 6e3c9a3f1c732..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GetRegionalAvailabilityResponse.java +++ /dev/null @@ -1,25 +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.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.GetRegionalAvailabilityResponseInner; -import java.util.List; - -/** An immutable client-side representation of GetRegionalAvailabilityResponse. */ -public interface GetRegionalAvailabilityResponse { - /** - * Gets the regionalAvailability property: Availability information for different size categories per region. - * - * @return the regionalAvailability value. - */ - List regionalAvailability(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.GetRegionalAvailabilityResponseInner object. - * - * @return the inner object. - */ - GetRegionalAvailabilityResponseInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GlobalUsers.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GlobalUsers.java deleted file mode 100644 index 5068a04dc55de..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GlobalUsers.java +++ /dev/null @@ -1,272 +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.labservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of GlobalUsers. */ -public interface GlobalUsers { - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - GetEnvironmentResponse getEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Gets the virtual machine details. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param expand Specify the $expand query. Example: 'properties($expand=environment)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the virtual machine details. - */ - Response getEnvironmentWithResponse( - String username, EnvironmentOperationsPayload environmentOperationsPayload, String expand, Context context); - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - OperationBatchStatusResponse getOperationBatchStatus( - String username, OperationBatchStatusPayload operationBatchStatusPayload); - - /** - * Get batch operation status. - * - * @param username The name of the user. - * @param operationBatchStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return batch operation status. - */ - Response getOperationBatchStatusWithResponse( - String username, OperationBatchStatusPayload operationBatchStatusPayload, Context context); - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - OperationStatusResponse getOperationStatus(String username, OperationStatusPayload operationStatusPayload); - - /** - * Gets the status of long running operation. - * - * @param username The name of the user. - * @param operationStatusPayload Payload to get the status of an operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of long running operation. - */ - Response getOperationStatusWithResponse( - String username, OperationStatusPayload operationStatusPayload, Context context); - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - GetPersonalPreferencesResponse getPersonalPreferences( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload); - - /** - * Get personal preferences for a user. - * - * @param username The name of the user. - * @param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, - * stop, connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return personal preferences for a user. - */ - Response getPersonalPreferencesWithResponse( - String username, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, Context context); - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - ListEnvironmentsResponse listEnvironments(String username, ListEnvironmentsPayload listEnvironmentsPayload); - - /** - * List Environments for the user. - * - * @param username The name of the user. - * @param listEnvironmentsPayload Represents the payload to list environments owned by a user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents the list of environments owned by a user. - */ - Response listEnvironmentsWithResponse( - String username, ListEnvironmentsPayload listEnvironmentsPayload, Context context); - - /** - * List labs for the user. - * - * @param username The name of the user. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - ListLabsResponse listLabs(String username); - - /** - * List labs for the user. - * - * @param username The name of the user. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return lists the labs owned by a user. - */ - Response listLabsWithResponse(String username, Context context); - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 register(String username, RegisterPayload registerPayload); - - /** - * Register a user to a managed lab. - * - * @param username The name of the user. - * @param registerPayload Represents payload for Register action. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 registerWithResponse(String username, RegisterPayload registerPayload, Context context); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword(String username, ResetPasswordPayload resetPasswordPayload); - - /** - * Resets the user password on an environment This operation can take a while to complete. - * - * @param username The name of the user. - * @param resetPasswordPayload Represents the payload for resetting passwords. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resetPassword(String username, ResetPasswordPayload resetPasswordPayload, Context context); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 startEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Starts an environment by starting all resources inside the environment. This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 startEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stopEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload); - - /** - * Stops an environment by stopping all resources inside the environment This operation can take a while to - * complete. - * - * @param username The name of the user. - * @param environmentOperationsPayload Represents payload for any Environment operations like get, start, stop, - * connect. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stopEnvironment(String username, EnvironmentOperationsPayload environmentOperationsPayload, Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Image.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Image.java new file mode 100644 index 0000000000000..b90c5af8656aa --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Image.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.ImageInner; +import java.util.List; + +/** An immutable client-side representation of Image. */ +public interface Image { + /** + * 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: Metadata pertaining to creation and last modification of the image. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Current provisioning state of the image. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the displayName property: The image display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: A description of the image. + * + * @return the description value. + */ + String description(); + + /** + * Gets the iconUrl property: URL of the image icon. + * + * @return the iconUrl value. + */ + String iconUrl(); + + /** + * Gets the author property: The image author. + * + * @return the author value. + */ + String author(); + + /** + * Gets the osType property: The OS Type of the image. + * + * @return the osType value. + */ + OsType osType(); + + /** + * Gets the plan property: The ID of marketplace plan associated with the image (optional). + * + * @return the plan value. + */ + String plan(); + + /** + * Gets the termsStatus property: The status of image terms of use (enabled = accepted, disabled = not accepted). + * + * @return the termsStatus value. + */ + EnableState termsStatus(); + + /** + * Gets the offer property: The ID of an offer associated with the image. + * + * @return the offer value. + */ + String offer(); + + /** + * Gets the publisher property: The ID of the publisher of the image. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the sku property: The image SKU. + * + * @return the sku value. + */ + String sku(); + + /** + * Gets the version property: The image version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the sharedGalleryId property: The ID for the image in the shared gallery. + * + * @return the sharedGalleryId value. + */ + String sharedGalleryId(); + + /** + * Gets the availableRegions property: The available regions of the image in the shared gallery. + * + * @return the availableRegions value. + */ + List availableRegions(); + + /** + * Gets the osState property: The OS State of the image. + * + * @return the osState value. + */ + OsState osState(); + + /** + * Gets the enabledState property: Is the image enabled. + * + * @return the enabledState value. + */ + EnableState enabledState(); + + /** + * Gets the inner com.azure.resourcemanager.labservices.fluent.models.ImageInner object. + * + * @return the inner object. + */ + ImageInner innerModel(); + + /** The entirety of the Image definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Image definition stages. */ + interface DefinitionStages { + /** The first stage of the Image definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Image definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, labPlanName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. + * Used in resource URIs and in UI. + * @return the next definition stage. + */ + WithCreate withExistingLabPlan(String resourceGroupName, String labPlanName); + } + /** + * The stage of the Image 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.WithAvailableRegions, DefinitionStages.WithEnabledState { + /** + * Executes the create request. + * + * @return the created resource. + */ + Image create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Image create(Context context); + } + /** The stage of the Image definition allowing to specify availableRegions. */ + interface WithAvailableRegions { + /** + * Specifies the availableRegions property: The available regions of the image in the shared gallery.. + * + * @param availableRegions The available regions of the image in the shared gallery. + * @return the next definition stage. + */ + WithCreate withAvailableRegions(List availableRegions); + } + /** The stage of the Image definition allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Is the image enabled. + * + * @param enabledState Is the image enabled. + * @return the next definition stage. + */ + WithCreate withEnabledState(EnableState enabledState); + } + } + /** + * Begins update for the Image resource. + * + * @return the stage of resource update. + */ + Image.Update update(); + + /** The template for Image update. */ + interface Update extends UpdateStages.WithEnabledState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Image apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Image apply(Context context); + } + /** The Image update stages. */ + interface UpdateStages { + /** The stage of the Image update allowing to specify enabledState. */ + interface WithEnabledState { + /** + * Specifies the enabledState property: Is the image enabled. + * + * @param enabledState Is the image enabled. + * @return the next definition stage. + */ + Update withEnabledState(EnableState enabledState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Image refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Image refresh(Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImageReference.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageReference.java similarity index 51% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImageReference.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageReference.java index 58aa26599e2eb..1af0ae7578b26 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImageReference.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageReference.java @@ -9,43 +9,69 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The reference information for an Azure Marketplace image. */ +/** Image reference information. Used in the virtual machine profile. */ @Fluent -public final class GalleryImageReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GalleryImageReference.class); +public final class ImageReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageReference.class); /* - * The offer of the gallery image. + * Image resource ID + */ + @JsonProperty(value = "id") + private String id; + + /* + * The image offer if applicable. */ @JsonProperty(value = "offer") private String offer; /* - * The publisher of the gallery image. + * The image publisher */ @JsonProperty(value = "publisher") private String publisher; /* - * The SKU of the gallery image. + * The image SKU */ @JsonProperty(value = "sku") private String sku; /* - * The OS type of the gallery image. + * The image version specified on creation. */ - @JsonProperty(value = "osType") - private String osType; + @JsonProperty(value = "version") + private String version; /* - * The version of the gallery image. + * The actual version of the image after use. */ - @JsonProperty(value = "version") - private String version; + @JsonProperty(value = "exactVersion", access = JsonProperty.Access.WRITE_ONLY) + private String exactVersion; + + /** + * Get the id property: Image resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Image resource ID. + * + * @param id the id value to set. + * @return the ImageReference object itself. + */ + public ImageReference withId(String id) { + this.id = id; + return this; + } /** - * Get the offer property: The offer of the gallery image. + * Get the offer property: The image offer if applicable. * * @return the offer value. */ @@ -54,18 +80,18 @@ public String offer() { } /** - * Set the offer property: The offer of the gallery image. + * Set the offer property: The image offer if applicable. * * @param offer the offer value to set. - * @return the GalleryImageReference object itself. + * @return the ImageReference object itself. */ - public GalleryImageReference withOffer(String offer) { + public ImageReference withOffer(String offer) { this.offer = offer; return this; } /** - * Get the publisher property: The publisher of the gallery image. + * Get the publisher property: The image publisher. * * @return the publisher value. */ @@ -74,18 +100,18 @@ public String publisher() { } /** - * Set the publisher property: The publisher of the gallery image. + * Set the publisher property: The image publisher. * * @param publisher the publisher value to set. - * @return the GalleryImageReference object itself. + * @return the ImageReference object itself. */ - public GalleryImageReference withPublisher(String publisher) { + public ImageReference withPublisher(String publisher) { this.publisher = publisher; return this; } /** - * Get the sku property: The SKU of the gallery image. + * Get the sku property: The image SKU. * * @return the sku value. */ @@ -94,38 +120,18 @@ public String sku() { } /** - * Set the sku property: The SKU of the gallery image. + * Set the sku property: The image SKU. * * @param sku the sku value to set. - * @return the GalleryImageReference object itself. + * @return the ImageReference object itself. */ - public GalleryImageReference withSku(String sku) { + public ImageReference withSku(String sku) { this.sku = sku; return this; } /** - * Get the osType property: The OS type of the gallery image. - * - * @return the osType value. - */ - public String osType() { - return this.osType; - } - - /** - * Set the osType property: The OS type of the gallery image. - * - * @param osType the osType value to set. - * @return the GalleryImageReference object itself. - */ - public GalleryImageReference withOsType(String osType) { - this.osType = osType; - return this; - } - - /** - * Get the version property: The version of the gallery image. + * Get the version property: The image version specified on creation. * * @return the version value. */ @@ -134,16 +140,25 @@ public String version() { } /** - * Set the version property: The version of the gallery image. + * Set the version property: The image version specified on creation. * * @param version the version value to set. - * @return the GalleryImageReference object itself. + * @return the ImageReference object itself. */ - public GalleryImageReference withVersion(String version) { + public ImageReference withVersion(String version) { this.version = version; return this; } + /** + * Get the exactVersion property: The actual version of the image after use. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + /** * Validates the instance. * diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageUpdate.java new file mode 100644 index 0000000000000..bc2c12d2b6457 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ImageUpdate.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.ImageUpdateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lab services virtual machine image for updates. */ +@Fluent +public final class ImageUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageUpdate.class); + + /* + * Image resource properties + */ + @JsonProperty(value = "properties") + private ImageUpdateProperties innerProperties; + + /** + * Get the innerProperties property: Image resource properties. + * + * @return the innerProperties value. + */ + private ImageUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the enabledState property: Is the image enabled. + * + * @return the enabledState value. + */ + public EnableState enabledState() { + return this.innerProperties() == null ? null : this.innerProperties().enabledState(); + } + + /** + * Set the enabledState property: Is the image enabled. + * + * @param enabledState the enabledState value to set. + * @return the ImageUpdate object itself. + */ + public ImageUpdate withEnabledState(EnableState enabledState) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageUpdateProperties(); + } + this.innerProperties().withEnabledState(enabledState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Images.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Images.java new file mode 100644 index 0000000000000..4bf6d4b5e6041 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Images.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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 Images. */ +public interface Images { + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + PagedIterable listByLabPlan(String resourceGroupName, String labPlanName); + + /** + * Gets all images from galleries attached to a lab plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all images from galleries attached to a lab plan. + */ + PagedIterable listByLabPlan(String resourceGroupName, String labPlanName, String filter, Context context); + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image resource. + */ + Image get(String resourceGroupName, String labPlanName, String imageName); + + /** + * Gets an image resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param imageName The image name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an image resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String labPlanName, String imageName, Context context); + + /** + * Gets an image resource. + * + * @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 an image resource along with {@link Response}. + */ + Image getById(String id); + + /** + * Gets an image resource. + * + * @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 an image resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Image resource. + * + * @param name resource name. + * @return the first stage of the new Image definition. + */ + Image.DefinitionStages.Blank define(String name); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InvitationState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InvitationState.java new file mode 100644 index 0000000000000..ae6383ad0eaaf --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InvitationState.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for InvitationState. */ +public enum InvitationState { + /** Enum value NotSent. */ + NOT_SENT("NotSent"), + + /** Enum value Sending. */ + SENDING("Sending"), + + /** Enum value Sent. */ + SENT("Sent"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a InvitationState instance. */ + private final String value; + + InvitationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InvitationState instance. + * + * @param value the serialized value to parse. + * @return the parsed InvitationState object, or null if unable to parse. + */ + @JsonCreator + public static InvitationState fromString(String value) { + InvitationState[] items = InvitationState.values(); + for (InvitationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListEnvironmentsPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InviteBody.java similarity index 53% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListEnvironmentsPayload.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InviteBody.java index 6eef6fae14c24..0e7f4aac474fc 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListEnvironmentsPayload.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/InviteBody.java @@ -9,34 +9,34 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents the payload to list environments owned by a user. */ +/** Body for a user invite request. */ @Fluent -public final class ListEnvironmentsPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ListEnvironmentsPayload.class); +public final class InviteBody { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InviteBody.class); /* - * The resource Id of the lab + * Custom text for the invite email. */ - @JsonProperty(value = "labId") - private String labId; + @JsonProperty(value = "text") + private String text; /** - * Get the labId property: The resource Id of the lab. + * Get the text property: Custom text for the invite email. * - * @return the labId value. + * @return the text value. */ - public String labId() { - return this.labId; + public String text() { + return this.text; } /** - * Set the labId property: The resource Id of the lab. + * Set the text property: Custom text for the invite email. * - * @param labId the labId value to set. - * @return the ListEnvironmentsPayload object itself. + * @param text the text value to set. + * @return the InviteBody object itself. */ - public ListEnvironmentsPayload withLabId(String labId) { - this.labId = labId; + public InviteBody withText(String text) { + this.text = text; return this; } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Lab.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Lab.java index 47b34231acda7..abfde36b0d2de 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Lab.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Lab.java @@ -4,12 +4,11 @@ package com.azure.resourcemanager.labservices.models; -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.labservices.fluent.models.LabInner; -import java.time.Duration; -import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Lab. */ @@ -50,81 +49,93 @@ public interface Lab { Map tags(); /** - * Gets the maxUsersInLab property: Maximum number of users allowed in the lab. + * Gets the systemData property: Metadata pertaining to creation and last modification of the lab. * - * @return the maxUsersInLab value. + * @return the systemData value. */ - Integer maxUsersInLab(); + SystemData systemData(); /** - * Gets the userQuota property: Maximum value MaxUsersInLab can be set to, as specified by the service. + * Gets the provisioningState property: Current provisioning state of the lab. * - * @return the userQuota value. + * @return the provisioningState value. */ - Integer userQuota(); + ProvisioningState provisioningState(); /** - * Gets the invitationCode property: Invitation code that users can use to join a lab. + * Gets the networkProfile property: The network profile for the lab, typically applied via a lab plan. This profile + * cannot be modified once a lab has been created. * - * @return the invitationCode value. + * @return the networkProfile value. */ - String invitationCode(); + LabNetworkProfile networkProfile(); /** - * Gets the createdByObjectId property: Object id of the user that created the lab. + * Gets the state property: The lab state. * - * @return the createdByObjectId value. + * @return the state value. */ - String createdByObjectId(); + LabState state(); /** - * Gets the usageQuota property: Maximum duration a user can use an environment for in the lab. + * Gets the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls + * whether actions are taken on resources that are sitting idle. * - * @return the usageQuota value. + * @return the autoShutdownProfile value. */ - Duration usageQuota(); + AutoShutdownProfile autoShutdownProfile(); /** - * Gets the userAccessMode property: Lab user access mode (open to all vs. restricted to those listed on the lab). + * Gets the connectionProfile property: The connection profile for the lab. This controls settings such as web + * access to lab resources or whether RDP or SSH ports are open. * - * @return the userAccessMode value. + * @return the connectionProfile value. */ - LabUserAccessMode userAccessMode(); + ConnectionProfile connectionProfile(); /** - * Gets the createdByUserPrincipalName property: Lab creator name. + * Gets the virtualMachineProfile property: The profile used for creating lab virtual machines. * - * @return the createdByUserPrincipalName value. + * @return the virtualMachineProfile value. */ - String createdByUserPrincipalName(); + VirtualMachineProfile virtualMachineProfile(); /** - * Gets the createdDate property: Creation date for the lab. + * Gets the securityProfile property: The lab security profile. * - * @return the createdDate value. + * @return the securityProfile value. */ - OffsetDateTime createdDate(); + SecurityProfile securityProfile(); /** - * Gets the provisioningState property: The provisioning status of the resource. + * Gets the rosterProfile property: The lab user list management profile. * - * @return the provisioningState value. + * @return the rosterProfile value. + */ + RosterProfile rosterProfile(); + + /** + * Gets the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts + * as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. + * + * @return the labPlanId value. */ - String provisioningState(); + String labPlanId(); /** - * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Gets the title property: The title of the lab. * - * @return the uniqueIdentifier value. + * @return the title value. */ - String uniqueIdentifier(); + String title(); /** - * Gets the latestOperationResult property: The details of the latest operation. ex: status, error. + * Gets the description property: The description of the lab. * - * @return the latestOperationResult value. + * @return the description value. */ - LatestOperationResult latestOperationResult(); + String description(); /** * Gets the region of the resource. @@ -151,7 +162,7 @@ public interface Lab { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** The Lab definition stages. */ @@ -167,7 +178,7 @@ interface WithLocation { * @param location The geo-location where the resource lives. * @return the next definition stage. */ - WithParentResource withRegion(Region location); + WithResourceGroup withRegion(Region location); /** * Specifies the region for the resource. @@ -175,18 +186,17 @@ interface WithLocation { * @param location The geo-location where the resource lives. * @return the next definition stage. */ - WithParentResource withRegion(String location); + WithResourceGroup withRegion(String location); } /** The stage of the Lab definition allowing to specify parent resource. */ - interface WithParentResource { + interface WithResourceGroup { /** - * Specifies resourceGroupName, labAccountName. + * Specifies resourceGroupName. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithCreate withExistingLabaccount(String resourceGroupName, String labAccountName); + WithCreate withExistingResourceGroup(String resourceGroupName); } /** * The stage of the Lab definition which contains all the minimum required properties for the resource to be @@ -194,11 +204,15 @@ interface WithParentResource { */ interface WithCreate extends DefinitionStages.WithTags, - DefinitionStages.WithMaxUsersInLab, - DefinitionStages.WithUsageQuota, - DefinitionStages.WithUserAccessMode, - DefinitionStages.WithProvisioningState, - DefinitionStages.WithUniqueIdentifier { + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithAutoShutdownProfile, + DefinitionStages.WithConnectionProfile, + DefinitionStages.WithVirtualMachineProfile, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithRosterProfile, + DefinitionStages.WithLabPlanId, + DefinitionStages.WithTitle, + DefinitionStages.WithDescription { /** * Executes the create request. * @@ -224,56 +238,105 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the Lab definition allowing to specify maxUsersInLab. */ - interface WithMaxUsersInLab { + /** The stage of the Lab definition allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: The network profile for the lab, typically applied via a lab plan. + * This profile cannot be modified once a lab has been created.. + * + * @param networkProfile The network profile for the lab, typically applied via a lab plan. This profile + * cannot be modified once a lab has been created. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(LabNetworkProfile networkProfile); + } + /** The stage of the Lab definition allowing to specify autoShutdownProfile. */ + interface WithAutoShutdownProfile { + /** + * Specifies the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This + * controls whether actions are taken on resources that are sitting idle.. + * + * @param autoShutdownProfile The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. + * @return the next definition stage. + */ + WithCreate withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile); + } + /** The stage of the Lab definition allowing to specify connectionProfile. */ + interface WithConnectionProfile { + /** + * Specifies the connectionProfile property: The connection profile for the lab. This controls settings such + * as web access to lab resources or whether RDP or SSH ports are open.. + * + * @param connectionProfile The connection profile for the lab. This controls settings such as web access to + * lab resources or whether RDP or SSH ports are open. + * @return the next definition stage. + */ + WithCreate withConnectionProfile(ConnectionProfile connectionProfile); + } + /** The stage of the Lab definition allowing to specify virtualMachineProfile. */ + interface WithVirtualMachineProfile { /** - * Specifies the maxUsersInLab property: Maximum number of users allowed in the lab.. + * Specifies the virtualMachineProfile property: The profile used for creating lab virtual machines.. * - * @param maxUsersInLab Maximum number of users allowed in the lab. + * @param virtualMachineProfile The profile used for creating lab virtual machines. * @return the next definition stage. */ - WithCreate withMaxUsersInLab(Integer maxUsersInLab); + WithCreate withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile); } - /** The stage of the Lab definition allowing to specify usageQuota. */ - interface WithUsageQuota { + /** The stage of the Lab definition allowing to specify securityProfile. */ + interface WithSecurityProfile { /** - * Specifies the usageQuota property: Maximum duration a user can use an environment for in the lab.. + * Specifies the securityProfile property: The lab security profile.. * - * @param usageQuota Maximum duration a user can use an environment for in the lab. + * @param securityProfile The lab security profile. * @return the next definition stage. */ - WithCreate withUsageQuota(Duration usageQuota); + WithCreate withSecurityProfile(SecurityProfile securityProfile); } - /** The stage of the Lab definition allowing to specify userAccessMode. */ - interface WithUserAccessMode { + /** The stage of the Lab definition allowing to specify rosterProfile. */ + interface WithRosterProfile { /** - * Specifies the userAccessMode property: Lab user access mode (open to all vs. restricted to those listed - * on the lab).. + * Specifies the rosterProfile property: The lab user list management profile.. * - * @param userAccessMode Lab user access mode (open to all vs. restricted to those listed on the lab). + * @param rosterProfile The lab user list management profile. * @return the next definition stage. */ - WithCreate withUserAccessMode(LabUserAccessMode userAccessMode); + WithCreate withRosterProfile(RosterProfile rosterProfile); } - /** The stage of the Lab definition allowing to specify provisioningState. */ - interface WithProvisioningState { + /** The stage of the Lab definition allowing to specify labPlanId. */ + interface WithLabPlanId { /** - * Specifies the provisioningState property: The provisioning status of the resource.. + * Specifies the labPlanId property: The ID of the lab plan. Used during resource creation to provide + * defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId + * on an existing lab provides organization... * - * @param provisioningState The provisioning status of the resource. + * @param labPlanId The ID of the lab plan. Used during resource creation to provide defaults and acts as a + * permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab + * provides organization.. * @return the next definition stage. */ - WithCreate withProvisioningState(String provisioningState); + WithCreate withLabPlanId(String labPlanId); } - /** The stage of the Lab definition allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { + /** The stage of the Lab definition allowing to specify title. */ + interface WithTitle { /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. + * Specifies the title property: The title of the lab.. * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). + * @param title The title of the lab. * @return the next definition stage. */ - WithCreate withUniqueIdentifier(String uniqueIdentifier); + WithCreate withTitle(String title); + } + /** The stage of the Lab definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the lab.. + * + * @param description The description of the lab. + * @return the next definition stage. + */ + WithCreate withDescription(String description); } } /** @@ -286,11 +349,14 @@ interface WithUniqueIdentifier { /** The template for Lab update. */ interface Update extends UpdateStages.WithTags, - UpdateStages.WithMaxUsersInLab, - UpdateStages.WithUsageQuota, - UpdateStages.WithUserAccessMode, - UpdateStages.WithProvisioningState, - UpdateStages.WithUniqueIdentifier { + UpdateStages.WithAutoShutdownProfile, + UpdateStages.WithConnectionProfile, + UpdateStages.WithVirtualMachineProfile, + UpdateStages.WithSecurityProfile, + UpdateStages.WithRosterProfile, + UpdateStages.WithLabPlanId, + UpdateStages.WithTitle, + UpdateStages.WithDescription { /** * Executes the update request. * @@ -316,58 +382,95 @@ interface WithTags { * @param tags Resource tags. * @return the next definition stage. */ - Update withTags(Map tags); + Update withTags(List tags); } - /** The stage of the Lab update allowing to specify maxUsersInLab. */ - interface WithMaxUsersInLab { + /** The stage of the Lab update allowing to specify autoShutdownProfile. */ + interface WithAutoShutdownProfile { /** - * Specifies the maxUsersInLab property: Maximum number of users allowed in the lab.. + * Specifies the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This + * controls whether actions are taken on resources that are sitting idle.. * - * @param maxUsersInLab Maximum number of users allowed in the lab. + * @param autoShutdownProfile The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. * @return the next definition stage. */ - Update withMaxUsersInLab(Integer maxUsersInLab); + Update withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile); } - /** The stage of the Lab update allowing to specify usageQuota. */ - interface WithUsageQuota { + /** The stage of the Lab update allowing to specify connectionProfile. */ + interface WithConnectionProfile { /** - * Specifies the usageQuota property: Maximum duration a user can use an environment for in the lab.. + * Specifies the connectionProfile property: The connection profile for the lab. This controls settings such + * as web access to lab resources or whether RDP or SSH ports are open.. * - * @param usageQuota Maximum duration a user can use an environment for in the lab. + * @param connectionProfile The connection profile for the lab. This controls settings such as web access to + * lab resources or whether RDP or SSH ports are open. * @return the next definition stage. */ - Update withUsageQuota(Duration usageQuota); + Update withConnectionProfile(ConnectionProfile connectionProfile); } - /** The stage of the Lab update allowing to specify userAccessMode. */ - interface WithUserAccessMode { + /** The stage of the Lab update allowing to specify virtualMachineProfile. */ + interface WithVirtualMachineProfile { /** - * Specifies the userAccessMode property: Lab user access mode (open to all vs. restricted to those listed - * on the lab).. + * Specifies the virtualMachineProfile property: The profile used for creating lab virtual machines.. * - * @param userAccessMode Lab user access mode (open to all vs. restricted to those listed on the lab). + * @param virtualMachineProfile The profile used for creating lab virtual machines. * @return the next definition stage. */ - Update withUserAccessMode(LabUserAccessMode userAccessMode); + Update withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile); } - /** The stage of the Lab update allowing to specify provisioningState. */ - interface WithProvisioningState { + /** The stage of the Lab update allowing to specify securityProfile. */ + interface WithSecurityProfile { /** - * Specifies the provisioningState property: The provisioning status of the resource.. + * Specifies the securityProfile property: The lab security profile.. * - * @param provisioningState The provisioning status of the resource. + * @param securityProfile The lab security profile. * @return the next definition stage. */ - Update withProvisioningState(String provisioningState); + Update withSecurityProfile(SecurityProfile securityProfile); } - /** The stage of the Lab update allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { + /** The stage of the Lab update allowing to specify rosterProfile. */ + interface WithRosterProfile { /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. + * Specifies the rosterProfile property: The lab user list management profile.. * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). + * @param rosterProfile The lab user list management profile. * @return the next definition stage. */ - Update withUniqueIdentifier(String uniqueIdentifier); + Update withRosterProfile(RosterProfile rosterProfile); + } + /** The stage of the Lab update allowing to specify labPlanId. */ + interface WithLabPlanId { + /** + * Specifies the labPlanId property: The ID of the lab plan. Used during resource creation to provide + * defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId + * on an existing lab provides organization... + * + * @param labPlanId The ID of the lab plan. Used during resource creation to provide defaults and acts as a + * permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab + * provides organization.. + * @return the next definition stage. + */ + Update withLabPlanId(String labPlanId); + } + /** The stage of the Lab update allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: The title of the lab.. + * + * @param title The title of the lab. + * @return the next definition stage. + */ + Update withTitle(String title); + } + /** The stage of the Lab update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the lab.. + * + * @param description The description of the lab. + * @return the next definition stage. + */ + Update withDescription(String description); } } /** @@ -386,43 +489,38 @@ interface WithUniqueIdentifier { Lab refresh(Context context); /** - * Add users to a lab. + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * - * @param addUsersPayload Payload for Add Users operation on 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. */ - void addUsers(AddUsersPayload addUsersPayload); + void publish(); /** - * Add users to a lab. + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * - * @param addUsersPayload Payload for Add Users operation on 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 response. */ - Response addUsersWithResponse(AddUsersPayload addUsersPayload, Context context); + void publish(Context context); /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. * * @throws com.azure.core.management.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 register(); + void syncGroup(); /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 registerWithResponse(Context context); + void syncGroup(Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccount.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccount.java deleted file mode 100644 index b3ac441f227b5..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccount.java +++ /dev/null @@ -1,338 +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.labservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.labservices.fluent.models.LabAccountInner; -import java.util.Map; - -/** An immutable client-side representation of LabAccount. */ -public interface LabAccount { - /** - * 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 sizeConfiguration property: Represents the size configuration under the lab account. - * - * @return the sizeConfiguration value. - */ - SizeConfigurationProperties sizeConfiguration(); - - /** - * Gets the enabledRegionSelection property: Represents if region selection is enabled. - * - * @return the enabledRegionSelection value. - */ - Boolean enabledRegionSelection(); - - /** - * 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 latestOperationResult property: The details of the latest operation. ex: status, error. - * - * @return the latestOperationResult value. - */ - LatestOperationResult latestOperationResult(); - - /** - * 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.labservices.fluent.models.LabAccountInner object. - * - * @return the inner object. - */ - LabAccountInner innerModel(); - - /** The entirety of the LabAccount definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The LabAccount definition stages. */ - interface DefinitionStages { - /** The first stage of the LabAccount definition. */ - interface Blank extends WithLocation { - } - /** The stage of the LabAccount definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - /** The stage of the LabAccount definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the LabAccount 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.WithEnabledRegionSelection, - DefinitionStages.WithProvisioningState, - DefinitionStages.WithUniqueIdentifier { - /** - * Executes the create request. - * - * @return the created resource. - */ - LabAccount create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - LabAccount create(Context context); - } - /** The stage of the LabAccount 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 LabAccount definition allowing to specify enabledRegionSelection. */ - interface WithEnabledRegionSelection { - /** - * Specifies the enabledRegionSelection property: Represents if region selection is enabled. - * - * @param enabledRegionSelection Represents if region selection is enabled. - * @return the next definition stage. - */ - WithCreate withEnabledRegionSelection(Boolean enabledRegionSelection); - } - /** The stage of the LabAccount definition allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - WithCreate withProvisioningState(String provisioningState); - } - /** The stage of the LabAccount definition allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - WithCreate withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Begins update for the LabAccount resource. - * - * @return the stage of resource update. - */ - LabAccount.Update update(); - - /** The template for LabAccount update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithEnabledRegionSelection, - UpdateStages.WithProvisioningState, - UpdateStages.WithUniqueIdentifier { - /** - * Executes the update request. - * - * @return the updated resource. - */ - LabAccount apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - LabAccount apply(Context context); - } - /** The LabAccount update stages. */ - interface UpdateStages { - /** The stage of the LabAccount 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 LabAccount update allowing to specify enabledRegionSelection. */ - interface WithEnabledRegionSelection { - /** - * Specifies the enabledRegionSelection property: Represents if region selection is enabled. - * - * @param enabledRegionSelection Represents if region selection is enabled. - * @return the next definition stage. - */ - Update withEnabledRegionSelection(Boolean enabledRegionSelection); - } - /** The stage of the LabAccount update allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - Update withProvisioningState(String provisioningState); - } - /** The stage of the LabAccount update allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - Update withUniqueIdentifier(String uniqueIdentifier); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - LabAccount refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - LabAccount refresh(Context context); - - /** - * Create a lab in a lab account. - * - * @param createLabProperties Properties for creating a managed lab and a default environment setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 createLab(CreateLabProperties createLabProperties); - - /** - * Create a lab in a lab account. - * - * @param createLabProperties Properties for creating a managed lab and a default environment setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 createLabWithResponse(CreateLabProperties createLabProperties, Context context); - - /** - * Get regional availability information for each size category configured under a lab account. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. - */ - GetRegionalAvailabilityResponse getRegionalAvailability(); - - /** - * Get regional availability information for each size category configured under a lab account. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. - */ - Response getRegionalAvailabilityWithResponse(Context context); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccountFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccountFragment.java deleted file mode 100644 index 0fb8f31c0464e..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccountFragment.java +++ /dev/null @@ -1,120 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Represents a lab account. */ -@JsonFlatten -@Fluent -public class LabAccountFragment extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabAccountFragment.class); - - /* - * Represents if region selection is enabled - */ - @JsonProperty(value = "properties.enabledRegionSelection") - private Boolean enabledRegionSelection; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /** - * Get the enabledRegionSelection property: Represents if region selection is enabled. - * - * @return the enabledRegionSelection value. - */ - public Boolean enabledRegionSelection() { - return this.enabledRegionSelection; - } - - /** - * Set the enabledRegionSelection property: Represents if region selection is enabled. - * - * @param enabledRegionSelection the enabledRegionSelection value to set. - * @return the LabAccountFragment object itself. - */ - public LabAccountFragment withEnabledRegionSelection(Boolean enabledRegionSelection) { - this.enabledRegionSelection = enabledRegionSelection; - return this; - } - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the LabAccountFragment object itself. - */ - public LabAccountFragment withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the LabAccountFragment object itself. - */ - public LabAccountFragment withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** {@inheritDoc} */ - @Override - public LabAccountFragment withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabAccountFragment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccounts.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccounts.java deleted file mode 100644 index 88922144465bd..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabAccounts.java +++ /dev/null @@ -1,220 +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.labservices.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 LabAccounts. */ -public interface LabAccounts { - /** - * List lab accounts in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - PagedIterable list(); - - /** - * List lab accounts in a subscription. - * - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - PagedIterable list(String expand, String filter, Integer top, String orderby, Context context); - - /** - * List lab accounts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List lab accounts in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. - */ - PagedIterable listByResourceGroup( - String resourceGroupName, String expand, String filter, Integer top, String orderby, Context context); - - /** - * Get lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 account. - */ - LabAccount getByResourceGroup(String resourceGroupName, String labAccountName); - - /** - * Get lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 account. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String labAccountName, String expand, Context context); - - /** - * Delete lab account. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String labAccountName); - - /** - * Delete lab account. This operation can take a while to complete. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 labAccountName, Context context); - - /** - * Create a lab in a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 createLab(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties); - - /** - * Create a lab in a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param createLabProperties Properties for creating a managed lab and a default environment setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 createLabWithResponse( - String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties, Context context); - - /** - * Get regional availability information for each size category configured under a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. - */ - GetRegionalAvailabilityResponse getRegionalAvailability(String resourceGroupName, String labAccountName); - - /** - * Get regional availability information for each size category configured under a lab account. - * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regional availability information for each size category configured under a lab account. - */ - Response getRegionalAvailabilityWithResponse( - String resourceGroupName, String labAccountName, Context context); - - /** - * Get lab account. - * - * @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 account. - */ - LabAccount getById(String id); - - /** - * Get lab account. - * - * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 account. - */ - Response getByIdWithResponse(String id, String expand, Context context); - - /** - * Delete lab account. 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 account. 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 LabAccount resource. - * - * @param name resource name. - * @return the first stage of the new LabAccount definition. - */ - LabAccount.DefinitionStages.Blank define(String name); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabCreationParameters.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabCreationParameters.java deleted file mode 100644 index 2f3cc817e244d..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabCreationParameters.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Settings related to creating a lab. */ -@Fluent -public final class LabCreationParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabCreationParameters.class); - - /* - * Maximum number of users allowed in the lab. - */ - @JsonProperty(value = "maxUsersInLab") - private Integer maxUsersInLab; - - /** - * Get the maxUsersInLab property: Maximum number of users allowed in the lab. - * - * @return the maxUsersInLab value. - */ - public Integer maxUsersInLab() { - return this.maxUsersInLab; - } - - /** - * Set the maxUsersInLab property: Maximum number of users allowed in the lab. - * - * @param maxUsersInLab the maxUsersInLab value to set. - * @return the LabCreationParameters object itself. - */ - public LabCreationParameters withMaxUsersInLab(Integer maxUsersInLab) { - this.maxUsersInLab = maxUsersInLab; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabDetails.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabDetails.java deleted file mode 100644 index 0574d13957448..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabDetails.java +++ /dev/null @@ -1,118 +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.labservices.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.Duration; - -/** This represents the details about a lab that the User is in, and its state. */ -@Fluent -public final class LabDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabDetails.class); - - /* - * Name of the lab - */ - @JsonProperty(value = "name") - private String name; - - /* - * The provisioning state of the lab. - */ - @JsonProperty(value = "provisioningState") - private String provisioningState; - - /* - * The Id of the lab. - */ - @JsonProperty(value = "id") - private String id; - - /* - * The maximum duration a user can use a VM in this lab. - */ - @JsonProperty(value = "usageQuota", access = JsonProperty.Access.WRITE_ONLY) - private Duration usageQuota; - - /** - * Get the name property: Name of the lab. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the lab. - * - * @param name the name value to set. - * @return the LabDetails object itself. - */ - public LabDetails withName(String name) { - this.name = name; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the lab. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the lab. - * - * @param provisioningState the provisioningState value to set. - * @return the LabDetails object itself. - */ - public LabDetails withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the id property: The Id of the lab. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The Id of the lab. - * - * @param id the id value to set. - * @return the LabDetails object itself. - */ - public LabDetails withId(String id) { - this.id = id; - return this; - } - - /** - * Get the usageQuota property: The maximum duration a user can use a VM in this lab. - * - * @return the usageQuota value. - */ - public Duration usageQuota() { - return this.usageQuota; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabFragment.java deleted file mode 100644 index 60f5374c92cc6..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabFragment.java +++ /dev/null @@ -1,174 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.util.Map; - -/** Represents a lab. */ -@JsonFlatten -@Fluent -public class LabFragment extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LabFragment.class); - - /* - * Maximum number of users allowed in the lab. - */ - @JsonProperty(value = "properties.maxUsersInLab") - private Integer maxUsersInLab; - - /* - * Maximum duration a user can use an environment for in the lab. - */ - @JsonProperty(value = "properties.usageQuota") - private Duration usageQuota; - - /* - * Lab user access mode (open to all vs. restricted to those listed on the - * lab). - */ - @JsonProperty(value = "properties.userAccessMode") - private LabUserAccessMode userAccessMode; - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /** - * Get the maxUsersInLab property: Maximum number of users allowed in the lab. - * - * @return the maxUsersInLab value. - */ - public Integer maxUsersInLab() { - return this.maxUsersInLab; - } - - /** - * Set the maxUsersInLab property: Maximum number of users allowed in the lab. - * - * @param maxUsersInLab the maxUsersInLab value to set. - * @return the LabFragment object itself. - */ - public LabFragment withMaxUsersInLab(Integer maxUsersInLab) { - this.maxUsersInLab = maxUsersInLab; - return this; - } - - /** - * Get the usageQuota property: Maximum duration a user can use an environment for in the lab. - * - * @return the usageQuota value. - */ - public Duration usageQuota() { - return this.usageQuota; - } - - /** - * Set the usageQuota property: Maximum duration a user can use an environment for in the lab. - * - * @param usageQuota the usageQuota value to set. - * @return the LabFragment object itself. - */ - public LabFragment withUsageQuota(Duration usageQuota) { - this.usageQuota = usageQuota; - return this; - } - - /** - * Get the userAccessMode property: Lab user access mode (open to all vs. restricted to those listed on the lab). - * - * @return the userAccessMode value. - */ - public LabUserAccessMode userAccessMode() { - return this.userAccessMode; - } - - /** - * Set the userAccessMode property: Lab user access mode (open to all vs. restricted to those listed on the lab). - * - * @param userAccessMode the userAccessMode value to set. - * @return the LabFragment object itself. - */ - public LabFragment withUserAccessMode(LabUserAccessMode userAccessMode) { - this.userAccessMode = userAccessMode; - return this; - } - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the LabFragment object itself. - */ - public LabFragment withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the LabFragment object itself. - */ - public LabFragment withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** {@inheritDoc} */ - @Override - public LabFragment withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public LabFragment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabNetworkProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabNetworkProfile.java new file mode 100644 index 0000000000000..59ac85fe3d459 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabNetworkProfile.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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; + +/** Profile for how to handle networking for Labs. */ +@Fluent +public final class LabNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabNetworkProfile.class); + + /* + * The external subnet resource id + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /* + * The external load balancer resource id + */ + @JsonProperty(value = "loadBalancerId") + private String loadBalancerId; + + /* + * The external public IP resource id + */ + @JsonProperty(value = "publicIpId") + private String publicIpId; + + /** + * Get the subnetId property: The external subnet resource id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The external subnet resource id. + * + * @param subnetId the subnetId value to set. + * @return the LabNetworkProfile object itself. + */ + public LabNetworkProfile withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the loadBalancerId property: The external load balancer resource id. + * + * @return the loadBalancerId value. + */ + public String loadBalancerId() { + return this.loadBalancerId; + } + + /** + * Set the loadBalancerId property: The external load balancer resource id. + * + * @param loadBalancerId the loadBalancerId value to set. + * @return the LabNetworkProfile object itself. + */ + public LabNetworkProfile withLoadBalancerId(String loadBalancerId) { + this.loadBalancerId = loadBalancerId; + return this; + } + + /** + * Get the publicIpId property: The external public IP resource id. + * + * @return the publicIpId value. + */ + public String publicIpId() { + return this.publicIpId; + } + + /** + * Set the publicIpId property: The external public IP resource id. + * + * @param publicIpId the publicIpId value to set. + * @return the LabNetworkProfile object itself. + */ + public LabNetworkProfile withPublicIpId(String publicIpId) { + this.publicIpId = publicIpId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlan.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlan.java new file mode 100644 index 0000000000000..a86ddfeb3a41e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlan.java @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LabPlan. */ +public interface LabPlan { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the lab plan. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Current provisioning state of the lab plan. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultConnectionProfile value. + */ + ConnectionProfile defaultConnectionProfile(); + + /** + * Gets the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultAutoShutdownProfile value. + */ + AutoShutdownProfile defaultAutoShutdownProfile(); + + /** + * Gets the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs associated with this lab plan. + * + * @return the defaultNetworkProfile value. + */ + LabPlanNetworkProfile defaultNetworkProfile(); + + /** + * Gets the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this + * lab plan. + * + * @return the allowedRegions value. + */ + List allowedRegions(); + + /** + * Gets the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving + * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be + * made available to use when creating new labs. + * + * @return the sharedGalleryId value. + */ + String sharedGalleryId(); + + /** + * Gets the supportInfo property: Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * + * @return the supportInfo value. + */ + SupportInfo supportInfo(); + + /** + * Gets the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. + * + * @return the linkedLmsInstance value. + */ + String linkedLmsInstance(); + + /** + * 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.labservices.fluent.models.LabPlanInner object. + * + * @return the inner object. + */ + LabPlanInner innerModel(); + + /** The entirety of the LabPlan definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The LabPlan definition stages. */ + interface DefinitionStages { + /** The first stage of the LabPlan definition. */ + interface Blank extends WithLocation { + } + /** The stage of the LabPlan definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the LabPlan definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the LabPlan 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.WithDefaultConnectionProfile, + DefinitionStages.WithDefaultAutoShutdownProfile, + DefinitionStages.WithDefaultNetworkProfile, + DefinitionStages.WithAllowedRegions, + DefinitionStages.WithSharedGalleryId, + DefinitionStages.WithSupportInfo, + DefinitionStages.WithLinkedLmsInstance { + /** + * Executes the create request. + * + * @return the created resource. + */ + LabPlan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LabPlan create(Context context); + } + /** The stage of the LabPlan 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 LabPlan definition allowing to specify defaultConnectionProfile. */ + interface WithDefaultConnectionProfile { + /** + * Specifies the defaultConnectionProfile property: The default lab connection profile. This can be changed + * on a lab resource and only provides a default profile.. + * + * @param defaultConnectionProfile The default lab connection profile. This can be changed on a lab resource + * and only provides a default profile. + * @return the next definition stage. + */ + WithCreate withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile); + } + /** The stage of the LabPlan definition allowing to specify defaultAutoShutdownProfile. */ + interface WithDefaultAutoShutdownProfile { + /** + * Specifies the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed + * on a lab resource and only provides a default profile.. + * + * @param defaultAutoShutdownProfile The default lab shutdown profile. This can be changed on a lab resource + * and only provides a default profile. + * @return the next definition stage. + */ + WithCreate withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile); + } + /** The stage of the LabPlan definition allowing to specify defaultNetworkProfile. */ + interface WithDefaultNetworkProfile { + /** + * Specifies the defaultNetworkProfile property: The lab plan network profile. To enforce lab network + * policies they must be defined here and cannot be changed when there are existing labs associated with + * this lab plan.. + * + * @param defaultNetworkProfile The lab plan network profile. To enforce lab network policies they must be + * defined here and cannot be changed when there are existing labs associated with this lab plan. + * @return the next definition stage. + */ + WithCreate withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile); + } + /** The stage of the LabPlan definition allowing to specify allowedRegions. */ + interface WithAllowedRegions { + /** + * Specifies the allowedRegions property: The allowed regions for the lab creator to use when creating labs + * using this lab plan.. + * + * @param allowedRegions The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * @return the next definition stage. + */ + WithCreate withAllowedRegions(List allowedRegions); + } + /** The stage of the LabPlan definition allowing to specify sharedGalleryId. */ + interface WithSharedGalleryId { + /** + * Specifies the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab + * plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared + * images from the gallery can be made available to use when creating new labs.. + * + * @param sharedGalleryId Resource ID of the Shared Image Gallery attached to this lab plan. When saving a + * lab template virtual machine image it will be persisted in this gallery. Shared images from the + * gallery can be made available to use when creating new labs. + * @return the next definition stage. + */ + WithCreate withSharedGalleryId(String sharedGalleryId); + } + /** The stage of the LabPlan definition allowing to specify supportInfo. */ + interface WithSupportInfo { + /** + * Specifies the supportInfo property: Support contact information and instructions for users of the lab + * plan. This information is displayed to lab owners and virtual machine users for all labs in the lab + * plan.. + * + * @param supportInfo Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * @return the next definition stage. + */ + WithCreate withSupportInfo(SupportInfo supportInfo); + } + /** The stage of the LabPlan definition allowing to specify linkedLmsInstance. */ + interface WithLinkedLmsInstance { + /** + * Specifies the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters + * against.. + * + * @param linkedLmsInstance Base Url of the lms instance this lab plan can link lab rosters against. + * @return the next definition stage. + */ + WithCreate withLinkedLmsInstance(String linkedLmsInstance); + } + } + /** + * Begins update for the LabPlan resource. + * + * @return the stage of resource update. + */ + LabPlan.Update update(); + + /** The template for LabPlan update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDefaultConnectionProfile, + UpdateStages.WithDefaultAutoShutdownProfile, + UpdateStages.WithDefaultNetworkProfile, + UpdateStages.WithAllowedRegions, + UpdateStages.WithSharedGalleryId, + UpdateStages.WithSupportInfo, + UpdateStages.WithLinkedLmsInstance { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LabPlan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LabPlan apply(Context context); + } + /** The LabPlan update stages. */ + interface UpdateStages { + /** The stage of the LabPlan update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(List tags); + } + /** The stage of the LabPlan update allowing to specify defaultConnectionProfile. */ + interface WithDefaultConnectionProfile { + /** + * Specifies the defaultConnectionProfile property: The default lab connection profile. This can be changed + * on a lab resource and only provides a default profile.. + * + * @param defaultConnectionProfile The default lab connection profile. This can be changed on a lab resource + * and only provides a default profile. + * @return the next definition stage. + */ + Update withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile); + } + /** The stage of the LabPlan update allowing to specify defaultAutoShutdownProfile. */ + interface WithDefaultAutoShutdownProfile { + /** + * Specifies the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed + * on a lab resource and only provides a default profile.. + * + * @param defaultAutoShutdownProfile The default lab shutdown profile. This can be changed on a lab resource + * and only provides a default profile. + * @return the next definition stage. + */ + Update withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile); + } + /** The stage of the LabPlan update allowing to specify defaultNetworkProfile. */ + interface WithDefaultNetworkProfile { + /** + * Specifies the defaultNetworkProfile property: The lab plan network profile. To enforce lab network + * policies they must be defined here and cannot be changed when there are existing labs associated with + * this lab plan.. + * + * @param defaultNetworkProfile The lab plan network profile. To enforce lab network policies they must be + * defined here and cannot be changed when there are existing labs associated with this lab plan. + * @return the next definition stage. + */ + Update withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile); + } + /** The stage of the LabPlan update allowing to specify allowedRegions. */ + interface WithAllowedRegions { + /** + * Specifies the allowedRegions property: The allowed regions for the lab creator to use when creating labs + * using this lab plan.. + * + * @param allowedRegions The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * @return the next definition stage. + */ + Update withAllowedRegions(List allowedRegions); + } + /** The stage of the LabPlan update allowing to specify sharedGalleryId. */ + interface WithSharedGalleryId { + /** + * Specifies the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab + * plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared + * images from the gallery can be made available to use when creating new labs.. + * + * @param sharedGalleryId Resource ID of the Shared Image Gallery attached to this lab plan. When saving a + * lab template virtual machine image it will be persisted in this gallery. Shared images from the + * gallery can be made available to use when creating new labs. + * @return the next definition stage. + */ + Update withSharedGalleryId(String sharedGalleryId); + } + /** The stage of the LabPlan update allowing to specify supportInfo. */ + interface WithSupportInfo { + /** + * Specifies the supportInfo property: Support contact information and instructions for users of the lab + * plan. This information is displayed to lab owners and virtual machine users for all labs in the lab + * plan.. + * + * @param supportInfo Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * @return the next definition stage. + */ + Update withSupportInfo(SupportInfo supportInfo); + } + /** The stage of the LabPlan update allowing to specify linkedLmsInstance. */ + interface WithLinkedLmsInstance { + /** + * Specifies the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters + * against.. + * + * @param linkedLmsInstance Base Url of the lms instance this lab plan can link lab rosters against. + * @return the next definition stage. + */ + Update withLinkedLmsInstance(String linkedLmsInstance); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LabPlan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LabPlan refresh(Context context); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 saveImage(SaveImageBody body); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 saveImage(SaveImageBody body, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanNetworkProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanNetworkProfile.java new file mode 100644 index 0000000000000..7be20f6412347 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanNetworkProfile.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.labservices.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; + +/** Profile for how to handle networking for Lab Plans. */ +@Fluent +public final class LabPlanNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanNetworkProfile.class); + + /* + * The external subnet resource id + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** + * Get the subnetId property: The external subnet resource id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The external subnet resource id. + * + * @param subnetId the subnetId value to set. + * @return the LabPlanNetworkProfile object itself. + */ + public LabPlanNetworkProfile withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanUpdate.java new file mode 100644 index 0000000000000..070376a9c3fa3 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlanUpdate.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.labservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.LabPlanUpdateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains lab configuration and default settings. This variant is used for PATCH. */ +@Fluent +public final class LabPlanUpdate extends TrackedResourceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabPlanUpdate.class); + + /* + * Lab plan resource update properties + */ + @JsonProperty(value = "properties") + private LabPlanUpdateProperties innerProperties; + + /** + * Get the innerProperties property: Lab plan resource update properties. + * + * @return the innerProperties value. + */ + private LabPlanUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public LabPlanUpdate withTags(List tags) { + super.withTags(tags); + return this; + } + + /** + * Get the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultConnectionProfile value. + */ + public ConnectionProfile defaultConnectionProfile() { + return this.innerProperties() == null ? null : this.innerProperties().defaultConnectionProfile(); + } + + /** + * Set the defaultConnectionProfile property: The default lab connection profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @param defaultConnectionProfile the defaultConnectionProfile value to set. + * @return the LabPlanUpdate object itself. + */ + public LabPlanUpdate withDefaultConnectionProfile(ConnectionProfile defaultConnectionProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanUpdateProperties(); + } + this.innerProperties().withDefaultConnectionProfile(defaultConnectionProfile); + return this; + } + + /** + * Get the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @return the defaultAutoShutdownProfile value. + */ + public AutoShutdownProfile defaultAutoShutdownProfile() { + return this.innerProperties() == null ? null : this.innerProperties().defaultAutoShutdownProfile(); + } + + /** + * Set the defaultAutoShutdownProfile property: The default lab shutdown profile. This can be changed on a lab + * resource and only provides a default profile. + * + * @param defaultAutoShutdownProfile the defaultAutoShutdownProfile value to set. + * @return the LabPlanUpdate object itself. + */ + public LabPlanUpdate withDefaultAutoShutdownProfile(AutoShutdownProfile defaultAutoShutdownProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanUpdateProperties(); + } + this.innerProperties().withDefaultAutoShutdownProfile(defaultAutoShutdownProfile); + return this; + } + + /** + * Get the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs associated with this lab plan. + * + * @return the defaultNetworkProfile value. + */ + public LabPlanNetworkProfile defaultNetworkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().defaultNetworkProfile(); + } + + /** + * Set the defaultNetworkProfile property: The lab plan network profile. To enforce lab network policies they must + * be defined here and cannot be changed when there are existing labs associated with this lab plan. + * + * @param defaultNetworkProfile the defaultNetworkProfile value to set. + * @return the LabPlanUpdate object itself. + */ + public LabPlanUpdate withDefaultNetworkProfile(LabPlanNetworkProfile defaultNetworkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanUpdateProperties(); + } + this.innerProperties().withDefaultNetworkProfile(defaultNetworkProfile); + return this; + } + + /** + * Get the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * + * @return the allowedRegions value. + */ + public List allowedRegions() { + return this.innerProperties() == null ? null : this.innerProperties().allowedRegions(); + } + + /** + * Set the allowedRegions property: The allowed regions for the lab creator to use when creating labs using this lab + * plan. + * + * @param allowedRegions the allowedRegions value to set. + * @return the LabPlanUpdate object itself. + */ + public LabPlanUpdate withAllowedRegions(List allowedRegions) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanUpdateProperties(); + } + this.innerProperties().withAllowedRegions(allowedRegions); + return this; + } + + /** + * Get the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving + * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be + * made available to use when creating new labs. + * + * @return the sharedGalleryId value. + */ + public String sharedGalleryId() { + return this.innerProperties() == null ? null : this.innerProperties().sharedGalleryId(); + } + + /** + * Set the sharedGalleryId property: Resource ID of the Shared Image Gallery attached to this lab plan. When saving + * a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be + * made available to use when creating new labs. + * + * @param sharedGalleryId the sharedGalleryId value to set. + * @return the LabPlanUpdate object itself. + */ + public LabPlanUpdate withSharedGalleryId(String sharedGalleryId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanUpdateProperties(); + } + this.innerProperties().withSharedGalleryId(sharedGalleryId); + return this; + } + + /** + * Get the supportInfo property: Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * + * @return the supportInfo value. + */ + public SupportInfo supportInfo() { + return this.innerProperties() == null ? null : this.innerProperties().supportInfo(); + } + + /** + * Set the supportInfo property: Support contact information and instructions for users of the lab plan. This + * information is displayed to lab owners and virtual machine users for all labs in the lab plan. + * + * @param supportInfo the supportInfo value to set. + * @return the LabPlanUpdate object itself. + */ + public LabPlanUpdate withSupportInfo(SupportInfo supportInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanUpdateProperties(); + } + this.innerProperties().withSupportInfo(supportInfo); + return this; + } + + /** + * Get the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. + * + * @return the linkedLmsInstance value. + */ + public String linkedLmsInstance() { + return this.innerProperties() == null ? null : this.innerProperties().linkedLmsInstance(); + } + + /** + * Set the linkedLmsInstance property: Base Url of the lms instance this lab plan can link lab rosters against. + * + * @param linkedLmsInstance the linkedLmsInstance value to set. + * @return the LabPlanUpdate object itself. + */ + public LabPlanUpdate withLinkedLmsInstance(String linkedLmsInstance) { + if (this.innerProperties() == null) { + this.innerProperties = new LabPlanUpdateProperties(); + } + this.innerProperties().withLinkedLmsInstance(linkedLmsInstance); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlans.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlans.java new file mode 100644 index 0000000000000..3688f6fbd16de --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabPlans.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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 LabPlans. */ +public interface LabPlans { + /** + * Returns a list of all lab plans within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + PagedIterable list(); + + /** + * Returns a list of all lab plans within a subscription. + * + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + PagedIterable list(String filter, Context context); + + /** + * Returns a list of all lab plans for a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns a list of all lab plans for a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab plans. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves the properties of a Lab Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com. + */ + LabPlan getByResourceGroup(String resourceGroupName, String labPlanName); + + /** + * Retrieves the properties of a Lab Plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String labPlanName, Context context); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String labPlanName); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 labPlanName, Context context); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 saveImage(String resourceGroupName, String labPlanName, SaveImageBody body); + + /** + * Saves an image from a lab VM to the attached shared image gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labPlanName The name of the lab plan that uniquely identifies it within containing resource group. Used in + * resource URIs and in UI. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 saveImage(String resourceGroupName, String labPlanName, SaveImageBody body, Context context); + + /** + * Retrieves the properties of a Lab Plan. + * + * @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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. + */ + LabPlan getById(String id); + + /** + * Retrieves the properties of a Lab Plan. + * + * @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 Plans act as a permission container for creating labs via labs.azure.com along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @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); + + /** + * Operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, nor + * does it delete shared images added to a gallery via the lab plan permission container. + * + * @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 LabPlan resource. + * + * @param name resource name. + * @return the first stage of the new LabPlan definition. + */ + LabPlan.DefinitionStages.Blank define(String name); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSku.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSku.java new file mode 100644 index 0000000000000..0abe55de7dad3 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSku.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.labservices.models; + +import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; +import java.util.List; + +/** An immutable client-side representation of LabServicesSku. */ +public interface LabServicesSku { + /** + * Gets the resourceType property: The lab services resource type. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of the SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: The tier of the SKU. + * + * @return the tier value. + */ + LabServicesSkuTier tier(); + + /** + * Gets the size property: The SKU size. + * + * @return the size value. + */ + String size(); + + /** + * Gets the family property: The family of the SKU. + * + * @return the family value. + */ + String family(); + + /** + * Gets the capacity property: The scale out/in options of the SKU. + * + * @return the capacity value. + */ + LabServicesSkuCapacity capacity(); + + /** + * Gets the capabilities property: The capabilities of the SKU. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the locations property: List of locations that are available for a size. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the costs property: Metadata for retrieving price info of a lab services SKUs. + * + * @return the costs value. + */ + List costs(); + + /** + * Gets the restrictions property: Restrictions of a lab services SKUs. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner object. + * + * @return the inner object. + */ + LabServicesSkuInner innerModel(); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapabilities.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapabilities.java new file mode 100644 index 0000000000000..9b656fee01f2f --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapabilities.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.labservices.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 array of capabilities of a lab services SKU. */ +@Immutable +public final class LabServicesSkuCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuCapabilities.class); + + /* + * The name of the capability for a SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The value of the capability for a SKU. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: The name of the capability for a SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: The value of the capability for a SKU. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapacity.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapacity.java new file mode 100644 index 0000000000000..3cc4caf9c7d21 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCapacity.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.labservices.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 scale out/in options of the SKU. */ +@Immutable +public final class LabServicesSkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuCapacity.class); + + /* + * The default capacity for this resource. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultProperty; + + /* + * The lowest permitted capacity for this resource. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /* + * The highest permitted capacity for this resource. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /* + * The localized name of the resource. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ScaleType scaleType; + + /** + * Get the defaultProperty property: The default capacity for this resource. + * + * @return the defaultProperty value. + */ + public Long defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the minimum property: The lowest permitted capacity for this resource. + * + * @return the minimum value. + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum property: The highest permitted capacity for this resource. + * + * @return the maximum value. + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the scaleType property: The localized name of the resource. + * + * @return the scaleType value. + */ + public ScaleType scaleType() { + return this.scaleType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCost.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCost.java new file mode 100644 index 0000000000000..5c23ce7e93190 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuCost.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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 array of costs of a lab services SKU. */ +@Immutable +public final class LabServicesSkuCost { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuCost.class); + + /* + * The meter id. + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /* + * The quantity of units charged. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Float quantity; + + /* + * The extended unit. + */ + @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) + private String extendedUnit; + + /** + * Get the meterId property: The meter id. + * + * @return the meterId value. + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the quantity property: The quantity of units charged. + * + * @return the quantity value. + */ + public Float quantity() { + return this.quantity; + } + + /** + * Get the extendedUnit property: The extended unit. + * + * @return the extendedUnit value. + */ + public String extendedUnit() { + return this.extendedUnit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuRestrictions.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuRestrictions.java new file mode 100644 index 0000000000000..ca093c4006990 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuRestrictions.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.labservices.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 restriction details. */ +@Immutable +public final class LabServicesSkuRestrictions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabServicesSkuRestrictions.class); + + /* + * The type of restriction. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private RestrictionType type; + + /* + * The values of the restriction. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The reason for the restriction. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private RestrictionReasonCode reasonCode; + + /** + * Get the type property: The type of restriction. + * + * @return the type value. + */ + public RestrictionType type() { + return this.type; + } + + /** + * Get the values property: The values of the restriction. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the reasonCode property: The reason for the restriction. + * + * @return the reasonCode value. + */ + public RestrictionReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuTier.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuTier.java new file mode 100644 index 0000000000000..67713ad39d904 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabServicesSkuTier.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.labservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LabServicesSkuTier. */ +public final class LabServicesSkuTier extends ExpandableStringEnum { + /** Static value Standard for LabServicesSkuTier. */ + public static final LabServicesSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for LabServicesSkuTier. */ + public static final LabServicesSkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a LabServicesSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding LabServicesSkuTier. + */ + @JsonCreator + public static LabServicesSkuTier fromString(String name) { + return fromString(name, LabServicesSkuTier.class); + } + + /** @return known LabServicesSkuTier values. */ + public static Collection values() { + return values(LabServicesSkuTier.class); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabState.java new file mode 100644 index 0000000000000..6001826eee8ca --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for LabState. */ +public enum LabState { + /** Enum value Draft. */ + DRAFT("Draft"), + + /** Enum value Publishing. */ + PUBLISHING("Publishing"), + + /** Enum value Scaling. */ + SCALING("Scaling"), + + /** Enum value Syncing. */ + SYNCING("Syncing"), + + /** Enum value Published. */ + PUBLISHED("Published"); + + /** The actual serialized value for a LabState instance. */ + private final String value; + + LabState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LabState instance. + * + * @param value the serialized value to parse. + * @return the parsed LabState object, or null if unable to parse. + */ + @JsonCreator + public static LabState fromString(String value) { + LabState[] items = LabState.values(); + for (LabState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUpdate.java new file mode 100644 index 0000000000000..5096140824f60 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUpdate.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.labservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.LabUpdateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The lab resource for updates. */ +@Fluent +public final class LabUpdate extends TrackedResourceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LabUpdate.class); + + /* + * Lab resource properties + */ + @JsonProperty(value = "properties") + private LabUpdateProperties innerProperties; + + /** + * Get the innerProperties property: Lab resource properties. + * + * @return the innerProperties value. + */ + private LabUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public LabUpdate withTags(List tags) { + super.withTags(tags); + return this; + } + + /** + * Get the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. + * + * @return the autoShutdownProfile value. + */ + public AutoShutdownProfile autoShutdownProfile() { + return this.innerProperties() == null ? null : this.innerProperties().autoShutdownProfile(); + } + + /** + * Set the autoShutdownProfile property: The resource auto shutdown configuration for the lab. This controls whether + * actions are taken on resources that are sitting idle. + * + * @param autoShutdownProfile the autoShutdownProfile value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withAutoShutdownProfile(AutoShutdownProfile autoShutdownProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withAutoShutdownProfile(autoShutdownProfile); + return this; + } + + /** + * Get the connectionProfile property: The connection profile for the lab. This controls settings such as web access + * to lab resources or whether RDP or SSH ports are open. + * + * @return the connectionProfile value. + */ + public ConnectionProfile connectionProfile() { + return this.innerProperties() == null ? null : this.innerProperties().connectionProfile(); + } + + /** + * Set the connectionProfile property: The connection profile for the lab. This controls settings such as web access + * to lab resources or whether RDP or SSH ports are open. + * + * @param connectionProfile the connectionProfile value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withConnectionProfile(ConnectionProfile connectionProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withConnectionProfile(connectionProfile); + return this; + } + + /** + * Get the virtualMachineProfile property: The profile used for creating lab virtual machines. + * + * @return the virtualMachineProfile value. + */ + public VirtualMachineProfile virtualMachineProfile() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineProfile(); + } + + /** + * Set the virtualMachineProfile property: The profile used for creating lab virtual machines. + * + * @param virtualMachineProfile the virtualMachineProfile value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withVirtualMachineProfile(VirtualMachineProfile virtualMachineProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withVirtualMachineProfile(virtualMachineProfile); + return this; + } + + /** + * Get the securityProfile property: The lab security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().securityProfile(); + } + + /** + * Set the securityProfile property: The lab security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withSecurityProfile(SecurityProfile securityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the rosterProfile property: The lab user list management profile. + * + * @return the rosterProfile value. + */ + public RosterProfile rosterProfile() { + return this.innerProperties() == null ? null : this.innerProperties().rosterProfile(); + } + + /** + * Set the rosterProfile property: The lab user list management profile. + * + * @param rosterProfile the rosterProfile value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withRosterProfile(RosterProfile rosterProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withRosterProfile(rosterProfile); + return this; + } + + /** + * Get the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as + * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. + * + * @return the labPlanId value. + */ + public String labPlanId() { + return this.innerProperties() == null ? null : this.innerProperties().labPlanId(); + } + + /** + * Set the labPlanId property: The ID of the lab plan. Used during resource creation to provide defaults and acts as + * a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides + * organization.. + * + * @param labPlanId the labPlanId value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withLabPlanId(String labPlanId) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withLabPlanId(labPlanId); + return this; + } + + /** + * Get the title property: The title of the lab. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: The title of the lab. + * + * @param title the title value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withTitle(title); + return this; + } + + /** + * Get the description property: The description of the lab. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the lab. + * + * @param description the description value to set. + * @return the LabUpdate object itself. + */ + public LabUpdate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new LabUpdateProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUserAccessMode.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUserAccessMode.java deleted file mode 100644 index 7127c657f8306..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LabUserAccessMode.java +++ /dev/null @@ -1,34 +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.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LabUserAccessMode. */ -public final class LabUserAccessMode extends ExpandableStringEnum { - /** Static value Restricted for LabUserAccessMode. */ - public static final LabUserAccessMode RESTRICTED = fromString("Restricted"); - - /** Static value Open for LabUserAccessMode. */ - public static final LabUserAccessMode OPEN = fromString("Open"); - - /** - * Creates or finds a LabUserAccessMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding LabUserAccessMode. - */ - @JsonCreator - public static LabUserAccessMode fromString(String name) { - return fromString(name, LabUserAccessMode.class); - } - - /** @return known LabUserAccessMode values. */ - public static Collection values() { - return values(LabUserAccessMode.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Labs.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Labs.java index 455434b9dc0fe..125099f450ff3 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Labs.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Labs.java @@ -11,181 +11,176 @@ /** Resource collection API of Labs. */ public interface Labs { /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. */ - PagedIterable list(String resourceGroupName, String labAccountName); + PagedIterable list(); /** - * List labs in a given lab account. + * Returns a list of all labs for a subscription. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of labs. + */ + PagedIterable list(String filter, Context context); + + /** + * Returns a list of all labs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of labs. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns a list of all labs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of labs. */ - PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Get lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the lab resource. */ - Lab get(String resourceGroupName, String labAccountName, String labName); + Lab getByResourceGroup(String resourceGroupName, String labName); /** - * Get lab. + * Returns the properties of a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the lab resource along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String labAccountName, String labName, String expand, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String labName, Context context); /** - * Delete lab. This operation can take a while to complete. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labAccountName, String labName); + void deleteByResourceGroup(String resourceGroupName, String labName); /** - * Delete lab. This operation can take a while to complete. + * Operation to delete a lab resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labAccountName, String labName, Context context); + void delete(String resourceGroupName, String labName, Context context); /** - * Add users to a lab. + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 addUsers(String resourceGroupName, String labAccountName, String labName, AddUsersPayload addUsersPayload); + void publish(String resourceGroupName, String labName); /** - * Add users to a lab. + * Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param addUsersPayload Payload for Add Users operation on a Lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 addUsersWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - AddUsersPayload addUsersPayload, - Context context); + void publish(String resourceGroupName, String labName, Context context); /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 register(String resourceGroupName, String labAccountName, String labName); + void syncGroup(String resourceGroupName, String labName); /** - * Register to managed lab. + * Action used to manually kick off an AAD group sync job. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 registerWithResponse( - String resourceGroupName, String labAccountName, String labName, Context context); + void syncGroup(String resourceGroupName, String labName, Context context); /** - * Get lab. + * Returns the properties of a lab resource. * * @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. + * @return the lab resource along with {@link Response}. */ Lab getById(String id); /** - * Get lab. + * Returns the properties of a lab resource. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the lab resource 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. + * Operation to delete a lab resource. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -195,7 +190,7 @@ Response registerWithResponse( void deleteById(String id); /** - * Delete lab. This operation can take a while to complete. + * Operation to delete a lab resource. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LatestOperationResult.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LatestOperationResult.java deleted file mode 100644 index 4d767a8b0111f..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/LatestOperationResult.java +++ /dev/null @@ -1,114 +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.labservices.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; - -/** Details of the status of an operation. */ -@Immutable -public final class LatestOperationResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LatestOperationResult.class); - - /* - * The current status of the operation. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * Error code on failure. - */ - @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) - private String errorCode; - - /* - * The error message. - */ - @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; - - /* - * Request URI of the operation. - */ - @JsonProperty(value = "requestUri", access = JsonProperty.Access.WRITE_ONLY) - private String requestUri; - - /* - * The HttpMethod - PUT/POST/DELETE for the operation. - */ - @JsonProperty(value = "httpMethod", access = JsonProperty.Access.WRITE_ONLY) - private String httpMethod; - - /* - * The URL to use to check long-running operation status - */ - @JsonProperty(value = "operationUrl", access = JsonProperty.Access.WRITE_ONLY) - private String operationUrl; - - /** - * Get the status property: The current status of the operation. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the errorCode property: Error code on failure. - * - * @return the errorCode value. - */ - public String errorCode() { - return this.errorCode; - } - - /** - * Get the errorMessage property: The error message. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Get the requestUri property: Request URI of the operation. - * - * @return the requestUri value. - */ - public String requestUri() { - return this.requestUri; - } - - /** - * Get the httpMethod property: The HttpMethod - PUT/POST/DELETE for the operation. - * - * @return the httpMethod value. - */ - public String httpMethod() { - return this.httpMethod; - } - - /** - * Get the operationUrl property: The URL to use to check long-running operation status. - * - * @return the operationUrl value. - */ - public String operationUrl() { - return this.operationUrl; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListEnvironmentsResponse.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListEnvironmentsResponse.java deleted file mode 100644 index 0a8455b1710c9..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListEnvironmentsResponse.java +++ /dev/null @@ -1,25 +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.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.ListEnvironmentsResponseInner; -import java.util.List; - -/** An immutable client-side representation of ListEnvironmentsResponse. */ -public interface ListEnvironmentsResponse { - /** - * Gets the environments property: List of all the environments. - * - * @return the environments value. - */ - List environments(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.ListEnvironmentsResponseInner object. - * - * @return the inner object. - */ - ListEnvironmentsResponseInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListLabsResponse.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListLabsResponse.java deleted file mode 100644 index efb177ce28fb5..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListLabsResponse.java +++ /dev/null @@ -1,25 +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.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.ListLabsResponseInner; -import java.util.List; - -/** An immutable client-side representation of ListLabsResponse. */ -public interface ListLabsResponse { - /** - * Gets the labs property: List of all the labs. - * - * @return the labs value. - */ - List labs(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.ListLabsResponseInner object. - * - * @return the inner object. - */ - ListLabsResponseInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListUsagesResult.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListUsagesResult.java new file mode 100644 index 0000000000000..b53f3bea911da --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ListUsagesResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Core Usages. */ +@Immutable +public final class ListUsagesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListUsagesResult.class); + + /* + * The array page of Usages. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link to get the next page of Usage result. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The array page of Usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to get the next page of Usage result. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ManagedLabVmSize.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ManagedLabVmSize.java deleted file mode 100644 index 62be1ed149326..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ManagedLabVmSize.java +++ /dev/null @@ -1,37 +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.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ManagedLabVmSize. */ -public final class ManagedLabVmSize extends ExpandableStringEnum { - /** Static value Basic for ManagedLabVmSize. */ - public static final ManagedLabVmSize BASIC = fromString("Basic"); - - /** Static value Standard for ManagedLabVmSize. */ - public static final ManagedLabVmSize STANDARD = fromString("Standard"); - - /** Static value Performance for ManagedLabVmSize. */ - public static final ManagedLabVmSize PERFORMANCE = fromString("Performance"); - - /** - * Creates or finds a ManagedLabVmSize from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedLabVmSize. - */ - @JsonCreator - public static ManagedLabVmSize fromString(String name) { - return fromString(name, ManagedLabVmSize.class); - } - - /** @return known ManagedLabVmSize values. */ - public static Collection values() { - return values(ManagedLabVmSize.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/NetworkInterface.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/NetworkInterface.java deleted file mode 100644 index eacc9018d01be..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/NetworkInterface.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Network details of the environment. */ -@Immutable -public final class NetworkInterface { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterface.class); - - /* - * PrivateIp address of the Compute VM - */ - @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) - private String privateIpAddress; - - /* - * Connection information for Linux - */ - @JsonProperty(value = "sshAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String sshAuthority; - - /* - * Connection information for Windows - */ - @JsonProperty(value = "rdpAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String rdpAuthority; - - /* - * Username of the VM - */ - @JsonProperty(value = "username", access = JsonProperty.Access.WRITE_ONLY) - private String username; - - /** - * Get the privateIpAddress property: PrivateIp address of the Compute VM. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Get the sshAuthority property: Connection information for Linux. - * - * @return the sshAuthority value. - */ - public String sshAuthority() { - return this.sshAuthority; - } - - /** - * Get the rdpAuthority property: Connection information for Windows. - * - * @return the rdpAuthority value. - */ - public String rdpAuthority() { - return this.rdpAuthority; - } - - /** - * Get the username property: Username of the VM. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operation.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operation.java new file mode 100644 index 0000000000000..fed22e24e7f40 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.resourcemanager.labservices.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.labservices.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusPayload.java deleted file mode 100644 index 2dfb52b281fee..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusPayload.java +++ /dev/null @@ -1,57 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Payload to get the status of an operation. */ -@Fluent -public final class OperationBatchStatusPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationBatchStatusPayload.class); - - /* - * The operation url of long running operation - */ - @JsonProperty(value = "urls", required = true) - private List urls; - - /** - * Get the urls property: The operation url of long running operation. - * - * @return the urls value. - */ - public List urls() { - return this.urls; - } - - /** - * Set the urls property: The operation url of long running operation. - * - * @param urls the urls value to set. - * @return the OperationBatchStatusPayload object itself. - */ - public OperationBatchStatusPayload withUrls(List urls) { - this.urls = urls; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (urls() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property urls in model OperationBatchStatusPayload")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponse.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponse.java deleted file mode 100644 index 7eba8f5bbbef7..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponse.java +++ /dev/null @@ -1,25 +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.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.OperationBatchStatusResponseInner; -import java.util.List; - -/** An immutable client-side representation of OperationBatchStatusResponse. */ -public interface OperationBatchStatusResponse { - /** - * Gets the items property: Gets a collection of items that contain the operation url and status. - * - * @return the items value. - */ - List items(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.OperationBatchStatusResponseInner object. - * - * @return the inner object. - */ - OperationBatchStatusResponseInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponseItem.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponseItem.java deleted file mode 100644 index fa5dcbfdc6698..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationBatchStatusResponseItem.java +++ /dev/null @@ -1,54 +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.labservices.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; - -/** Represents the status of an operation that used the batch API. */ -@Immutable -public final class OperationBatchStatusResponseItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationBatchStatusResponseItem.class); - - /* - * status of the long running operation for an environment - */ - @JsonProperty(value = "operationUrl", access = JsonProperty.Access.WRITE_ONLY) - private String operationUrl; - - /* - * status of the long running operation for an environment - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /** - * Get the operationUrl property: status of the long running operation for an environment. - * - * @return the operationUrl value. - */ - public String operationUrl() { - return this.operationUrl; - } - - /** - * Get the status property: status of the long running operation for an environment. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationDisplay.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationDisplay.java new file mode 100644 index 0000000000000..9246e790087bb --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationDisplay.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * The localized friendly form of the resource provider name, e.g. + * "Microsoft Monitoring Insights" or "Microsoft Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this + * operation. E.g. "Virtual Machines" or "Job Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for + * dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + * Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for + * tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationError.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationError.java deleted file mode 100644 index 11b37ff057707..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationError.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Error details for the operation in case of a failure. */ -@Fluent -public final class OperationError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationError.class); - - /* - * The error code of the operation error. - */ - @JsonProperty(value = "code") - private String code; - - /* - * The error message of the operation error. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get the code property: The error code of the operation error. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: The error code of the operation error. - * - * @param code the code value to set. - * @return the OperationError object itself. - */ - public OperationError withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: The error message of the operation error. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The error message of the operation error. - * - * @param message the message value to set. - * @return the OperationError object itself. - */ - public OperationError withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProviderOperationResult.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationListResult.java similarity index 59% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProviderOperationResult.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationListResult.java index 56871ce92b13d..6634c72e53e41 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProviderOperationResult.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationListResult.java @@ -4,26 +4,29 @@ package com.azure.resourcemanager.labservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.OperationMetadataInner; +import com.azure.resourcemanager.labservices.fluent.models.OperationInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Result of the request to list REST API operations. */ -@Fluent -public final class ProviderOperationResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProviderOperationResult.class); +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); /* - * List of operations supported by the resource provider. + * List of operations supported by the resource provider */ - @JsonProperty(value = "value") - private List value; + @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. + * URL to get the next set of operation list results (if there are any). */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; @@ -33,23 +36,12 @@ public final class ProviderOperationResult { * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List of operations supported by the resource provider. - * - * @param value the value value to set. - * @return the ProviderOperationResult object itself. - */ - public ProviderOperationResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. + * Get the nextLink property: URL to get the next set of operation list results (if there are any). * * @return the nextLink value. */ diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadata.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadata.java deleted file mode 100644 index 7fdfd72e59266..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadata.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.OperationMetadataInner; - -/** An immutable client-side representation of OperationMetadata. */ -public interface OperationMetadata { - /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: The object that describes the operations. - * - * @return the display value. - */ - OperationMetadataDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.OperationMetadataInner object. - * - * @return the inner object. - */ - OperationMetadataInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadataDisplay.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadataDisplay.java deleted file mode 100644 index bb9fb79046393..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationMetadataDisplay.java +++ /dev/null @@ -1,128 +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.labservices.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 object that describes the operations. */ -@Fluent -public final class OperationMetadataDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetadataDisplay.class); - - /* - * Friendly name of the resource provider - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource type on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Operation type: read, write, delete, listKeys/action, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Friendly name of the operation - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: Friendly name of the resource provider. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Friendly name of the resource provider. - * - * @param provider the provider value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource type on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource type on which the operation is performed. - * - * @param resource the resource value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: read, write, delete, listKeys/action, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Operation type: read, write, delete, listKeys/action, etc. - * - * @param operation the operation value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Friendly name of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Friendly name of the operation. - * - * @param description the description value to set. - * @return the OperationMetadataDisplay object itself. - */ - public OperationMetadataDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResult.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResult.java index 30a364a4d6ef0..ee23d9b048625 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResult.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResult.java @@ -4,23 +4,61 @@ package com.azure.resourcemanager.labservices.models; +import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.labservices.fluent.models.OperationResultInner; +import java.time.OffsetDateTime; /** An immutable client-side representation of OperationResult. */ public interface OperationResult { + /** + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + /** * Gets the status property: The operation status. * * @return the status value. */ - String status(); + OperationStatus status(); + + /** + * Gets the startTime property: Start time. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: Percent completion. + * + * @return the percentComplete value. + */ + Float percentComplete(); /** - * Gets the error property: Error details for the operation in case of a failure. + * Gets the error property: The error for a failure if the operation failed. * * @return the error value. */ - OperationError error(); + ManagementError error(); /** * Gets the inner com.azure.resourcemanager.labservices.fluent.models.OperationResultInner object. diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResults.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResults.java new file mode 100644 index 0000000000000..81dff83403cf6 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationResults.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.labservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OperationResults. */ +public interface OperationResults { + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a long running operation result. + */ + OperationResult get(String operationResultId); + + /** + * Returns an azure operation result. + * + * @param operationResultId The operation result ID / name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a long running operation result along with {@link Response}. + */ + Response getWithResponse(String operationResultId, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatus.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatus.java new file mode 100644 index 0000000000000..ff8f0c11dbf04 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OperationStatus. */ +public enum OperationStatus { + /** Enum value NotStarted. */ + NOT_STARTED("NotStarted"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Canceled. */ + CANCELED("Canceled"); + + /** The actual serialized value for a OperationStatus instance. */ + private final String value; + + OperationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OperationStatus object, or null if unable to parse. + */ + @JsonCreator + public static OperationStatus fromString(String value) { + OperationStatus[] items = OperationStatus.values(); + for (OperationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusPayload.java deleted file mode 100644 index 4ed46a52eb609..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusPayload.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Payload to get the status of an operation. */ -@Fluent -public final class OperationStatusPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusPayload.class); - - /* - * The operation url of long running operation - */ - @JsonProperty(value = "operationUrl", required = true) - private String operationUrl; - - /** - * Get the operationUrl property: The operation url of long running operation. - * - * @return the operationUrl value. - */ - public String operationUrl() { - return this.operationUrl; - } - - /** - * Set the operationUrl property: The operation url of long running operation. - * - * @param operationUrl the operationUrl value to set. - * @return the OperationStatusPayload object itself. - */ - public OperationStatusPayload withOperationUrl(String operationUrl) { - this.operationUrl = operationUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (operationUrl() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property operationUrl in model OperationStatusPayload")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusResponse.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusResponse.java deleted file mode 100644 index 1cf3112830090..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OperationStatusResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.resourcemanager.labservices.fluent.models.OperationStatusResponseInner; - -/** An immutable client-side representation of OperationStatusResponse. */ -public interface OperationStatusResponse { - /** - * Gets the status property: status of the long running operation for an environment. - * - * @return the status value. - */ - String status(); - - /** - * Gets the inner com.azure.resourcemanager.labservices.fluent.models.OperationStatusResponseInner object. - * - * @return the inner object. - */ - OperationStatusResponseInner innerModel(); -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operations.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operations.java index cbd373182722f..0e615a4081433 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operations.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Operations.java @@ -4,33 +4,28 @@ package com.azure.resourcemanager.labservices.models; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; /** Resource collection API of Operations. */ public interface Operations { /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a list of REST API operations supported by an Azure Resource Provider. */ - OperationResult get(String locationName, String operationName); + PagedIterable list(); /** - * Get operation. + * Returns a list of all operations. * - * @param locationName The name of the location. - * @param operationName The name of the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation. + * @return a list of REST API operations supported by an Azure Resource Provider. */ - Response getWithResponse(String locationName, String operationName, Context context); + PagedIterable list(Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Origin.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Origin.java new file mode 100644 index 0000000000000..ce93018c75af4 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Origin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** @return known Origin values. */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsState.java new file mode 100644 index 0000000000000..22663c648632c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsState.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OsState. */ +public enum OsState { + /** Enum value Generalized. */ + GENERALIZED("Generalized"), + + /** Enum value Specialized. */ + SPECIALIZED("Specialized"); + + /** The actual serialized value for a OsState instance. */ + private final String value; + + OsState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OsState instance. + * + * @param value the serialized value to parse. + * @return the parsed OsState object, or null if unable to parse. + */ + @JsonCreator + public static OsState fromString(String value) { + OsState[] items = OsState.values(); + for (OsState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsType.java new file mode 100644 index 0000000000000..812e86cde56bb --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/OsType.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OsType. */ +public enum OsType { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OsType instance. */ + private final String value; + + OsType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OsType instance. + * + * @param value the serialized value to parse. + * @return the parsed OsType object, or null if unable to parse. + */ + @JsonCreator + public static OsType fromString(String value) { + OsType[] items = OsType.values(); + for (OsType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedImages.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedImages.java new file mode 100644 index 0000000000000..e432ba3f3cd5b --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedImages.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.ImageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of Lab services virtual machine images. */ +@Immutable +public final class PagedImages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedImages.class); + + /* + * The array page of virtual machine images. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link to get the next page of image results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The array page of virtual machine images. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to get the next page of image results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabPlans.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabPlans.java new file mode 100644 index 0000000000000..dcff034630b7d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabPlans.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.LabPlanInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of lab plans. */ +@Immutable +public final class PagedLabPlans { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedLabPlans.class); + + /* + * The array page of lab plans. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link to get the next page of lab plan results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The array page of lab plans. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to get the next page of lab plan results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabServicesSkus.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabServicesSkus.java new file mode 100644 index 0000000000000..4242b873b0f87 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabServicesSkus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.LabServicesSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of lab services skus. */ +@Immutable +public final class PagedLabServicesSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedLabServicesSkus.class); + + /* + * The array page of sku results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link to get the next page of sku results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The array page of sku results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to get the next page of sku results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationLab.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabs.java similarity index 50% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationLab.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabs.java index 99f0823ce08cf..55c7f15e3c7bc 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationLab.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedLabs.java @@ -4,32 +4,32 @@ package com.azure.resourcemanager.labservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.labservices.fluent.models.LabInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ -@Fluent -public final class ResponseWithContinuationLab { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseWithContinuationLab.class); +/** Paged list of labs. */ +@Immutable +public final class PagedLabs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedLabs.class); /* - * Results of the list operation. + * The array page of lab results. */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * The link to get the next page of image results. */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: The array page of lab results. * * @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 ResponseWithContinuationLab object itself. - */ - public ResponseWithContinuationLab withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to get the next page of image results. * * @return the nextLink value. */ @@ -57,17 +46,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ResponseWithContinuationLab object itself. - */ - public ResponseWithContinuationLab withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedSchedules.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedSchedules.java new file mode 100644 index 0000000000000..06530cb89b913 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedSchedules.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of schedules. */ +@Immutable +public final class PagedSchedules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedSchedules.class); + + /* + * The array page of schedule results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link to get the next page of schedule results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The array page of schedule results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to get the next page of schedule results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationUser.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedUsers.java similarity index 50% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationUser.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedUsers.java index 2b206cfe9e139..5fa61d0f1a933 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationUser.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedUsers.java @@ -4,32 +4,32 @@ package com.azure.resourcemanager.labservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.labservices.fluent.models.UserInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a list operation. */ -@Fluent -public final class ResponseWithContinuationUser { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseWithContinuationUser.class); +/** Paged list of users. */ +@Immutable +public final class PagedUsers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedUsers.class); /* - * Results of the list operation. + * The array page of user results. */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Link for next set of results. + * The link to get the next page of image results. */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** - * Get the value property: Results of the list operation. + * Get the value property: The array page of user results. * * @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 ResponseWithContinuationUser object itself. - */ - public ResponseWithContinuationUser withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. + * Get the nextLink property: The link to get the next page of image results. * * @return the nextLink value. */ @@ -57,17 +46,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ResponseWithContinuationUser object itself. - */ - public ResponseWithContinuationUser withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedVirtualMachines.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedVirtualMachines.java new file mode 100644 index 0000000000000..9f6a4cd97ddc1 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PagedVirtualMachines.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of lab services virtual machines. */ +@Immutable +public final class PagedVirtualMachines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PagedVirtualMachines.class); + + /* + * The array page of virtual machine results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link to get the next page of virtual machine results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The array page of virtual machine results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to get the next page of virtual machine results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PersonalPreferencesOperationsPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PersonalPreferencesOperationsPayload.java deleted file mode 100644 index 57b843eec27fc..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PersonalPreferencesOperationsPayload.java +++ /dev/null @@ -1,102 +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.labservices.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; - -/** Represents payload for any Environment operations like get, start, stop, connect. */ -@Fluent -public final class PersonalPreferencesOperationsPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PersonalPreferencesOperationsPayload.class); - - /* - * Resource Id of the lab account - */ - @JsonProperty(value = "labAccountResourceId") - private String labAccountResourceId; - - /* - * Enum indicating if user is adding or removing a favorite lab - */ - @JsonProperty(value = "addRemove") - private AddRemove addRemove; - - /* - * Resource Id of the lab to add/remove from the favorites list - */ - @JsonProperty(value = "labResourceId") - private String labResourceId; - - /** - * Get the labAccountResourceId property: Resource Id of the lab account. - * - * @return the labAccountResourceId value. - */ - public String labAccountResourceId() { - return this.labAccountResourceId; - } - - /** - * Set the labAccountResourceId property: Resource Id of the lab account. - * - * @param labAccountResourceId the labAccountResourceId value to set. - * @return the PersonalPreferencesOperationsPayload object itself. - */ - public PersonalPreferencesOperationsPayload withLabAccountResourceId(String labAccountResourceId) { - this.labAccountResourceId = labAccountResourceId; - return this; - } - - /** - * Get the addRemove property: Enum indicating if user is adding or removing a favorite lab. - * - * @return the addRemove value. - */ - public AddRemove addRemove() { - return this.addRemove; - } - - /** - * Set the addRemove property: Enum indicating if user is adding or removing a favorite lab. - * - * @param addRemove the addRemove value to set. - * @return the PersonalPreferencesOperationsPayload object itself. - */ - public PersonalPreferencesOperationsPayload withAddRemove(AddRemove addRemove) { - this.addRemove = addRemove; - return this; - } - - /** - * Get the labResourceId property: Resource Id of the lab to add/remove from the favorites list. - * - * @return the labResourceId value. - */ - public String labResourceId() { - return this.labResourceId; - } - - /** - * Set the labResourceId property: Resource Id of the lab to add/remove from the favorites list. - * - * @param labResourceId the labResourceId value to set. - * @return the PersonalPreferencesOperationsPayload object itself. - */ - public PersonalPreferencesOperationsPayload withLabResourceId(String labResourceId) { - this.labResourceId = labResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProvisioningState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProvisioningState.java new file mode 100644 index 0000000000000..556aafaacdaad --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProvisioningState. */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Updating. */ + UPDATING("Updating"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Locked. */ + LOCKED("Locked"); + + /** The actual serialized value for a ProvisioningState instance. */ + private final String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishPayload.java deleted file mode 100644 index 9dcbe4ba94985..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishPayload.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Payload for Publish operation on EnvironmentSetting. */ -@Fluent -public final class PublishPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PublishPayload.class); - - /* - * Whether to use existing VM custom image when publishing. - */ - @JsonProperty(value = "useExistingImage") - private Boolean useExistingImage; - - /** - * Get the useExistingImage property: Whether to use existing VM custom image when publishing. - * - * @return the useExistingImage value. - */ - public Boolean useExistingImage() { - return this.useExistingImage; - } - - /** - * Set the useExistingImage property: Whether to use existing VM custom image when publishing. - * - * @param useExistingImage the useExistingImage value to set. - * @return the PublishPayload object itself. - */ - public PublishPayload withUseExistingImage(Boolean useExistingImage) { - this.useExistingImage = useExistingImage; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishingState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishingState.java deleted file mode 100644 index 4aa8f181504a0..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/PublishingState.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for PublishingState. */ -public final class PublishingState extends ExpandableStringEnum { - /** Static value Draft for PublishingState. */ - public static final PublishingState DRAFT = fromString("Draft"); - - /** Static value Publishing for PublishingState. */ - public static final PublishingState PUBLISHING = fromString("Publishing"); - - /** Static value Published for PublishingState. */ - public static final PublishingState PUBLISHED = fromString("Published"); - - /** Static value PublishFailed for PublishingState. */ - public static final PublishingState PUBLISH_FAILED = fromString("PublishFailed"); - - /** Static value Scaling for PublishingState. */ - public static final PublishingState SCALING = fromString("Scaling"); - - /** - * Creates or finds a PublishingState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublishingState. - */ - @JsonCreator - public static PublishingState fromString(String name) { - return fromString(name, PublishingState.class); - } - - /** @return known PublishingState values. */ - public static Collection values() { - return values(PublishingState.class); - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrenceFrequency.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrenceFrequency.java new file mode 100644 index 0000000000000..44991f1d49e2d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrenceFrequency.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RecurrenceFrequency. */ +public enum RecurrenceFrequency { + /** Enum value Daily. */ + DAILY("Daily"), + + /** Enum value Weekly. */ + WEEKLY("Weekly"); + + /** The actual serialized value for a RecurrenceFrequency instance. */ + private final String value; + + RecurrenceFrequency(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecurrenceFrequency instance. + * + * @param value the serialized value to parse. + * @return the parsed RecurrenceFrequency object, or null if unable to parse. + */ + @JsonCreator + public static RecurrenceFrequency fromString(String value) { + RecurrenceFrequency[] items = RecurrenceFrequency.values(); + for (RecurrenceFrequency item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrencePattern.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrencePattern.java new file mode 100644 index 0000000000000..e9359d6b1e666 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RecurrencePattern.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.labservices.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.LocalDate; +import java.util.List; + +/** Recurrence pattern of a lab schedule. */ +@Fluent +public final class RecurrencePattern { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecurrencePattern.class); + + /* + * The frequency of the recurrence. + */ + @JsonProperty(value = "frequency", required = true) + private RecurrenceFrequency frequency; + + /* + * The week days the schedule runs. Used for when the Frequency is set to + * Weekly. + */ + @JsonProperty(value = "weekDays") + private List weekDays; + + /* + * The interval to invoke the schedule on. For example, interval = 2 and + * RecurrenceFrequency.Daily will run every 2 days. When no interval is + * supplied, an interval of 1 is used. + */ + @JsonProperty(value = "interval") + private Integer interval; + + /* + * When the recurrence will expire. This date is inclusive. + */ + @JsonProperty(value = "expirationDate", required = true) + private LocalDate expirationDate; + + /** + * Get the frequency property: The frequency of the recurrence. + * + * @return the frequency value. + */ + public RecurrenceFrequency frequency() { + return this.frequency; + } + + /** + * Set the frequency property: The frequency of the recurrence. + * + * @param frequency the frequency value to set. + * @return the RecurrencePattern object itself. + */ + public RecurrencePattern withFrequency(RecurrenceFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get the weekDays property: The week days the schedule runs. Used for when the Frequency is set to Weekly. + * + * @return the weekDays value. + */ + public List weekDays() { + return this.weekDays; + } + + /** + * Set the weekDays property: The week days the schedule runs. Used for when the Frequency is set to Weekly. + * + * @param weekDays the weekDays value to set. + * @return the RecurrencePattern object itself. + */ + public RecurrencePattern withWeekDays(List weekDays) { + this.weekDays = weekDays; + return this; + } + + /** + * Get the interval property: The interval to invoke the schedule on. For example, interval = 2 and + * RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: The interval to invoke the schedule on. For example, interval = 2 and + * RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. + * + * @param interval the interval value to set. + * @return the RecurrencePattern object itself. + */ + public RecurrencePattern withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the expirationDate property: When the recurrence will expire. This date is inclusive. + * + * @return the expirationDate value. + */ + public LocalDate expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: When the recurrence will expire. This date is inclusive. + * + * @param expirationDate the expirationDate value to set. + * @return the RecurrencePattern object itself. + */ + public RecurrencePattern withExpirationDate(LocalDate expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (frequency() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property frequency in model RecurrencePattern")); + } + if (expirationDate() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property expirationDate in model RecurrencePattern")); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVm.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVm.java deleted file mode 100644 index f0e095bc4c110..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVm.java +++ /dev/null @@ -1,115 +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.labservices.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; - -/** Details of a Reference Vm. */ -@Fluent -public final class ReferenceVm { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReferenceVm.class); - - /* - * The username of the virtual machine - */ - @JsonProperty(value = "userName", required = true) - private String username; - - /* - * The password of the virtual machine. This will be set to null in GET - * resource API - */ - @JsonProperty(value = "password") - private String password; - - /* - * The state details for the reference virtual machine. - */ - @JsonProperty(value = "vmStateDetails", access = JsonProperty.Access.WRITE_ONLY) - private VmStateDetails vmStateDetails; - - /* - * VM resource Id for the environment - */ - @JsonProperty(value = "vmResourceId", access = JsonProperty.Access.WRITE_ONLY) - private String vmResourceId; - - /** - * Get the username property: The username of the virtual machine. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The username of the virtual machine. - * - * @param username the username value to set. - * @return the ReferenceVm object itself. - */ - public ReferenceVm withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the password property: The password of the virtual machine. This will be set to null in GET resource API. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: The password of the virtual machine. This will be set to null in GET resource API. - * - * @param password the password value to set. - * @return the ReferenceVm object itself. - */ - public ReferenceVm withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the vmStateDetails property: The state details for the reference virtual machine. - * - * @return the vmStateDetails value. - */ - public VmStateDetails vmStateDetails() { - return this.vmStateDetails; - } - - /** - * Get the vmResourceId property: VM resource Id for the environment. - * - * @return the vmResourceId value. - */ - public String vmResourceId() { - return this.vmResourceId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (username() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property username in model ReferenceVm")); - } - if (vmStateDetails() != null) { - vmStateDetails().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegionalAvailability.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegionalAvailability.java deleted file mode 100644 index 0cb0323e4206e..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegionalAvailability.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The availability information of sizes across regions. */ -@Fluent -public final class RegionalAvailability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionalAvailability.class); - - /* - * Corresponding region - */ - @JsonProperty(value = "region") - private String region; - - /* - * List of all the size information for the region - */ - @JsonProperty(value = "sizeAvailabilities") - private List sizeAvailabilities; - - /** - * Get the region property: Corresponding region. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Set the region property: Corresponding region. - * - * @param region the region value to set. - * @return the RegionalAvailability object itself. - */ - public RegionalAvailability withRegion(String region) { - this.region = region; - return this; - } - - /** - * Get the sizeAvailabilities property: List of all the size information for the region. - * - * @return the sizeAvailabilities value. - */ - public List sizeAvailabilities() { - return this.sizeAvailabilities; - } - - /** - * Set the sizeAvailabilities property: List of all the size information for the region. - * - * @param sizeAvailabilities the sizeAvailabilities value to set. - * @return the RegionalAvailability object itself. - */ - public RegionalAvailability withSizeAvailabilities(List sizeAvailabilities) { - this.sizeAvailabilities = sizeAvailabilities; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sizeAvailabilities() != null) { - sizeAvailabilities().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegistrationState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegistrationState.java new file mode 100644 index 0000000000000..d1fa193e37a6b --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegistrationState.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RegistrationState. */ +public enum RegistrationState { + /** Enum value Registered. */ + REGISTERED("Registered"), + + /** Enum value NotRegistered. */ + NOT_REGISTERED("NotRegistered"); + + /** The actual serialized value for a RegistrationState instance. */ + private final String value; + + RegistrationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RegistrationState instance. + * + * @param value the serialized value to parse. + * @return the parsed RegistrationState object, or null if unable to parse. + */ + @JsonCreator + public static RegistrationState fromString(String value) { + RegistrationState[] items = RegistrationState.values(); + for (RegistrationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVmCreationParameters.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordBody.java similarity index 57% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVmCreationParameters.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordBody.java index 02dea3c1be7f8..b7cb2ec1e4f5a 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ReferenceVmCreationParameters.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordBody.java @@ -9,25 +9,25 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Creation parameters for Reference Vm. */ +/** Body of a reset password request. */ @Fluent -public final class ReferenceVmCreationParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReferenceVmCreationParameters.class); +public final class ResetPasswordBody { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResetPasswordBody.class); /* - * The username of the virtual machine + * The user whose password is being reset */ - @JsonProperty(value = "userName", required = true) + @JsonProperty(value = "username", required = true) private String username; /* - * The password of the virtual machine. + * The password */ @JsonProperty(value = "password", required = true) private String password; /** - * Get the username property: The username of the virtual machine. + * Get the username property: The user whose password is being reset. * * @return the username value. */ @@ -36,18 +36,18 @@ public String username() { } /** - * Set the username property: The username of the virtual machine. + * Set the username property: The user whose password is being reset. * * @param username the username value to set. - * @return the ReferenceVmCreationParameters object itself. + * @return the ResetPasswordBody object itself. */ - public ReferenceVmCreationParameters withUsername(String username) { + public ResetPasswordBody withUsername(String username) { this.username = username; return this; } /** - * Get the password property: The password of the virtual machine. + * Get the password property: The password. * * @return the password value. */ @@ -56,12 +56,12 @@ public String password() { } /** - * Set the password property: The password of the virtual machine. + * Set the password property: The password. * * @param password the password value to set. - * @return the ReferenceVmCreationParameters object itself. + * @return the ResetPasswordBody object itself. */ - public ReferenceVmCreationParameters withPassword(String password) { + public ResetPasswordBody withPassword(String password) { this.password = password; return this; } @@ -75,14 +75,12 @@ public void validate() { if (username() == null) { throw logger .logExceptionAsError( - new IllegalArgumentException( - "Missing required property username in model ReferenceVmCreationParameters")); + new IllegalArgumentException("Missing required property username in model ResetPasswordBody")); } if (password() == null) { throw logger .logExceptionAsError( - new IllegalArgumentException( - "Missing required property password in model ReferenceVmCreationParameters")); + new IllegalArgumentException("Missing required property password in model ResetPasswordBody")); } } } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordPayload.java deleted file mode 100644 index 4c24a5f6d3b39..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResetPasswordPayload.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.labservices.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; - -/** Represents the payload for resetting passwords. */ -@Fluent -public final class ResetPasswordPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResetPasswordPayload.class); - - /* - * The resourceId of the environment - */ - @JsonProperty(value = "environmentId", required = true) - private String environmentId; - - /* - * The username for which the password will be reset. - */ - @JsonProperty(value = "username") - private String username; - - /* - * The password to assign to the user specified in - */ - @JsonProperty(value = "password") - private String password; - - /** - * Get the environmentId property: The resourceId of the environment. - * - * @return the environmentId value. - */ - public String environmentId() { - return this.environmentId; - } - - /** - * Set the environmentId property: The resourceId of the environment. - * - * @param environmentId the environmentId value to set. - * @return the ResetPasswordPayload object itself. - */ - public ResetPasswordPayload withEnvironmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Get the username property: The username for which the password will be reset. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The username for which the password will be reset. - * - * @param username the username value to set. - * @return the ResetPasswordPayload object itself. - */ - public ResetPasswordPayload withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the password property: The password to assign to the user specified in. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: The password to assign to the user specified in. - * - * @param password the password value to set. - * @return the ResetPasswordPayload object itself. - */ - public ResetPasswordPayload withPassword(String password) { - this.password = password; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (environmentId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property environmentId in model ResetPasswordPayload")); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSet.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSet.java deleted file mode 100644 index c830e28d6ef6c..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSet.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Represents a VM and the setting Id it was created for. */ -@Fluent -public final class ResourceSet { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSet.class); - - /* - * VM resource Id for the environment - */ - @JsonProperty(value = "vmResourceId") - private String vmResourceId; - - /* - * resourceSettingId for the environment - */ - @JsonProperty(value = "resourceSettingId") - private String resourceSettingId; - - /** - * Get the vmResourceId property: VM resource Id for the environment. - * - * @return the vmResourceId value. - */ - public String vmResourceId() { - return this.vmResourceId; - } - - /** - * Set the vmResourceId property: VM resource Id for the environment. - * - * @param vmResourceId the vmResourceId value to set. - * @return the ResourceSet object itself. - */ - public ResourceSet withVmResourceId(String vmResourceId) { - this.vmResourceId = vmResourceId; - return this; - } - - /** - * Get the resourceSettingId property: resourceSettingId for the environment. - * - * @return the resourceSettingId value. - */ - public String resourceSettingId() { - return this.resourceSettingId; - } - - /** - * Set the resourceSettingId property: resourceSettingId for the environment. - * - * @param resourceSettingId the resourceSettingId value to set. - * @return the ResourceSet object itself. - */ - public ResourceSet withResourceSettingId(String resourceSettingId) { - this.resourceSettingId = resourceSettingId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSetFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSetFragment.java deleted file mode 100644 index 8bd9c588398c0..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSetFragment.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Represents a VM and the setting Id it was created for. */ -@Fluent -public final class ResourceSetFragment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSetFragment.class); - - /* - * VM resource Id for the environment - */ - @JsonProperty(value = "vmResourceId") - private String vmResourceId; - - /* - * resourceSettingId for the environment - */ - @JsonProperty(value = "resourceSettingId") - private String resourceSettingId; - - /** - * Get the vmResourceId property: VM resource Id for the environment. - * - * @return the vmResourceId value. - */ - public String vmResourceId() { - return this.vmResourceId; - } - - /** - * Set the vmResourceId property: VM resource Id for the environment. - * - * @param vmResourceId the vmResourceId value to set. - * @return the ResourceSetFragment object itself. - */ - public ResourceSetFragment withVmResourceId(String vmResourceId) { - this.vmResourceId = vmResourceId; - return this; - } - - /** - * Get the resourceSettingId property: resourceSettingId for the environment. - * - * @return the resourceSettingId value. - */ - public String resourceSettingId() { - return this.resourceSettingId; - } - - /** - * Set the resourceSettingId property: resourceSettingId for the environment. - * - * @param resourceSettingId the resourceSettingId value to set. - * @return the ResourceSetFragment object itself. - */ - public ResourceSetFragment withResourceSettingId(String resourceSettingId) { - this.resourceSettingId = resourceSettingId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingCreationParameters.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingCreationParameters.java deleted file mode 100644 index b2428be7ced59..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingCreationParameters.java +++ /dev/null @@ -1,173 +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.labservices.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; - -/** Represents resource specific settings. */ -@Fluent -public final class ResourceSettingCreationParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSettingCreationParameters.class); - - /* - * The location where the virtual machine will live - */ - @JsonProperty(value = "location") - private String location; - - /* - * The name of the resource setting - */ - @JsonProperty(value = "name") - private String name; - - /* - * The resource id of the gallery image used for creating the virtual - * machine - */ - @JsonProperty(value = "galleryImageResourceId", required = true) - private String galleryImageResourceId; - - /* - * The size of the virtual machine - */ - @JsonProperty(value = "size") - private ManagedLabVmSize size; - - /* - * Creation parameters for Reference Vm - */ - @JsonProperty(value = "referenceVmCreationParameters", required = true) - private ReferenceVmCreationParameters referenceVmCreationParameters; - - /** - * Get the location property: The location where the virtual machine will live. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location where the virtual machine will live. - * - * @param location the location value to set. - * @return the ResourceSettingCreationParameters object itself. - */ - public ResourceSettingCreationParameters withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the name property: The name of the resource setting. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the resource setting. - * - * @param name the name value to set. - * @return the ResourceSettingCreationParameters object itself. - */ - public ResourceSettingCreationParameters withName(String name) { - this.name = name; - return this; - } - - /** - * Get the galleryImageResourceId property: The resource id of the gallery image used for creating the virtual - * machine. - * - * @return the galleryImageResourceId value. - */ - public String galleryImageResourceId() { - return this.galleryImageResourceId; - } - - /** - * Set the galleryImageResourceId property: The resource id of the gallery image used for creating the virtual - * machine. - * - * @param galleryImageResourceId the galleryImageResourceId value to set. - * @return the ResourceSettingCreationParameters object itself. - */ - public ResourceSettingCreationParameters withGalleryImageResourceId(String galleryImageResourceId) { - this.galleryImageResourceId = galleryImageResourceId; - return this; - } - - /** - * Get the size property: The size of the virtual machine. - * - * @return the size value. - */ - public ManagedLabVmSize size() { - return this.size; - } - - /** - * Set the size property: The size of the virtual machine. - * - * @param size the size value to set. - * @return the ResourceSettingCreationParameters object itself. - */ - public ResourceSettingCreationParameters withSize(ManagedLabVmSize size) { - this.size = size; - return this; - } - - /** - * Get the referenceVmCreationParameters property: Creation parameters for Reference Vm. - * - * @return the referenceVmCreationParameters value. - */ - public ReferenceVmCreationParameters referenceVmCreationParameters() { - return this.referenceVmCreationParameters; - } - - /** - * Set the referenceVmCreationParameters property: Creation parameters for Reference Vm. - * - * @param referenceVmCreationParameters the referenceVmCreationParameters value to set. - * @return the ResourceSettingCreationParameters object itself. - */ - public ResourceSettingCreationParameters withReferenceVmCreationParameters( - ReferenceVmCreationParameters referenceVmCreationParameters) { - this.referenceVmCreationParameters = referenceVmCreationParameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (galleryImageResourceId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property galleryImageResourceId in model ResourceSettingCreationParameters")); - } - if (referenceVmCreationParameters() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property referenceVmCreationParameters in model" - + " ResourceSettingCreationParameters")); - } else { - referenceVmCreationParameters().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettings.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettings.java deleted file mode 100644 index 90870c8cf2200..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettings.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Represents resource specific settings. */ -@Fluent -public final class ResourceSettings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSettings.class); - - /* - * The unique id of the resource setting - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The resource id of the gallery image used for creating the virtual - * machine - */ - @JsonProperty(value = "galleryImageResourceId") - private String galleryImageResourceId; - - /* - * The name of the image used to created the environment setting - */ - @JsonProperty(value = "imageName", access = JsonProperty.Access.WRITE_ONLY) - private String imageName; - - /* - * The size of the virtual machine - */ - @JsonProperty(value = "size") - private ManagedLabVmSize size; - - /* - * The translated compute cores of the virtual machine - */ - @JsonProperty(value = "cores", access = JsonProperty.Access.WRITE_ONLY) - private Integer cores; - - /* - * Details specific to Reference Vm - */ - @JsonProperty(value = "referenceVm", required = true) - private ReferenceVm referenceVm; - - /** - * Get the id property: The unique id of the resource setting. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the galleryImageResourceId property: The resource id of the gallery image used for creating the virtual - * machine. - * - * @return the galleryImageResourceId value. - */ - public String galleryImageResourceId() { - return this.galleryImageResourceId; - } - - /** - * Set the galleryImageResourceId property: The resource id of the gallery image used for creating the virtual - * machine. - * - * @param galleryImageResourceId the galleryImageResourceId value to set. - * @return the ResourceSettings object itself. - */ - public ResourceSettings withGalleryImageResourceId(String galleryImageResourceId) { - this.galleryImageResourceId = galleryImageResourceId; - return this; - } - - /** - * Get the imageName property: The name of the image used to created the environment setting. - * - * @return the imageName value. - */ - public String imageName() { - return this.imageName; - } - - /** - * Get the size property: The size of the virtual machine. - * - * @return the size value. - */ - public ManagedLabVmSize size() { - return this.size; - } - - /** - * Set the size property: The size of the virtual machine. - * - * @param size the size value to set. - * @return the ResourceSettings object itself. - */ - public ResourceSettings withSize(ManagedLabVmSize size) { - this.size = size; - return this; - } - - /** - * Get the cores property: The translated compute cores of the virtual machine. - * - * @return the cores value. - */ - public Integer cores() { - return this.cores; - } - - /** - * Get the referenceVm property: Details specific to Reference Vm. - * - * @return the referenceVm value. - */ - public ReferenceVm referenceVm() { - return this.referenceVm; - } - - /** - * Set the referenceVm property: Details specific to Reference Vm. - * - * @param referenceVm the referenceVm value to set. - * @return the ResourceSettings object itself. - */ - public ResourceSettings withReferenceVm(ReferenceVm referenceVm) { - this.referenceVm = referenceVm; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (referenceVm() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property referenceVm in model ResourceSettings")); - } else { - referenceVm().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingsFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingsFragment.java deleted file mode 100644 index c93c4b8ea963b..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResourceSettingsFragment.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.labservices.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; - -/** Represents resource specific settings. */ -@Fluent -public final class ResourceSettingsFragment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSettingsFragment.class); - - /* - * The resource id of the gallery image used for creating the virtual - * machine - */ - @JsonProperty(value = "galleryImageResourceId") - private String galleryImageResourceId; - - /* - * The size of the virtual machine - */ - @JsonProperty(value = "size") - private ManagedLabVmSize size; - - /* - * Details specific to Reference Vm - */ - @JsonProperty(value = "referenceVm") - private ReferenceVmFragment referenceVm; - - /** - * Get the galleryImageResourceId property: The resource id of the gallery image used for creating the virtual - * machine. - * - * @return the galleryImageResourceId value. - */ - public String galleryImageResourceId() { - return this.galleryImageResourceId; - } - - /** - * Set the galleryImageResourceId property: The resource id of the gallery image used for creating the virtual - * machine. - * - * @param galleryImageResourceId the galleryImageResourceId value to set. - * @return the ResourceSettingsFragment object itself. - */ - public ResourceSettingsFragment withGalleryImageResourceId(String galleryImageResourceId) { - this.galleryImageResourceId = galleryImageResourceId; - return this; - } - - /** - * Get the size property: The size of the virtual machine. - * - * @return the size value. - */ - public ManagedLabVmSize size() { - return this.size; - } - - /** - * Set the size property: The size of the virtual machine. - * - * @param size the size value to set. - * @return the ResourceSettingsFragment object itself. - */ - public ResourceSettingsFragment withSize(ManagedLabVmSize size) { - this.size = size; - return this; - } - - /** - * Get the referenceVm property: Details specific to Reference Vm. - * - * @return the referenceVm value. - */ - public ReferenceVmFragment referenceVm() { - return this.referenceVm; - } - - /** - * Set the referenceVm property: Details specific to Reference Vm. - * - * @param referenceVm the referenceVm value to set. - * @return the ResourceSettingsFragment object itself. - */ - public ResourceSettingsFragment withReferenceVm(ReferenceVmFragment referenceVm) { - this.referenceVm = referenceVm; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (referenceVm() != null) { - referenceVm().validate(); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironment.java deleted file mode 100644 index ac5c74fed4380..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironment.java +++ /dev/null @@ -1,81 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of a list operation. */ -@Fluent -public final class ResponseWithContinuationEnvironment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseWithContinuationEnvironment.class); - - /* - * Results of the list operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link for next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Results of the list operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ResponseWithContinuationEnvironment object itself. - */ - public ResponseWithContinuationEnvironment withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ResponseWithContinuationEnvironment object itself. - */ - public ResponseWithContinuationEnvironment 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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironmentSetting.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironmentSetting.java deleted file mode 100644 index fb2d00fb6b5fc..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationEnvironmentSetting.java +++ /dev/null @@ -1,81 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.EnvironmentSettingInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of a list operation. */ -@Fluent -public final class ResponseWithContinuationEnvironmentSetting { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseWithContinuationEnvironmentSetting.class); - - /* - * Results of the list operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link for next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Results of the list operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ResponseWithContinuationEnvironmentSetting object itself. - */ - public ResponseWithContinuationEnvironmentSetting withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ResponseWithContinuationEnvironmentSetting object itself. - */ - public ResponseWithContinuationEnvironmentSetting 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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationGalleryImage.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationGalleryImage.java deleted file mode 100644 index 2337c4d1ffe7e..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationGalleryImage.java +++ /dev/null @@ -1,81 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.GalleryImageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of a list operation. */ -@Fluent -public final class ResponseWithContinuationGalleryImage { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseWithContinuationGalleryImage.class); - - /* - * Results of the list operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link for next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Results of the list operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ResponseWithContinuationGalleryImage object itself. - */ - public ResponseWithContinuationGalleryImage withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ResponseWithContinuationGalleryImage object itself. - */ - public ResponseWithContinuationGalleryImage 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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationLabAccount.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationLabAccount.java deleted file mode 100644 index 902e55d78fcae..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ResponseWithContinuationLabAccount.java +++ /dev/null @@ -1,81 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.labservices.fluent.models.LabAccountInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The response of a list operation. */ -@Fluent -public final class ResponseWithContinuationLabAccount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseWithContinuationLabAccount.class); - - /* - * Results of the list operation. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Link for next set of results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: Results of the list operation. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Results of the list operation. - * - * @param value the value value to set. - * @return the ResponseWithContinuationLabAccount object itself. - */ - public ResponseWithContinuationLabAccount withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Link for next set of results. - * - * @param nextLink the nextLink value to set. - * @return the ResponseWithContinuationLabAccount object itself. - */ - public ResponseWithContinuationLabAccount 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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionReasonCode.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionReasonCode.java new file mode 100644 index 0000000000000..6a170889a8620 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionReasonCode.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.labservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestrictionReasonCode. */ +public final class RestrictionReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for RestrictionReasonCode. */ + public static final RestrictionReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for RestrictionReasonCode. */ + public static final RestrictionReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = + fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a RestrictionReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestrictionReasonCode. + */ + @JsonCreator + public static RestrictionReasonCode fromString(String name) { + return fromString(name, RestrictionReasonCode.class); + } + + /** @return known RestrictionReasonCode values. */ + public static Collection values() { + return values(RestrictionReasonCode.class); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionType.java new file mode 100644 index 0000000000000..e3a864be3a6e2 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RestrictionType.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.labservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RestrictionType. */ +public final class RestrictionType extends ExpandableStringEnum { + /** Static value Location for RestrictionType. */ + public static final RestrictionType LOCATION = fromString("Location"); + + /** + * Creates or finds a RestrictionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestrictionType. + */ + @JsonCreator + public static RestrictionType fromString(String name) { + return fromString(name, RestrictionType.class); + } + + /** @return known RestrictionType values. */ + public static Collection values() { + return values(RestrictionType.class); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RosterProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RosterProfile.java new file mode 100644 index 0000000000000..df5ea07c05d57 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RosterProfile.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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 lab user list management profile. */ +@Fluent +public final class RosterProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RosterProfile.class); + + /* + * The AAD group ID which this lab roster is populated from. Having this + * set enables AAD sync mode. + */ + @JsonProperty(value = "activeDirectoryGroupId") + private String activeDirectoryGroupId; + + /* + * The unique context identifier for the lab in the lms. + */ + @JsonProperty(value = "ltiContextId") + private String ltiContextId; + + /* + * The base URI identifying the lms instance. + */ + @JsonProperty(value = "lmsInstance") + private String lmsInstance; + + /* + * The unique id of the azure lab services tool in the lms. + */ + @JsonProperty(value = "ltiClientId") + private String ltiClientId; + + /* + * The uri of the names and roles service endpoint on the lms for the class + * attached to this lab. + */ + @JsonProperty(value = "ltiRosterEndpoint") + private String ltiRosterEndpoint; + + /** + * Get the activeDirectoryGroupId property: The AAD group ID which this lab roster is populated from. Having this + * set enables AAD sync mode. + * + * @return the activeDirectoryGroupId value. + */ + public String activeDirectoryGroupId() { + return this.activeDirectoryGroupId; + } + + /** + * Set the activeDirectoryGroupId property: The AAD group ID which this lab roster is populated from. Having this + * set enables AAD sync mode. + * + * @param activeDirectoryGroupId the activeDirectoryGroupId value to set. + * @return the RosterProfile object itself. + */ + public RosterProfile withActiveDirectoryGroupId(String activeDirectoryGroupId) { + this.activeDirectoryGroupId = activeDirectoryGroupId; + return this; + } + + /** + * Get the ltiContextId property: The unique context identifier for the lab in the lms. + * + * @return the ltiContextId value. + */ + public String ltiContextId() { + return this.ltiContextId; + } + + /** + * Set the ltiContextId property: The unique context identifier for the lab in the lms. + * + * @param ltiContextId the ltiContextId value to set. + * @return the RosterProfile object itself. + */ + public RosterProfile withLtiContextId(String ltiContextId) { + this.ltiContextId = ltiContextId; + return this; + } + + /** + * Get the lmsInstance property: The base URI identifying the lms instance. + * + * @return the lmsInstance value. + */ + public String lmsInstance() { + return this.lmsInstance; + } + + /** + * Set the lmsInstance property: The base URI identifying the lms instance. + * + * @param lmsInstance the lmsInstance value to set. + * @return the RosterProfile object itself. + */ + public RosterProfile withLmsInstance(String lmsInstance) { + this.lmsInstance = lmsInstance; + return this; + } + + /** + * Get the ltiClientId property: The unique id of the azure lab services tool in the lms. + * + * @return the ltiClientId value. + */ + public String ltiClientId() { + return this.ltiClientId; + } + + /** + * Set the ltiClientId property: The unique id of the azure lab services tool in the lms. + * + * @param ltiClientId the ltiClientId value to set. + * @return the RosterProfile object itself. + */ + public RosterProfile withLtiClientId(String ltiClientId) { + this.ltiClientId = ltiClientId; + return this; + } + + /** + * Get the ltiRosterEndpoint property: The uri of the names and roles service endpoint on the lms for the class + * attached to this lab. + * + * @return the ltiRosterEndpoint value. + */ + public String ltiRosterEndpoint() { + return this.ltiRosterEndpoint; + } + + /** + * Set the ltiRosterEndpoint property: The uri of the names and roles service endpoint on the lms for the class + * attached to this lab. + * + * @param ltiRosterEndpoint the ltiRosterEndpoint value to set. + * @return the RosterProfile object itself. + */ + public RosterProfile withLtiRosterEndpoint(String ltiRosterEndpoint) { + this.ltiRosterEndpoint = ltiRosterEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SaveImageBody.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SaveImageBody.java new file mode 100644 index 0000000000000..9899a62a729ca --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SaveImageBody.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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; + +/** Body for the save image POST. */ +@Fluent +public final class SaveImageBody { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SaveImageBody.class); + + /* + * The name for the image we create. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the lab virtual machine you want to save an image from. + */ + @JsonProperty(value = "labVirtualMachineId") + private String labVirtualMachineId; + + /** + * Get the name property: The name for the image we create. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name for the image we create. + * + * @param name the name value to set. + * @return the SaveImageBody object itself. + */ + public SaveImageBody withName(String name) { + this.name = name; + return this; + } + + /** + * Get the labVirtualMachineId property: The ID of the lab virtual machine you want to save an image from. + * + * @return the labVirtualMachineId value. + */ + public String labVirtualMachineId() { + return this.labVirtualMachineId; + } + + /** + * Set the labVirtualMachineId property: The ID of the lab virtual machine you want to save an image from. + * + * @param labVirtualMachineId the labVirtualMachineId value to set. + * @return the SaveImageBody object itself. + */ + public SaveImageBody withLabVirtualMachineId(String labVirtualMachineId) { + this.labVirtualMachineId = labVirtualMachineId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScaleType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScaleType.java new file mode 100644 index 0000000000000..36ae545e6eb31 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScaleType.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.labservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScaleType. */ +public final class ScaleType extends ExpandableStringEnum { + /** Static value None for ScaleType. */ + public static final ScaleType NONE = fromString("None"); + + /** Static value Manual for ScaleType. */ + public static final ScaleType MANUAL = fromString("Manual"); + + /** Static value Automatic for ScaleType. */ + public static final ScaleType AUTOMATIC = fromString("Automatic"); + + /** + * Creates or finds a ScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleType. + */ + @JsonCreator + public static ScaleType fromString(String name) { + return fromString(name, ScaleType.class); + } + + /** @return known ScaleType values. */ + public static Collection values() { + return values(ScaleType.class); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedule.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedule.java new file mode 100644 index 0000000000000..bf580cfa5b96e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedule.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.fluent.models.ScheduleInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Schedule. */ +public interface Schedule { + /** + * 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: Metadata pertaining to creation and last modification of the schedule. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Current provisioning state of the schedule. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the startAt value. + */ + OffsetDateTime startAt(); + + /** + * Gets the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the stopAt value. + */ + OffsetDateTime stopAt(); + + /** + * Gets the recurrencePattern property: The recurrence pattern of the scheduled actions. + * + * @return the recurrencePattern value. + */ + RecurrencePattern recurrencePattern(); + + /** + * Gets the timeZoneId property: The IANA timezone id for the schedule. + * + * @return the timeZoneId value. + */ + String timeZoneId(); + + /** + * Gets the notes property: Notes for this schedule. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the inner com.azure.resourcemanager.labservices.fluent.models.ScheduleInner object. + * + * @return the inner object. + */ + ScheduleInner innerModel(); + + /** The entirety of the Schedule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Schedule definition stages. */ + interface DefinitionStages { + /** The first stage of the Schedule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Schedule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, labName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in + * resource URIs. + * @return the next definition stage. + */ + WithCreate withExistingLab(String resourceGroupName, String labName); + } + /** + * The stage of the Schedule 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.WithStartAt, + DefinitionStages.WithStopAt, + DefinitionStages.WithRecurrencePattern, + DefinitionStages.WithTimeZoneId, + DefinitionStages.WithNotes { + /** + * Executes the create request. + * + * @return the created resource. + */ + Schedule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Schedule create(Context context); + } + /** The stage of the Schedule definition allowing to specify startAt. */ + interface WithStartAt { + /** + * Specifies the startAt property: When lab user virtual machines will be started. Timestamp offsets will be + * ignored and timeZoneId is used instead.. + * + * @param startAt When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * @return the next definition stage. + */ + WithCreate withStartAt(OffsetDateTime startAt); + } + /** The stage of the Schedule definition allowing to specify stopAt. */ + interface WithStopAt { + /** + * Specifies the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be + * ignored and timeZoneId is used instead.. + * + * @param stopAt When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * @return the next definition stage. + */ + WithCreate withStopAt(OffsetDateTime stopAt); + } + /** The stage of the Schedule definition allowing to specify recurrencePattern. */ + interface WithRecurrencePattern { + /** + * Specifies the recurrencePattern property: The recurrence pattern of the scheduled actions.. + * + * @param recurrencePattern The recurrence pattern of the scheduled actions. + * @return the next definition stage. + */ + WithCreate withRecurrencePattern(RecurrencePattern recurrencePattern); + } + /** The stage of the Schedule definition allowing to specify timeZoneId. */ + interface WithTimeZoneId { + /** + * Specifies the timeZoneId property: The IANA timezone id for the schedule.. + * + * @param timeZoneId The IANA timezone id for the schedule. + * @return the next definition stage. + */ + WithCreate withTimeZoneId(String timeZoneId); + } + /** The stage of the Schedule definition allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: Notes for this schedule.. + * + * @param notes Notes for this schedule. + * @return the next definition stage. + */ + WithCreate withNotes(String notes); + } + } + /** + * Begins update for the Schedule resource. + * + * @return the stage of resource update. + */ + Schedule.Update update(); + + /** The template for Schedule update. */ + interface Update + extends UpdateStages.WithStartAt, + UpdateStages.WithStopAt, + UpdateStages.WithRecurrencePattern, + UpdateStages.WithTimeZoneId, + UpdateStages.WithNotes { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Schedule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Schedule apply(Context context); + } + /** The Schedule update stages. */ + interface UpdateStages { + /** The stage of the Schedule update allowing to specify startAt. */ + interface WithStartAt { + /** + * Specifies the startAt property: When lab user virtual machines will be started. Timestamp offsets will be + * ignored and timeZoneId is used instead.. + * + * @param startAt When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * @return the next definition stage. + */ + Update withStartAt(OffsetDateTime startAt); + } + /** The stage of the Schedule update allowing to specify stopAt. */ + interface WithStopAt { + /** + * Specifies the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be + * ignored and timeZoneId is used instead.. + * + * @param stopAt When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * @return the next definition stage. + */ + Update withStopAt(OffsetDateTime stopAt); + } + /** The stage of the Schedule update allowing to specify recurrencePattern. */ + interface WithRecurrencePattern { + /** + * Specifies the recurrencePattern property: The recurrence pattern of the scheduled actions.. + * + * @param recurrencePattern The recurrence pattern of the scheduled actions. + * @return the next definition stage. + */ + Update withRecurrencePattern(RecurrencePattern recurrencePattern); + } + /** The stage of the Schedule update allowing to specify timeZoneId. */ + interface WithTimeZoneId { + /** + * Specifies the timeZoneId property: The IANA timezone id for the schedule.. + * + * @param timeZoneId The IANA timezone id for the schedule. + * @return the next definition stage. + */ + Update withTimeZoneId(String timeZoneId); + } + /** The stage of the Schedule update allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: Notes for this schedule.. + * + * @param notes Notes for this schedule. + * @return the next definition stage. + */ + Update withNotes(String notes); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Schedule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Schedule refresh(Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScheduleUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScheduleUpdate.java new file mode 100644 index 0000000000000..7398ea1c45c6e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ScheduleUpdate.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.ScheduleUpdateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Schedule for automatically turning virtual machines in a lab on and off at specified times. Used for updates. */ +@Fluent +public final class ScheduleUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScheduleUpdate.class); + + /* + * Schedule resource properties + */ + @JsonProperty(value = "properties") + private ScheduleUpdateProperties innerProperties; + + /** + * Get the innerProperties property: Schedule resource properties. + * + * @return the innerProperties value. + */ + private ScheduleUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the startAt value. + */ + public OffsetDateTime startAt() { + return this.innerProperties() == null ? null : this.innerProperties().startAt(); + } + + /** + * Set the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @param startAt the startAt value to set. + * @return the ScheduleUpdate object itself. + */ + public ScheduleUpdate withStartAt(OffsetDateTime startAt) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleUpdateProperties(); + } + this.innerProperties().withStartAt(startAt); + return this; + } + + /** + * Get the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @return the stopAt value. + */ + public OffsetDateTime stopAt() { + return this.innerProperties() == null ? null : this.innerProperties().stopAt(); + } + + /** + * Set the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and + * timeZoneId is used instead. + * + * @param stopAt the stopAt value to set. + * @return the ScheduleUpdate object itself. + */ + public ScheduleUpdate withStopAt(OffsetDateTime stopAt) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleUpdateProperties(); + } + this.innerProperties().withStopAt(stopAt); + return this; + } + + /** + * Get the recurrencePattern property: The recurrence pattern of the scheduled actions. + * + * @return the recurrencePattern value. + */ + public RecurrencePattern recurrencePattern() { + return this.innerProperties() == null ? null : this.innerProperties().recurrencePattern(); + } + + /** + * Set the recurrencePattern property: The recurrence pattern of the scheduled actions. + * + * @param recurrencePattern the recurrencePattern value to set. + * @return the ScheduleUpdate object itself. + */ + public ScheduleUpdate withRecurrencePattern(RecurrencePattern recurrencePattern) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleUpdateProperties(); + } + this.innerProperties().withRecurrencePattern(recurrencePattern); + return this; + } + + /** + * Get the timeZoneId property: The IANA timezone id for the schedule. + * + * @return the timeZoneId value. + */ + public String timeZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().timeZoneId(); + } + + /** + * Set the timeZoneId property: The IANA timezone id for the schedule. + * + * @param timeZoneId the timeZoneId value to set. + * @return the ScheduleUpdate object itself. + */ + public ScheduleUpdate withTimeZoneId(String timeZoneId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleUpdateProperties(); + } + this.innerProperties().withTimeZoneId(timeZoneId); + return this; + } + + /** + * Get the notes property: Notes for this schedule. + * + * @return the notes value. + */ + public String notes() { + return this.innerProperties() == null ? null : this.innerProperties().notes(); + } + + /** + * Set the notes property: Notes for this schedule. + * + * @param notes the notes value to set. + * @return the ScheduleUpdate object itself. + */ + public ScheduleUpdate withNotes(String notes) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduleUpdateProperties(); + } + this.innerProperties().withNotes(notes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImages.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedules.java similarity index 51% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImages.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedules.java index d0c5a51a689c6..07476f13dc43d 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/GalleryImages.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Schedules.java @@ -8,126 +8,124 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of GalleryImages. */ -public interface GalleryImages { +/** Resource collection API of Schedules. */ +public interface Schedules { /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules. */ - PagedIterable list(String resourceGroupName, String labAccountName); + PagedIterable listByLab(String resourceGroupName, String labName); /** - * List gallery images in a given lab account. + * Returns a list of all schedules for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of schedules. */ - PagedIterable list( - String resourceGroupName, - String labAccountName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); /** - * Get gallery image. + * Returns the properties of a lab Schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times. */ - GalleryImage get(String resourceGroupName, String labAccountName, String galleryImageName); + Schedule get(String resourceGroupName, String labName, String scheduleName); /** - * Get gallery image. + * Returns the properties of a lab Schedule. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String labAccountName, String galleryImageName, String expand, Context context); + Response getWithResponse(String resourceGroupName, String labName, String scheduleName, Context context); /** - * Delete gallery image. + * Operation to delete a schedule resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labAccountName, String galleryImageName); + void delete(String resourceGroupName, String labName, String scheduleName); /** - * Delete gallery image. + * Operation to delete a schedule resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param galleryImageName The name of the gallery Image. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param scheduleName The name of the schedule that uniquely identifies it within containing lab. Used in resource + * URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 labAccountName, String galleryImageName, Context context); + void delete(String resourceGroupName, String labName, String scheduleName, Context context); /** - * Get gallery image. + * Returns the properties of a lab Schedule. * * @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 gallery image. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. */ - GalleryImage getById(String id); + Schedule getById(String id); /** - * Get gallery image. + * Returns the properties of a lab Schedule. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=author)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return schedule for automatically turning virtual machines in a lab on and off at specified times along with + * {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Delete gallery image. + * Operation to delete a schedule resource. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,22 +135,21 @@ Response deleteWithResponse( void deleteById(String id); /** - * Delete gallery image. + * Operation to delete a schedule resource. * * @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 GalleryImage resource. + * Begins definition for a new Schedule resource. * * @param name resource name. - * @return the first stage of the new GalleryImage definition. + * @return the first stage of the new Schedule definition. */ - GalleryImage.DefinitionStages.Blank define(String name); + Schedule.DefinitionStages.Blank define(String name); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegisterPayload.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SecurityProfile.java similarity index 50% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegisterPayload.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SecurityProfile.java index 02791fff0b726..765a1b4a93475 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/RegisterPayload.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SecurityProfile.java @@ -9,19 +9,25 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents payload for Register action. */ +/** The lab security profile. */ @Fluent -public final class RegisterPayload { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisterPayload.class); +public final class SecurityProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityProfile.class); /* - * The registration code of the lab. + * The registration code for the lab. */ - @JsonProperty(value = "registrationCode") + @JsonProperty(value = "registrationCode", access = JsonProperty.Access.WRITE_ONLY) private String registrationCode; + /* + * Whether any user or only specified users can register to a lab. + */ + @JsonProperty(value = "openAccess") + private EnableState openAccess; + /** - * Get the registrationCode property: The registration code of the lab. + * Get the registrationCode property: The registration code for the lab. * * @return the registrationCode value. */ @@ -30,13 +36,22 @@ public String registrationCode() { } /** - * Set the registrationCode property: The registration code of the lab. + * Get the openAccess property: Whether any user or only specified users can register to a lab. + * + * @return the openAccess value. + */ + public EnableState openAccess() { + return this.openAccess; + } + + /** + * Set the openAccess property: Whether any user or only specified users can register to a lab. * - * @param registrationCode the registrationCode value to set. - * @return the RegisterPayload object itself. + * @param openAccess the openAccess value to set. + * @return the SecurityProfile object itself. */ - public RegisterPayload withRegistrationCode(String registrationCode) { - this.registrationCode = registrationCode; + public SecurityProfile withOpenAccess(EnableState openAccess) { + this.openAccess = openAccess; return this; } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ShutdownOnIdleMode.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ShutdownOnIdleMode.java new file mode 100644 index 0000000000000..68b9b08517e0e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ShutdownOnIdleMode.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ShutdownOnIdleMode. */ +public enum ShutdownOnIdleMode { + /** Enum value None. */ + NONE("None"), + + /** Enum value UserAbsence. */ + USER_ABSENCE("UserAbsence"), + + /** Enum value LowUsage. */ + LOW_USAGE("LowUsage"); + + /** The actual serialized value for a ShutdownOnIdleMode instance. */ + private final String value; + + ShutdownOnIdleMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ShutdownOnIdleMode instance. + * + * @param value the serialized value to parse. + * @return the parsed ShutdownOnIdleMode object, or null if unable to parse. + */ + @JsonCreator + public static ShutdownOnIdleMode fromString(String value) { + ShutdownOnIdleMode[] items = ShutdownOnIdleMode.values(); + for (ShutdownOnIdleMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeAvailability.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeAvailability.java deleted file mode 100644 index 685548e629e7e..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeAvailability.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.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; - -/** Represents the size information. */ -@Fluent -public final class SizeAvailability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SizeAvailability.class); - - /* - * The category of the size (Basic, Standard, Performance). - */ - @JsonProperty(value = "sizeCategory") - private ManagedLabVmSize sizeCategory; - - /* - * Whether or not this size category is available - */ - @JsonProperty(value = "isAvailable") - private Boolean isAvailable; - - /** - * Get the sizeCategory property: The category of the size (Basic, Standard, Performance). - * - * @return the sizeCategory value. - */ - public ManagedLabVmSize sizeCategory() { - return this.sizeCategory; - } - - /** - * Set the sizeCategory property: The category of the size (Basic, Standard, Performance). - * - * @param sizeCategory the sizeCategory value to set. - * @return the SizeAvailability object itself. - */ - public SizeAvailability withSizeCategory(ManagedLabVmSize sizeCategory) { - this.sizeCategory = sizeCategory; - return this; - } - - /** - * Get the isAvailable property: Whether or not this size category is available. - * - * @return the isAvailable value. - */ - public Boolean isAvailable() { - return this.isAvailable; - } - - /** - * Set the isAvailable property: Whether or not this size category is available. - * - * @param isAvailable the isAvailable value to set. - * @return the SizeAvailability object itself. - */ - public SizeAvailability withIsAvailable(Boolean isAvailable) { - this.isAvailable = isAvailable; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeConfigurationProperties.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeConfigurationProperties.java deleted file mode 100644 index 2e313ca51323c..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeConfigurationProperties.java +++ /dev/null @@ -1,57 +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.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents the size configuration under the lab account. */ -@Fluent -public final class SizeConfigurationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SizeConfigurationProperties.class); - - /* - * Represents a list of size categories supported by this Lab Account - * (Small, Medium, Large) - */ - @JsonProperty(value = "environmentSizes") - private List environmentSizes; - - /** - * Get the environmentSizes property: Represents a list of size categories supported by this Lab Account (Small, - * Medium, Large). - * - * @return the environmentSizes value. - */ - public List environmentSizes() { - return this.environmentSizes; - } - - /** - * Set the environmentSizes property: Represents a list of size categories supported by this Lab Account (Small, - * Medium, Large). - * - * @param environmentSizes the environmentSizes value to set. - * @return the SizeConfigurationProperties object itself. - */ - public SizeConfigurationProperties withEnvironmentSizes(List environmentSizes) { - this.environmentSizes = environmentSizes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (environmentSizes() != null) { - environmentSizes().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfo.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfo.java deleted file mode 100644 index 3fb8869334fbd..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfo.java +++ /dev/null @@ -1,133 +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.labservices.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.math.BigDecimal; - -/** Contains detailed information about a size. */ -@Fluent -public final class SizeInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SizeInfo.class); - - /* - * Represents the actual compute size, e.g. Standard_A2_v2. - */ - @JsonProperty(value = "computeSize") - private String computeSize; - - /* - * The pay-as-you-go price per hour this size will cost. It does not - * include discounts and may not reflect the actual price the size will - * cost. - */ - @JsonProperty(value = "price") - private BigDecimal price; - - /* - * The number of cores a VM of this size has. - */ - @JsonProperty(value = "numberOfCores") - private Integer numberOfCores; - - /* - * The amount of memory available (in GB). - */ - @JsonProperty(value = "memory") - private Double memory; - - /** - * Get the computeSize property: Represents the actual compute size, e.g. Standard_A2_v2. - * - * @return the computeSize value. - */ - public String computeSize() { - return this.computeSize; - } - - /** - * Set the computeSize property: Represents the actual compute size, e.g. Standard_A2_v2. - * - * @param computeSize the computeSize value to set. - * @return the SizeInfo object itself. - */ - public SizeInfo withComputeSize(String computeSize) { - this.computeSize = computeSize; - return this; - } - - /** - * Get the price property: The pay-as-you-go price per hour this size will cost. It does not include discounts and - * may not reflect the actual price the size will cost. - * - * @return the price value. - */ - public BigDecimal price() { - return this.price; - } - - /** - * Set the price property: The pay-as-you-go price per hour this size will cost. It does not include discounts and - * may not reflect the actual price the size will cost. - * - * @param price the price value to set. - * @return the SizeInfo object itself. - */ - public SizeInfo withPrice(BigDecimal price) { - this.price = price; - return this; - } - - /** - * Get the numberOfCores property: The number of cores a VM of this size has. - * - * @return the numberOfCores value. - */ - public Integer numberOfCores() { - return this.numberOfCores; - } - - /** - * Set the numberOfCores property: The number of cores a VM of this size has. - * - * @param numberOfCores the numberOfCores value to set. - * @return the SizeInfo object itself. - */ - public SizeInfo withNumberOfCores(Integer numberOfCores) { - this.numberOfCores = numberOfCores; - return this; - } - - /** - * Get the memory property: The amount of memory available (in GB). - * - * @return the memory value. - */ - public Double memory() { - return this.memory; - } - - /** - * Set the memory property: The amount of memory available (in GB). - * - * @param memory the memory value to set. - * @return the SizeInfo object itself. - */ - public SizeInfo withMemory(Double memory) { - this.memory = memory; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfoFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfoFragment.java deleted file mode 100644 index 8b2d0f2b4fa3f..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SizeInfoFragment.java +++ /dev/null @@ -1,133 +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.labservices.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.math.BigDecimal; - -/** Contains detailed information about a size. */ -@Fluent -public final class SizeInfoFragment { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SizeInfoFragment.class); - - /* - * Represents the actual compute size, e.g. Standard_A2_v2. - */ - @JsonProperty(value = "computeSize") - private String computeSize; - - /* - * The pay-as-you-go price per hour this size will cost. It does not - * include discounts and may not reflect the actual price the size will - * cost. - */ - @JsonProperty(value = "price") - private BigDecimal price; - - /* - * The number of cores a VM of this size has. - */ - @JsonProperty(value = "numberOfCores") - private Integer numberOfCores; - - /* - * The amount of memory available (in GB). - */ - @JsonProperty(value = "memory") - private Double memory; - - /** - * Get the computeSize property: Represents the actual compute size, e.g. Standard_A2_v2. - * - * @return the computeSize value. - */ - public String computeSize() { - return this.computeSize; - } - - /** - * Set the computeSize property: Represents the actual compute size, e.g. Standard_A2_v2. - * - * @param computeSize the computeSize value to set. - * @return the SizeInfoFragment object itself. - */ - public SizeInfoFragment withComputeSize(String computeSize) { - this.computeSize = computeSize; - return this; - } - - /** - * Get the price property: The pay-as-you-go price per hour this size will cost. It does not include discounts and - * may not reflect the actual price the size will cost. - * - * @return the price value. - */ - public BigDecimal price() { - return this.price; - } - - /** - * Set the price property: The pay-as-you-go price per hour this size will cost. It does not include discounts and - * may not reflect the actual price the size will cost. - * - * @param price the price value to set. - * @return the SizeInfoFragment object itself. - */ - public SizeInfoFragment withPrice(BigDecimal price) { - this.price = price; - return this; - } - - /** - * Get the numberOfCores property: The number of cores a VM of this size has. - * - * @return the numberOfCores value. - */ - public Integer numberOfCores() { - return this.numberOfCores; - } - - /** - * Set the numberOfCores property: The number of cores a VM of this size has. - * - * @param numberOfCores the numberOfCores value to set. - * @return the SizeInfoFragment object itself. - */ - public SizeInfoFragment withNumberOfCores(Integer numberOfCores) { - this.numberOfCores = numberOfCores; - return this; - } - - /** - * Get the memory property: The amount of memory available (in GB). - * - * @return the memory value. - */ - public Double memory() { - return this.memory; - } - - /** - * Set the memory property: The amount of memory available (in GB). - * - * @param memory the memory value to set. - * @return the SizeInfoFragment object itself. - */ - public SizeInfoFragment withMemory(Double memory) { - this.memory = memory; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Sku.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Sku.java new file mode 100644 index 0000000000000..1f57ad384b72d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/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.labservices.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 final 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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SkuTier.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SkuTier.java new file mode 100644 index 0000000000000..015660718870c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/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.labservices.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/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProviderOperations.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Skus.java similarity index 66% rename from sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProviderOperations.java rename to sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Skus.java index 79f8f6f262387..59fd1249ad238 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/ProviderOperations.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Skus.java @@ -7,25 +7,26 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of ProviderOperations. */ -public interface ProviderOperations { +/** Resource collection API of Skus. */ +public interface Skus { /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * * @throws com.azure.core.management.exception.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 paged list of lab services skus. */ - PagedIterable list(); + PagedIterable list(); /** - * Result of the request to list REST API operations. + * Returns a list of all the Azure Lab Services resource SKUs. * + * @param filter The filter to apply to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return paged list of lab services skus. */ - PagedIterable list(Context context); + PagedIterable list(String filter, Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SupportInfo.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SupportInfo.java new file mode 100644 index 0000000000000..29f6f0a4c0445 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/SupportInfo.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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; + +/** Support contact information and instructions. */ +@Fluent +public final class SupportInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportInfo.class); + + /* + * Support web address. + */ + @JsonProperty(value = "url") + private String url; + + /* + * Support contact email address. + */ + @JsonProperty(value = "email") + private String email; + + /* + * Support contact phone number. + */ + @JsonProperty(value = "phone") + private String phone; + + /* + * Support instructions. + */ + @JsonProperty(value = "instructions") + private String instructions; + + /** + * Get the url property: Support web address. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Support web address. + * + * @param url the url value to set. + * @return the SupportInfo object itself. + */ + public SupportInfo withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the email property: Support contact email address. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Support contact email address. + * + * @param email the email value to set. + * @return the SupportInfo object itself. + */ + public SupportInfo withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the phone property: Support contact phone number. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone property: Support contact phone number. + * + * @param phone the phone value to set. + * @return the SupportInfo object itself. + */ + public SupportInfo withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get the instructions property: Support instructions. + * + * @return the instructions value. + */ + public String instructions() { + return this.instructions; + } + + /** + * Set the instructions property: Support instructions. + * + * @param instructions the instructions value to set. + * @return the SupportInfo object itself. + */ + public SupportInfo withInstructions(String instructions) { + this.instructions = instructions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/TrackedResourceUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/TrackedResourceUpdate.java new file mode 100644 index 0000000000000..6349b73f01d61 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/TrackedResourceUpdate.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Base tracked resource type for all PATCH updates. */ +@Fluent +public class TrackedResourceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackedResourceUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private List tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TrackedResourceUpdate object itself. + */ + public TrackedResourceUpdate withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usage.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usage.java new file mode 100644 index 0000000000000..d629595d01aaf --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usage.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.labservices.models; + +import com.azure.resourcemanager.labservices.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the currentValue property: The current usage. + * + * @return the currentValue value. + */ + Long currentValue(); + + /** + * Gets the limit property: The limit integer. + * + * @return the limit value. + */ + Long limit(); + + /** + * Gets the unit property: The unit details. + * + * @return the unit value. + */ + UsageUnit unit(); + + /** + * Gets the name property: The name. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the id property: The fully qualified arm resource id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.labservices.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageName.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageName.java new file mode 100644 index 0000000000000..5c158a0651a19 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageName.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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 Usage Names. */ +@Fluent +public final class UsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); + + /* + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /* + * The name of the resource. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the localizedValue property: The localized name of the resource. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: The localized name of the resource. + * + * @param localizedValue the localizedValue value to set. + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Get the value property: The name of the resource. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The name of the resource. + * + * @param value the value value to set. + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageUnit.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageUnit.java new file mode 100644 index 0000000000000..7ad595b0d62f6 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UsageUnit.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.labservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UsageUnit. */ +public final class UsageUnit extends ExpandableStringEnum { + /** Static value Count for UsageUnit. */ + public static final UsageUnit COUNT = fromString("Count"); + + /** + * Creates or finds a UsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsageUnit. + */ + @JsonCreator + public static UsageUnit fromString(String name) { + return fromString(name, UsageUnit.class); + } + + /** @return known UsageUnit values. */ + public static Collection values() { + return values(UsageUnit.class); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usages.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usages.java new file mode 100644 index 0000000000000..35928cffc7c3e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Usages.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.labservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + PagedIterable listByLocation(String location); + + /** + * Returns list of usage per SKU family for the specified subscription in the specified region. + * + * @param location The location name. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Core Usages. + */ + PagedIterable listByLocation(String location, String filter, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/User.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/User.java index 613a383168629..e6c7246ea10bc 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/User.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/User.java @@ -4,11 +4,11 @@ package com.azure.resourcemanager.labservices.models; -import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.labservices.fluent.models.UserInner; import java.time.Duration; -import java.util.Map; +import java.time.OffsetDateTime; /** An immutable client-side representation of User. */ public interface User { @@ -34,88 +34,68 @@ public interface User { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the systemData property: Metadata pertaining to creation and last modification of the user resource. * - * @return the location value. + * @return the systemData value. */ - String location(); + SystemData systemData(); /** - * Gets the tags property: Resource tags. + * Gets the provisioningState property: Current provisioning state of the user resource. * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the email property: The user email address, as it was specified during registration. - * - * @return the email value. - */ - String email(); - - /** - * Gets the familyName property: The user family name, as it was specified during registration. - * - * @return the familyName value. - */ - String familyName(); - - /** - * Gets the givenName property: The user given name, as it was specified during registration. - * - * @return the givenName value. + * @return the provisioningState value. */ - String givenName(); + ProvisioningState provisioningState(); /** - * Gets the tenantId property: The user tenant ID, as it was specified during registration. + * Gets the displayName property: Display name of the user, for example user's full name. * - * @return the tenantId value. + * @return the displayName value. */ - String tenantId(); + String displayName(); /** - * Gets the totalUsage property: How long the user has used his VMs in this lab. + * Gets the email property: Email address of the user. * - * @return the totalUsage value. + * @return the email value. */ - Duration totalUsage(); + String email(); /** - * Gets the provisioningState property: The provisioning status of the resource. + * Gets the registrationState property: State of the user's registration within the lab. * - * @return the provisioningState value. + * @return the registrationState value. */ - String provisioningState(); + RegistrationState registrationState(); /** - * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). + * Gets the invitationState property: State of the invitation message for the user. * - * @return the uniqueIdentifier value. + * @return the invitationState value. */ - String uniqueIdentifier(); + InvitationState invitationState(); /** - * Gets the latestOperationResult property: The details of the latest operation. ex: status, error. + * Gets the invitationSent property: Date and time when the invitation message was sent to the user. * - * @return the latestOperationResult value. + * @return the invitationSent value. */ - LatestOperationResult latestOperationResult(); + OffsetDateTime invitationSent(); /** - * Gets the region of the resource. + * Gets the totalUsage property: How long the user has used their virtual machines in this lab. * - * @return the region of the resource. + * @return the totalUsage value. */ - Region region(); + Duration totalUsage(); /** - * Gets the name of the resource region. + * Gets the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage + * quota. * - * @return the name of the resource region. + * @return the additionalUsageQuota value. */ - String regionName(); + Duration additionalUsageQuota(); /** * Gets the inner com.azure.resourcemanager.labservices.fluent.models.UserInner object. @@ -127,53 +107,42 @@ public interface User { /** The entirety of the User definition. */ interface Definition extends DefinitionStages.Blank, - DefinitionStages.WithLocation, DefinitionStages.WithParentResource, + DefinitionStages.WithEmail, DefinitionStages.WithCreate { } /** The User definition stages. */ interface DefinitionStages { /** The first stage of the User definition. */ - interface Blank extends WithLocation { + interface Blank extends WithParentResource { } - /** The stage of the User 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); - + /** The stage of the User definition allowing to specify parent resource. */ + interface WithParentResource { /** - * Specifies the region for the resource. + * Specifies resourceGroupName, labName. * - * @param location The geo-location where the resource lives. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in + * resource URIs. * @return the next definition stage. */ - WithParentResource withRegion(String location); + WithEmail withExistingLab(String resourceGroupName, String labName); } - /** The stage of the User definition allowing to specify parent resource. */ - interface WithParentResource { + /** The stage of the User definition allowing to specify email. */ + interface WithEmail { /** - * Specifies resourceGroupName, labAccountName, labName. + * Specifies the email property: Email address of the user.. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param email Email address of the user. * @return the next definition stage. */ - WithCreate withExistingLab(String resourceGroupName, String labAccountName, String labName); + WithCreate withEmail(String email); } /** * The stage of the User 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.WithProvisioningState, - DefinitionStages.WithUniqueIdentifier { + interface WithCreate extends DefinitionStages.WithAdditionalUsageQuota { /** * Executes the create request. * @@ -189,35 +158,17 @@ interface WithCreate */ User create(Context context); } - /** The stage of the User 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 User definition allowing to specify provisioningState. */ - interface WithProvisioningState { + /** The stage of the User definition allowing to specify additionalUsageQuota. */ + interface WithAdditionalUsageQuota { /** - * Specifies the provisioningState property: The provisioning status of the resource.. + * Specifies the additionalUsageQuota property: The amount of usage quota time the user gets in addition to + * the lab usage quota.. * - * @param provisioningState The provisioning status of the resource. + * @param additionalUsageQuota The amount of usage quota time the user gets in addition to the lab usage + * quota. * @return the next definition stage. */ - WithCreate withProvisioningState(String provisioningState); - } - /** The stage of the User definition allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { - /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. - * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). - * @return the next definition stage. - */ - WithCreate withUniqueIdentifier(String uniqueIdentifier); + WithCreate withAdditionalUsageQuota(Duration additionalUsageQuota); } } /** @@ -228,8 +179,7 @@ interface WithUniqueIdentifier { User.Update update(); /** The template for User update. */ - interface Update - extends UpdateStages.WithTags, UpdateStages.WithProvisioningState, UpdateStages.WithUniqueIdentifier { + interface Update extends UpdateStages.WithAdditionalUsageQuota { /** * Executes the update request. * @@ -247,35 +197,17 @@ interface Update } /** The User update stages. */ interface UpdateStages { - /** The stage of the User 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 User update allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: The provisioning status of the resource.. - * - * @param provisioningState The provisioning status of the resource. - * @return the next definition stage. - */ - Update withProvisioningState(String provisioningState); - } - /** The stage of the User update allowing to specify uniqueIdentifier. */ - interface WithUniqueIdentifier { + /** The stage of the User update allowing to specify additionalUsageQuota. */ + interface WithAdditionalUsageQuota { /** - * Specifies the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).. + * Specifies the additionalUsageQuota property: The amount of usage quota time the user gets in addition to + * the lab usage quota.. * - * @param uniqueIdentifier The unique immutable identifier of a resource (Guid). + * @param additionalUsageQuota The amount of usage quota time the user gets in addition to the lab usage + * quota. * @return the next definition stage. */ - Update withUniqueIdentifier(String uniqueIdentifier); + Update withAdditionalUsageQuota(Duration additionalUsageQuota); } } /** @@ -292,4 +224,25 @@ interface WithUniqueIdentifier { * @return the refreshed resource. */ User refresh(Context context); + + /** + * Operation to invite a user to a lab. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 invite(InviteBody body); + + /** + * Operation to invite a user to a lab. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 invite(InviteBody body, Context context); } diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserFragment.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserFragment.java deleted file mode 100644 index c63efc0d585f1..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserFragment.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.labservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The User registered to a lab. */ -@JsonFlatten -@Fluent -public class UserFragment extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UserFragment.class); - - /* - * The provisioning status of the resource. - */ - @JsonProperty(value = "properties.provisioningState") - private String provisioningState; - - /* - * The unique immutable identifier of a resource (Guid). - */ - @JsonProperty(value = "properties.uniqueIdentifier") - private String uniqueIdentifier; - - /** - * Get the provisioningState property: The provisioning status of the resource. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning status of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the UserFragment object itself. - */ - public UserFragment withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @return the uniqueIdentifier value. - */ - public String uniqueIdentifier() { - return this.uniqueIdentifier; - } - - /** - * Set the uniqueIdentifier property: The unique immutable identifier of a resource (Guid). - * - * @param uniqueIdentifier the uniqueIdentifier value to set. - * @return the UserFragment object itself. - */ - public UserFragment withUniqueIdentifier(String uniqueIdentifier) { - this.uniqueIdentifier = uniqueIdentifier; - return this; - } - - /** {@inheritDoc} */ - @Override - public UserFragment withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public UserFragment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserUpdate.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserUpdate.java new file mode 100644 index 0000000000000..bf5aacfa61606 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/UserUpdate.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.labservices.fluent.models.UserUpdateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** User of a lab that can register for and use virtual machines within the lab. Used for updates. */ +@Fluent +public final class UserUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserUpdate.class); + + /* + * User resource properties + */ + @JsonProperty(value = "properties") + private UserUpdateProperties innerProperties; + + /** + * Get the innerProperties property: User resource properties. + * + * @return the innerProperties value. + */ + private UserUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage + * quota. + * + * @return the additionalUsageQuota value. + */ + public Duration additionalUsageQuota() { + return this.innerProperties() == null ? null : this.innerProperties().additionalUsageQuota(); + } + + /** + * Set the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage + * quota. + * + * @param additionalUsageQuota the additionalUsageQuota value to set. + * @return the UserUpdate object itself. + */ + public UserUpdate withAdditionalUsageQuota(Duration additionalUsageQuota) { + if (this.innerProperties() == null) { + this.innerProperties = new UserUpdateProperties(); + } + this.innerProperties().withAdditionalUsageQuota(additionalUsageQuota); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Users.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Users.java index d4f5a79a28273..a766aa8ad88c0 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Users.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/Users.java @@ -11,133 +11,143 @@ /** Resource collection API of Users. */ public interface Users { /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ - PagedIterable list(String resourceGroupName, String labAccountName, String labName); + PagedIterable listByLab(String resourceGroupName, String labName); /** - * List users in a given lab. + * Returns a list of all users for a lab. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. * @param filter The filter to apply to the operation. - * @param top The maximum number of resources to return from the operation. - * @param orderby The ordering expression for the results, using OData notation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a list operation. + * @return paged list of users. */ - PagedIterable list( - String resourceGroupName, - String labAccountName, - String labName, - String expand, - String filter, - Integer top, - String orderby, - Context context); + PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return user of a lab that can register for and use virtual machines within the lab. */ - User get(String resourceGroupName, String labAccountName, String labName, String username); + User get(String resourceGroupName, String labName, String username); /** - * Get user. + * Returns the properties of a lab user. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, - String labAccountName, - String labName, - String username, - String expand, - Context context); + Response getWithResponse(String resourceGroupName, String labName, String username, Context context); /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labAccountName, String labName, String username); + void delete(String resourceGroupName, String labName, String username); /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * - * @param resourceGroupName The name of the resource group. - * @param labAccountName The name of the lab Account. - * @param labName The name of the lab. - * @param username The name of the user. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 labAccountName, String labName, String username, Context context); + void delete(String resourceGroupName, String labName, String username, Context context); /** - * Get user. + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 invite(String resourceGroupName, String labName, String username, InviteBody body); + + /** + * Operation to invite a user to a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param username The name of the user that uniquely identifies it within containing lab. Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 invite(String resourceGroupName, String labName, String username, InviteBody body, Context context); + + /** + * Returns the properties of a lab user. * * @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 user. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. */ User getById(String id); /** - * Get user. + * Returns the properties of a lab user. * * @param id the resource ID. - * @param expand Specify the $expand query. Example: 'properties($select=email)'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return user of a lab that can register for and use virtual machines within the lab along with {@link Response}. */ - Response getByIdWithResponse(String id, String expand, Context context); + Response getByIdWithResponse(String id, Context context); /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -147,7 +157,7 @@ Response getWithResponse( void deleteById(String id); /** - * Delete user. This operation can take a while to complete. + * Operation to delete a user resource. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachine.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachine.java new file mode 100644 index 0000000000000..4ae3003e3ac33 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachine.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.labservices.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner; + +/** An immutable client-side representation of VirtualMachine. */ +public interface VirtualMachine { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: System data of the Lab virtual machine. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Current provisioning state of the virtual machine. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the state property: The current state of the virtual machine. + * + * @return the state value. + */ + VirtualMachineState state(); + + /** + * Gets the connectionProfile property: Profile for information about connecting to the virtual machine. + * + * @return the connectionProfile value. + */ + VirtualMachineConnectionProfile connectionProfile(); + + /** + * Gets the claimedByUserId property: The lab user ID (not the PUID!) of who claimed the virtual machine. + * + * @return the claimedByUserId value. + */ + String claimedByUserId(); + + /** + * Gets the vmType property: The type of this VM resource. + * + * @return the vmType value. + */ + VirtualMachineType vmType(); + + /** + * Gets the inner com.azure.resourcemanager.labservices.fluent.models.VirtualMachineInner object. + * + * @return the inner object. + */ + VirtualMachineInner innerModel(); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineAdditionalCapabilities.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineAdditionalCapabilities.java new file mode 100644 index 0000000000000..60440ad49e536 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineAdditionalCapabilities.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.labservices.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 additional capabilities for a lab VM. */ +@Fluent +public final class VirtualMachineAdditionalCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineAdditionalCapabilities.class); + + /* + * Flag to pre-install dedicated GPU drivers. + */ + @JsonProperty(value = "installGpuDrivers") + private EnableState installGpuDrivers; + + /** + * Get the installGpuDrivers property: Flag to pre-install dedicated GPU drivers. + * + * @return the installGpuDrivers value. + */ + public EnableState installGpuDrivers() { + return this.installGpuDrivers; + } + + /** + * Set the installGpuDrivers property: Flag to pre-install dedicated GPU drivers. + * + * @param installGpuDrivers the installGpuDrivers value to set. + * @return the VirtualMachineAdditionalCapabilities object itself. + */ + public VirtualMachineAdditionalCapabilities withInstallGpuDrivers(EnableState installGpuDrivers) { + this.installGpuDrivers = installGpuDrivers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineConnectionProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineConnectionProfile.java new file mode 100644 index 0000000000000..01e1d968a5bb8 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineConnectionProfile.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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 connection information for the virtual machine. */ +@Immutable +public final class VirtualMachineConnectionProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineConnectionProfile.class); + + /* + * The private IP address of the virtual machine. + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * Port and host name separated by semicolon for connecting via SSH + * protocol to the virtual machine. + */ + @JsonProperty(value = "sshAuthority", access = JsonProperty.Access.WRITE_ONLY) + private String sshAuthority; + + /* + * URL for connecting via SSH protocol to the virtual machine in browser. + */ + @JsonProperty(value = "sshInBrowserUrl", access = JsonProperty.Access.WRITE_ONLY) + private String sshInBrowserUrl; + + /* + * Port and host name separated by semicolon for connecting via RDP + * protocol to the virtual machine. + */ + @JsonProperty(value = "rdpAuthority", access = JsonProperty.Access.WRITE_ONLY) + private String rdpAuthority; + + /* + * URL for connecting via RDP protocol to the virtual machine in browser. + */ + @JsonProperty(value = "rdpInBrowserUrl", access = JsonProperty.Access.WRITE_ONLY) + private String rdpInBrowserUrl; + + /* + * The username used to log on to the virtual machine as admin. + */ + @JsonProperty(value = "adminUsername", access = JsonProperty.Access.WRITE_ONLY) + private String adminUsername; + + /* + * The username used to log on to the virtual machine as non-admin, if one + * exists. + */ + @JsonProperty(value = "nonAdminUsername", access = JsonProperty.Access.WRITE_ONLY) + private String nonAdminUsername; + + /** + * Get the privateIpAddress property: The private IP address of the virtual machine. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get the sshAuthority property: Port and host name separated by semicolon for connecting via SSH protocol to the + * virtual machine. + * + * @return the sshAuthority value. + */ + public String sshAuthority() { + return this.sshAuthority; + } + + /** + * Get the sshInBrowserUrl property: URL for connecting via SSH protocol to the virtual machine in browser. + * + * @return the sshInBrowserUrl value. + */ + public String sshInBrowserUrl() { + return this.sshInBrowserUrl; + } + + /** + * Get the rdpAuthority property: Port and host name separated by semicolon for connecting via RDP protocol to the + * virtual machine. + * + * @return the rdpAuthority value. + */ + public String rdpAuthority() { + return this.rdpAuthority; + } + + /** + * Get the rdpInBrowserUrl property: URL for connecting via RDP protocol to the virtual machine in browser. + * + * @return the rdpInBrowserUrl value. + */ + public String rdpInBrowserUrl() { + return this.rdpInBrowserUrl; + } + + /** + * Get the adminUsername property: The username used to log on to the virtual machine as admin. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Get the nonAdminUsername property: The username used to log on to the virtual machine as non-admin, if one + * exists. + * + * @return the nonAdminUsername value. + */ + public String nonAdminUsername() { + return this.nonAdminUsername; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineDetails.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineDetails.java deleted file mode 100644 index 9b6d6915d10ba..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineDetails.java +++ /dev/null @@ -1,114 +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.labservices.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; - -/** Details of the backing virtual machine. */ -@Immutable -public final class VirtualMachineDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineDetails.class); - - /* - * Provisioning state of the Dtl VM - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /* - * Connection information for Windows - */ - @JsonProperty(value = "rdpAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String rdpAuthority; - - /* - * Connection information for Linux - */ - @JsonProperty(value = "sshAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String sshAuthority; - - /* - * PrivateIp address of the compute VM - */ - @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) - private String privateIpAddress; - - /* - * Compute VM login user name - */ - @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) - private String username; - - /* - * Last known compute power state captured in DTL - */ - @JsonProperty(value = "lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) - private String lastKnownPowerState; - - /** - * Get the provisioningState property: Provisioning state of the Dtl VM. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the rdpAuthority property: Connection information for Windows. - * - * @return the rdpAuthority value. - */ - public String rdpAuthority() { - return this.rdpAuthority; - } - - /** - * Get the sshAuthority property: Connection information for Linux. - * - * @return the sshAuthority value. - */ - public String sshAuthority() { - return this.sshAuthority; - } - - /** - * Get the privateIpAddress property: PrivateIp address of the compute VM. - * - * @return the privateIpAddress value. - */ - public String privateIpAddress() { - return this.privateIpAddress; - } - - /** - * Get the username property: Compute VM login user name. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Get the lastKnownPowerState property: Last known compute power state captured in DTL. - * - * @return the lastKnownPowerState value. - */ - public String lastKnownPowerState() { - return this.lastKnownPowerState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineProfile.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineProfile.java new file mode 100644 index 0000000000000..14a10442eca01 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineProfile.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.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.Duration; + +/** The base virtual machine configuration for a lab. */ +@Fluent +public final class VirtualMachineProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineProfile.class); + + /* + * Indicates what lab virtual machines are created from. + */ + @JsonProperty(value = "createOption", required = true) + private CreateOption createOption; + + /* + * The image configuration for lab virtual machines. + */ + @JsonProperty(value = "imageReference", required = true) + private ImageReference imageReference; + + /* + * The OS type of the image + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private OsType osType; + + /* + * The SKU for the lab. Defines the type of virtual machines used in the + * lab. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Additional VM capabilities. + */ + @JsonProperty(value = "additionalCapabilities") + private VirtualMachineAdditionalCapabilities additionalCapabilities; + + /* + * The initial quota alloted to each lab user. Must be a time span between + * 0 and 9999 hours. + */ + @JsonProperty(value = "usageQuota", required = true) + private Duration usageQuota; + + /* + * Enabling this option will use the same password for all user VMs. + */ + @JsonProperty(value = "useSharedPassword") + private EnableState useSharedPassword; + + /* + * Credentials for the admin user on the VM. + */ + @JsonProperty(value = "adminUser", required = true) + private Credentials adminUser; + + /* + * Credentials for the non-admin user on the VM, if one exists. + */ + @JsonProperty(value = "nonAdminUser") + private Credentials nonAdminUser; + + /** + * Get the createOption property: Indicates what lab virtual machines are created from. + * + * @return the createOption value. + */ + public CreateOption createOption() { + return this.createOption; + } + + /** + * Set the createOption property: Indicates what lab virtual machines are created from. + * + * @param createOption the createOption value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withCreateOption(CreateOption createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the imageReference property: The image configuration for lab virtual machines. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: The image configuration for lab virtual machines. + * + * @param imageReference the imageReference value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osType property: The OS type of the image. + * + * @return the osType value. + */ + public OsType osType() { + return this.osType; + } + + /** + * Get the sku property: The SKU for the lab. Defines the type of virtual machines used in the lab. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU for the lab. Defines the type of virtual machines used in the lab. + * + * @param sku the sku value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the additionalCapabilities property: Additional VM capabilities. + * + * @return the additionalCapabilities value. + */ + public VirtualMachineAdditionalCapabilities additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: Additional VM capabilities. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withAdditionalCapabilities( + VirtualMachineAdditionalCapabilities additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the usageQuota property: The initial quota alloted to each lab user. Must be a time span between 0 and 9999 + * hours. + * + * @return the usageQuota value. + */ + public Duration usageQuota() { + return this.usageQuota; + } + + /** + * Set the usageQuota property: The initial quota alloted to each lab user. Must be a time span between 0 and 9999 + * hours. + * + * @param usageQuota the usageQuota value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withUsageQuota(Duration usageQuota) { + this.usageQuota = usageQuota; + return this; + } + + /** + * Get the useSharedPassword property: Enabling this option will use the same password for all user VMs. + * + * @return the useSharedPassword value. + */ + public EnableState useSharedPassword() { + return this.useSharedPassword; + } + + /** + * Set the useSharedPassword property: Enabling this option will use the same password for all user VMs. + * + * @param useSharedPassword the useSharedPassword value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withUseSharedPassword(EnableState useSharedPassword) { + this.useSharedPassword = useSharedPassword; + return this; + } + + /** + * Get the adminUser property: Credentials for the admin user on the VM. + * + * @return the adminUser value. + */ + public Credentials adminUser() { + return this.adminUser; + } + + /** + * Set the adminUser property: Credentials for the admin user on the VM. + * + * @param adminUser the adminUser value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withAdminUser(Credentials adminUser) { + this.adminUser = adminUser; + return this; + } + + /** + * Get the nonAdminUser property: Credentials for the non-admin user on the VM, if one exists. + * + * @return the nonAdminUser value. + */ + public Credentials nonAdminUser() { + return this.nonAdminUser; + } + + /** + * Set the nonAdminUser property: Credentials for the non-admin user on the VM, if one exists. + * + * @param nonAdminUser the nonAdminUser value to set. + * @return the VirtualMachineProfile object itself. + */ + public VirtualMachineProfile withNonAdminUser(Credentials nonAdminUser) { + this.nonAdminUser = nonAdminUser; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createOption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property createOption in model VirtualMachineProfile")); + } + if (imageReference() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property imageReference in model VirtualMachineProfile")); + } else { + imageReference().validate(); + } + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model VirtualMachineProfile")); + } else { + sku().validate(); + } + if (additionalCapabilities() != null) { + additionalCapabilities().validate(); + } + if (usageQuota() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property usageQuota in model VirtualMachineProfile")); + } + if (adminUser() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property adminUser in model VirtualMachineProfile")); + } else { + adminUser().validate(); + } + if (nonAdminUser() != null) { + nonAdminUser().validate(); + } + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineState.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineState.java new file mode 100644 index 0000000000000..be9f29a1a5274 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineState.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for VirtualMachineState. */ +public enum VirtualMachineState { + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value ResettingPassword. */ + RESETTING_PASSWORD("ResettingPassword"), + + /** Enum value Reimaging. */ + REIMAGING("Reimaging"), + + /** Enum value Redeploying. */ + REDEPLOYING("Redeploying"); + + /** The actual serialized value for a VirtualMachineState instance. */ + private final String value; + + VirtualMachineState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VirtualMachineState instance. + * + * @param value the serialized value to parse. + * @return the parsed VirtualMachineState object, or null if unable to parse. + */ + @JsonCreator + public static VirtualMachineState fromString(String value) { + VirtualMachineState[] items = VirtualMachineState.values(); + for (VirtualMachineState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineType.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineType.java new file mode 100644 index 0000000000000..1229ba20ba6f3 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachineType.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for VirtualMachineType. */ +public enum VirtualMachineType { + /** Enum value User. */ + USER("User"), + + /** Enum value Template. */ + TEMPLATE("Template"); + + /** The actual serialized value for a VirtualMachineType instance. */ + private final String value; + + VirtualMachineType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VirtualMachineType instance. + * + * @param value the serialized value to parse. + * @return the parsed VirtualMachineType object, or null if unable to parse. + */ + @JsonCreator + public static VirtualMachineType fromString(String value) { + VirtualMachineType[] items = VirtualMachineType.values(); + for (VirtualMachineType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachines.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachines.java new file mode 100644 index 0000000000000..0a5e33a467261 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VirtualMachines.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualMachines. */ +public interface VirtualMachines { + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + PagedIterable listByLab(String resourceGroupName, String labName); + + /** + * Returns a list of all virtual machines for a lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param filter The filter to apply to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of lab services virtual machines. + */ + PagedIterable listByLab(String resourceGroupName, String labName, String filter, Context context); + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtual machine resource. + */ + VirtualMachine get(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Returns the properties for a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 virtual machine resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to start a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to stop a lab virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published + * snapshot of the reference environment of the lab. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reimage(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 redeploy(String resourceGroupName, String labName, String virtualMachineName); + + /** + * Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 redeploy(String resourceGroupName, String labName, String virtualMachineName, Context context); + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetPassword(String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body); + + /** + * Resets a lab virtual machine password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param labName The name of the lab that uniquely identifies it within containing lab account. Used in resource + * URIs. + * @param virtualMachineName The ID of the virtual machine that uniquely identifies it within the containing lab. + * Used in resource URIs. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resetPassword( + String resourceGroupName, String labName, String virtualMachineName, ResetPasswordBody body, Context context); +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VmStateDetails.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VmStateDetails.java deleted file mode 100644 index 773eea00410fc..0000000000000 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/VmStateDetails.java +++ /dev/null @@ -1,88 +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.labservices.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; - -/** Details about the state of the reference virtual machine. */ -@Immutable -public final class VmStateDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VmStateDetails.class); - - /* - * The RdpAuthority property is a server DNS host name or IP address - * followed by the service port number for RDP (Remote Desktop Protocol). - */ - @JsonProperty(value = "rdpAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String rdpAuthority; - - /* - * The SshAuthority property is a server DNS host name or IP address - * followed by the service port number for SSH. - */ - @JsonProperty(value = "sshAuthority", access = JsonProperty.Access.WRITE_ONLY) - private String sshAuthority; - - /* - * The power state of the reference virtual machine. - */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) - private String powerState; - - /* - * Last known compute power state captured in DTL - */ - @JsonProperty(value = "lastKnownPowerState", access = JsonProperty.Access.WRITE_ONLY) - private String lastKnownPowerState; - - /** - * 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.rdpAuthority; - } - - /** - * 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.sshAuthority; - } - - /** - * Get the powerState property: The power state of the reference virtual machine. - * - * @return the powerState value. - */ - public String powerState() { - return this.powerState; - } - - /** - * Get the lastKnownPowerState property: Last known compute power state captured in DTL. - * - * @return the lastKnownPowerState value. - */ - public String lastKnownPowerState() { - return this.lastKnownPowerState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/WeekDay.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/WeekDay.java new file mode 100644 index 0000000000000..9277a8a4b20c7 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/WeekDay.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.labservices.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for WeekDay. */ +public enum WeekDay { + /** Enum value Sunday. */ + SUNDAY("Sunday"), + + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"); + + /** The actual serialized value for a WeekDay instance. */ + private final String value; + + WeekDay(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WeekDay instance. + * + * @param value the serialized value to parse. + * @return the parsed WeekDay object, or null if unable to parse. + */ + @JsonCreator + public static WeekDay fromString(String value) { + WeekDay[] items = WeekDay.values(); + for (WeekDay item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/package-info.java index afadae9800c2f..d81e0f8a774bb 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/package-info.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/models/package-info.java @@ -2,5 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for ManagedLabsClient. The Managed Labs Client. */ +/** Package containing the data models for LabServicesClient. REST API for managing Azure Lab Services images. */ package com.azure.resourcemanager.labservices.models; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/package-info.java b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/package-info.java index 0ab50b45a20f2..ab8d6690d2e9f 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/package-info.java +++ b/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/package-info.java @@ -2,5 +2,5 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for ManagedLabsClient. The Managed Labs Client. */ +/** Package containing the classes for LabServicesClient. REST API for managing Azure Lab Services images. */ package com.azure.resourcemanager.labservices; diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..0fd737fe939aa --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.generated; + +import com.azure.resourcemanager.labservices.models.EnableState; + +/** Samples for Images CreateOrUpdate. */ +public final class ImagesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/putImage.json + */ + /** + * Sample code: putImage. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .images() + .define("image1") + .withExistingLabPlan("testrg123", "testlabplan") + .withEnabledState(EnableState.ENABLED) + .create(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesGetSamples.java new file mode 100644 index 0000000000000..97e44adbb3c76 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesGetSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Images Get. */ +public final class ImagesGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/getImage.json + */ + /** + * Sample code: getImage. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.images().getWithResponse("testrg123", "testlabplan", "image1", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesListByLabPlanSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesListByLabPlanSamples.java new file mode 100644 index 0000000000000..d2b5e0159e9c4 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesListByLabPlanSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Images ListByLabPlan. */ +public final class ImagesListByLabPlanSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/listImages.json + */ + /** + * Sample code: listImages. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listImages(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.images().listByLabPlan("testrg123", "testlabplan", null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesUpdateSamples.java new file mode 100644 index 0000000000000..229d9145976c9 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/ImagesUpdateSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.Image; + +/** Samples for Images Update. */ +public final class ImagesUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Images/patchImage.json + */ + /** + * Sample code: patchImage. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchImage(com.azure.resourcemanager.labservices.LabServicesManager manager) { + Image resource = + manager.images().getWithResponse("testrg123", "testlabplan", "image1", Context.NONE).getValue(); + resource.update().withEnabledState(EnableState.ENABLED).apply(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ae50f65419f03 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansCreateOrUpdateSamples.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.labservices.generated; + +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.ConnectionType; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.LabPlanNetworkProfile; +import com.azure.resourcemanager.labservices.models.ShutdownOnIdleMode; +import com.azure.resourcemanager.labservices.models.SupportInfo; +import java.time.Duration; + +/** Samples for LabPlans CreateOrUpdate. */ +public final class LabPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/putLabPlan.json + */ + /** + * Sample code: putLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .labPlans() + .define("testlabplan") + .withRegion("westus") + .withExistingResourceGroup("testrg123") + .withDefaultConnectionProfile( + new ConnectionProfile() + .withWebSshAccess(ConnectionType.NONE) + .withWebRdpAccess(ConnectionType.NONE) + .withClientSshAccess(ConnectionType.PUBLIC) + .withClientRdpAccess(ConnectionType.PUBLIC)) + .withDefaultAutoShutdownProfile( + new AutoShutdownProfile() + .withShutdownOnDisconnect(EnableState.ENABLED) + .withShutdownWhenNotConnected(EnableState.ENABLED) + .withShutdownOnIdle(ShutdownOnIdleMode.USER_ABSENCE) + .withDisconnectDelay(Duration.parse("00:05")) + .withNoConnectDelay(Duration.parse("01:00")) + .withIdleDelay(Duration.parse("01:00"))) + .withDefaultNetworkProfile( + new LabPlanNetworkProfile() + .withSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default")) + .withSharedGalleryId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Compute/galleries/testsig") + .withSupportInfo( + new SupportInfo() + .withUrl("help.contoso.com") + .withEmail("help@contoso.com") + .withPhone("+1-202-555-0123") + .withInstructions("Contact support for help.")) + .create(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansDeleteSamples.java new file mode 100644 index 0000000000000..e5dadb6b47d88 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansDeleteSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for LabPlans Delete. */ +public final class LabPlansDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/deleteLabPlan.json + */ + /** + * Sample code: deleteLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().delete("testrg123", "testlabplan", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansGetByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1346c881d8226 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansGetByResourceGroupSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for LabPlans GetByResourceGroup. */ +public final class LabPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/getLabPlan.json + */ + /** + * Sample code: getLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().getByResourceGroupWithResponse("testrg123", "testlabplan", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d16e268632142 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListByResourceGroupSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for LabPlans ListByResourceGroup. */ +public final class LabPlansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/listResourceGroupLabPlans.json + */ + /** + * Sample code: listResourceGroupLabPlans. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listResourceGroupLabPlans(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().listByResourceGroup("testrg123", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListSamples.java new file mode 100644 index 0000000000000..d75db6c5d98c6 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansListSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for LabPlans List. */ +public final class LabPlansListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/listLabPlans.json + */ + /** + * Sample code: listLabPlans. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listLabPlans(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labPlans().list(null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansSaveImageSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansSaveImageSamples.java new file mode 100644 index 0000000000000..cfb92b0bb04d5 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansSaveImageSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.SaveImageBody; + +/** Samples for LabPlans SaveImage. */ +public final class LabPlansSaveImageSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/saveImageVirtualMachine.json + */ + /** + * Sample code: saveImageVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void saveImageVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .labPlans() + .saveImage( + "testrg123", + "testlabplan", + new SaveImageBody() + .withName("Test Image") + .withLabVirtualMachineId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/virtualMachines/template"), + Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansUpdateSamples.java new file mode 100644 index 0000000000000..6b7a7452919d8 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabPlansUpdateSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.ConnectionType; +import com.azure.resourcemanager.labservices.models.LabPlan; + +/** Samples for LabPlans Update. */ +public final class LabPlansUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabPlans/patchLabPlan.json + */ + /** + * Sample code: patchLabPlan. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchLabPlan(com.azure.resourcemanager.labservices.LabServicesManager manager) { + LabPlan resource = + manager.labPlans().getByResourceGroupWithResponse("testrg123", "testlabplan", Context.NONE).getValue(); + resource + .update() + .withDefaultConnectionProfile( + new ConnectionProfile() + .withWebSshAccess(ConnectionType.NONE) + .withWebRdpAccess(ConnectionType.NONE) + .withClientSshAccess(ConnectionType.PUBLIC) + .withClientRdpAccess(ConnectionType.PUBLIC)) + .apply(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..96eab3ebebf6e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsCreateOrUpdateSamples.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.generated; + +import com.azure.resourcemanager.labservices.models.AutoShutdownProfile; +import com.azure.resourcemanager.labservices.models.ConnectionProfile; +import com.azure.resourcemanager.labservices.models.ConnectionType; +import com.azure.resourcemanager.labservices.models.CreateOption; +import com.azure.resourcemanager.labservices.models.Credentials; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.ImageReference; +import com.azure.resourcemanager.labservices.models.LabNetworkProfile; +import com.azure.resourcemanager.labservices.models.SecurityProfile; +import com.azure.resourcemanager.labservices.models.ShutdownOnIdleMode; +import com.azure.resourcemanager.labservices.models.Sku; +import com.azure.resourcemanager.labservices.models.VirtualMachineAdditionalCapabilities; +import com.azure.resourcemanager.labservices.models.VirtualMachineProfile; +import java.time.Duration; + +/** Samples for Labs CreateOrUpdate. */ +public final class LabsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/putLab.json + */ + /** + * Sample code: putLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .labs() + .define("testlab") + .withRegion("westus") + .withExistingResourceGroup("testrg123") + .withNetworkProfile( + new LabNetworkProfile() + .withSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/default")) + .withAutoShutdownProfile( + new AutoShutdownProfile() + .withShutdownOnDisconnect(EnableState.ENABLED) + .withShutdownWhenNotConnected(EnableState.ENABLED) + .withShutdownOnIdle(ShutdownOnIdleMode.USER_ABSENCE) + .withDisconnectDelay(Duration.parse("00:05")) + .withNoConnectDelay(Duration.parse("01:00")) + .withIdleDelay(Duration.parse("01:00"))) + .withConnectionProfile( + new ConnectionProfile() + .withWebSshAccess(ConnectionType.NONE) + .withWebRdpAccess(ConnectionType.NONE) + .withClientSshAccess(ConnectionType.PUBLIC) + .withClientRdpAccess(ConnectionType.PUBLIC)) + .withVirtualMachineProfile( + new VirtualMachineProfile() + .withCreateOption(CreateOption.TEMPLATE_VM) + .withImageReference( + new ImageReference() + .withOffer("WindowsServer") + .withPublisher("Microsoft") + .withSku("2019-Datacenter") + .withVersion("2019.0.20190410")) + .withSku(new Sku().withName("Medium")) + .withAdditionalCapabilities( + new VirtualMachineAdditionalCapabilities().withInstallGpuDrivers(EnableState.DISABLED)) + .withUsageQuota(Duration.parse("10:00")) + .withUseSharedPassword(EnableState.DISABLED) + .withAdminUser(new Credentials().withUsername("test-user"))) + .withSecurityProfile(new SecurityProfile().withOpenAccess(EnableState.DISABLED)) + .withLabPlanId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labPlans/testlabplan") + .withTitle("Test Lab") + .withDescription("This is a test lab.") + .create(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsDeleteSamples.java new file mode 100644 index 0000000000000..e00d47f23f805 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs Delete. */ +public final class LabsDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/deleteLab.json + */ + /** + * Sample code: deleteLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().delete("testrg123", "testlab", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsGetByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d75bc1cd33fa6 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs GetByResourceGroup. */ +public final class LabsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/getLab.json + */ + /** + * Sample code: getLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().getByResourceGroupWithResponse("testrg123", "testlab", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListByResourceGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ec0edd684538d --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs ListByResourceGroup. */ +public final class LabsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/listResourceGroupLabs.json + */ + /** + * Sample code: listResourceGroupLabs. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listResourceGroupLabs(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().listByResourceGroup("testrg123", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsListSamples.java new file mode 100644 index 0000000000000..63fefa80b99f4 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs List. */ +public final class LabsListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/listLabs.json + */ + /** + * Sample code: listLabs. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listLabs(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().list(null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsPublishSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsPublishSamples.java new file mode 100644 index 0000000000000..87f2fb32eb3c7 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsPublishSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs Publish. */ +public final class LabsPublishSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/publishLab.json + */ + /** + * Sample code: publishLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void publishLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().publish("testrg123", "testlab", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsSyncGroupSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsSyncGroupSamples.java new file mode 100644 index 0000000000000..03f0090bd50a8 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsSyncGroupSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Labs SyncGroup. */ +public final class LabsSyncGroupSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/syncLab.json + */ + /** + * Sample code: syncLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void syncLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.labs().syncGroup("testrg123", "testlab", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsUpdateSamples.java new file mode 100644 index 0000000000000..002dd14557d17 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/LabsUpdateSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.EnableState; +import com.azure.resourcemanager.labservices.models.Lab; +import com.azure.resourcemanager.labservices.models.SecurityProfile; + +/** Samples for Labs Update. */ +public final class LabsUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Labs/patchLab.json + */ + /** + * Sample code: patchLab. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchLab(com.azure.resourcemanager.labservices.LabServicesManager manager) { + Lab resource = manager.labs().getByResourceGroupWithResponse("testrg123", "testlab", Context.NONE).getValue(); + resource.update().withSecurityProfile(new SecurityProfile().withOpenAccess(EnableState.ENABLED)).apply(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationResultsGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationResultsGetSamples.java new file mode 100644 index 0000000000000..218f42c54ca65 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationResultsGetSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationResults Get. */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/OperationResults/getOperationResult.json + */ + /** + * Sample code: getOperationResult. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getOperationResult(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.operationResults().getWithResponse("a64149d8-84cb-4566-ab8e-b4ee1a074174", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationsListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..386139845e359 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/OperationsListSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/LabServices/listOperations.json + */ + /** + * Sample code: listOperations. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listOperations(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f304f71d5990e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesCreateOrUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.labservices.generated; + +import com.azure.resourcemanager.labservices.models.RecurrenceFrequency; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import java.time.LocalDate; +import java.time.OffsetDateTime; + +/** Samples for Schedules CreateOrUpdate. */ +public final class SchedulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/putSchedule.json + */ + /** + * Sample code: putSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .schedules() + .define("schedule1") + .withExistingLab("testrg123", "testlab") + .withStartAt(OffsetDateTime.parse("2020-05-26T12:00:00Z")) + .withStopAt(OffsetDateTime.parse("2020-05-26T18:00:00Z")) + .withRecurrencePattern( + new RecurrencePattern() + .withFrequency(RecurrenceFrequency.DAILY) + .withInterval(2) + .withExpirationDate(LocalDate.parse("2020-08-14"))) + .withTimeZoneId("America/Los_Angeles") + .withNotes("Schedule 1 for students") + .create(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesDeleteSamples.java new file mode 100644 index 0000000000000..0bbf78d882cf8 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Delete. */ +public final class SchedulesDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/deleteSchedule.json + */ + /** + * Sample code: deleteSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.schedules().delete("testrg123", "testlab", "schedule1", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesGetSamples.java new file mode 100644 index 0000000000000..0d687b8ac5f33 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules Get. */ +public final class SchedulesGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/getSchedule.json + */ + /** + * Sample code: getSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.schedules().getWithResponse("testrg123", "testlab", "schedule1", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesListByLabSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesListByLabSamples.java new file mode 100644 index 0000000000000..1eba45ff25260 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesListByLabSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Schedules ListByLab. */ +public final class SchedulesListByLabSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/listSchedule.json + */ + /** + * Sample code: getListSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getListSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.schedules().listByLab("testrg123", "testlab", null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesUpdateSamples.java new file mode 100644 index 0000000000000..0d7c4df73b430 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SchedulesUpdateSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.RecurrenceFrequency; +import com.azure.resourcemanager.labservices.models.RecurrencePattern; +import com.azure.resourcemanager.labservices.models.Schedule; +import java.time.LocalDate; + +/** Samples for Schedules Update. */ +public final class SchedulesUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Schedules/patchSchedule.json + */ + /** + * Sample code: patchSchedule. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchSchedule(com.azure.resourcemanager.labservices.LabServicesManager manager) { + Schedule resource = + manager.schedules().getWithResponse("testrg123", "testlab", "schedule1", Context.NONE).getValue(); + resource + .update() + .withRecurrencePattern( + new RecurrencePattern() + .withFrequency(RecurrenceFrequency.DAILY) + .withInterval(2) + .withExpirationDate(LocalDate.parse("2020-08-14"))) + .apply(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SkusListSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SkusListSamples.java new file mode 100644 index 0000000000000..e1dc4f4971363 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/SkusListSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Skus/listSkus.json + */ + /** + * Sample code: listSkus. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listSkus(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.skus().list(null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsagesListByLocationSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsagesListByLocationSamples.java new file mode 100644 index 0000000000000..54ac5359d0cb4 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsagesListByLocationSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Usages ListByLocation. */ +public final class UsagesListByLocationSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Usages/getUsages.json + */ + /** + * Sample code: listUsages. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listUsages(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.usages().listByLocation("westus2", null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersCreateOrUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..90488cd050955 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersCreateOrUpdateSamples.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.labservices.generated; + +import java.time.Duration; + +/** Samples for Users CreateOrUpdate. */ +public final class UsersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/putUser.json + */ + /** + * Sample code: putUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void putUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .users() + .define("testuser") + .withExistingLab("testrg123", "testlab") + .withEmail("testuser@contoso.com") + .withAdditionalUsageQuota(Duration.parse("20:00")) + .create(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersDeleteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersDeleteSamples.java new file mode 100644 index 0000000000000..9699f5ec112f4 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Users Delete. */ +public final class UsersDeleteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/deleteUser.json + */ + /** + * Sample code: deleteUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void deleteUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.users().delete("testrg123", "testlab", "testuser", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersGetSamples.java new file mode 100644 index 0000000000000..be62aace0ad25 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Users Get. */ +public final class UsersGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/getUser.json + */ + /** + * Sample code: getUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.users().getWithResponse("testrg123", "testlab", "testuser", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersInviteSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersInviteSamples.java new file mode 100644 index 0000000000000..bacbfc3385121 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersInviteSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.InviteBody; + +/** Samples for Users Invite. */ +public final class UsersInviteSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/inviteUser.json + */ + /** + * Sample code: inviteUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void inviteUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .users() + .invite( + "testrg123", + "testlab", + "testuser", + new InviteBody().withText("Invitation to lab testlab"), + Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersListByLabSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersListByLabSamples.java new file mode 100644 index 0000000000000..4760ac3f93259 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersListByLabSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Users ListByLab. */ +public final class UsersListByLabSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/listUser.json + */ + /** + * Sample code: listUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.users().listByLab("testrg123", "testlab", null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersUpdateSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersUpdateSamples.java new file mode 100644 index 0000000000000..c3f2bb4f59281 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/UsersUpdateSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.User; +import java.time.Duration; + +/** Samples for Users Update. */ +public final class UsersUpdateSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/Users/patchUser.json + */ + /** + * Sample code: patchUser. + * + * @param manager Entry point to LabServicesManager. + */ + public static void patchUser(com.azure.resourcemanager.labservices.LabServicesManager manager) { + User resource = manager.users().getWithResponse("testrg123", "testlab", "testuser", Context.NONE).getValue(); + resource.update().withAdditionalUsageQuota(Duration.parse("20:00")).apply(); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesGetSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesGetSamples.java new file mode 100644 index 0000000000000..10e5d02ba815e --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Get. */ +public final class VirtualMachinesGetSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/getVirtualMachine.json + */ + /** + * Sample code: getVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().getWithResponse("testrg123", "testlab", "template", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesListByLabSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesListByLabSamples.java new file mode 100644 index 0000000000000..675738c03ef07 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesListByLabSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines ListByLab. */ +public final class VirtualMachinesListByLabSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/listVirtualMachine.json + */ + /** + * Sample code: listVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void listVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().listByLab("testrg123", "testlab", null, Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesRedeploySamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesRedeploySamples.java new file mode 100644 index 0000000000000..3879044d3c987 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Redeploy. */ +public final class VirtualMachinesRedeploySamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/redeployVirtualMachine.json + */ + /** + * Sample code: redeployVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void redeployVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().redeploy("testrg123", "testlab", "template", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesReimageSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesReimageSamples.java new file mode 100644 index 0000000000000..e852754d5f75c --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesReimageSamples.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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Reimage. */ +public final class VirtualMachinesReimageSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/reimageVirtualMachine.json + */ + /** + * Sample code: reimageVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void reimageVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().reimage("testrg123", "testlab", "template", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesResetPasswordSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesResetPasswordSamples.java new file mode 100644 index 0000000000000..9973f710d06fb --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesResetPasswordSamples.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.labservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.labservices.models.ResetPasswordBody; + +/** Samples for VirtualMachines ResetPassword. */ +public final class VirtualMachinesResetPasswordSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/resetPasswordVirtualMachine.json + */ + /** + * Sample code: resetPasswordVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void resetPasswordVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager + .virtualMachines() + .resetPassword( + "testrg123", + "testlab", + "template", + new ResetPasswordBody().withUsername("example-username").withPassword("example-password"), + Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStartSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStartSamples.java new file mode 100644 index 0000000000000..82e77b0c9b2ce --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/startVirtualMachine.json + */ + /** + * Sample code: startVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().start("testrg123", "testlab", "template", Context.NONE); + } +} diff --git a/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStopSamples.java b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/generated/VirtualMachinesStopSamples.java new file mode 100644 index 0000000000000..f73e1111096d8 --- /dev/null +++ b/sdk/labservices/azure-resourcemanager-labservices/src/samples/java/com/azure/resourcemanager/labservices/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.labservices.generated; + +import com.azure.core.util.Context; + +/** Samples for VirtualMachines Stop. */ +public final class VirtualMachinesStopSamples { + /* + * x-ms-original-file: specification/labservices/resource-manager/Microsoft.LabServices/preview/2021-11-15-preview/examples/VirtualMachines/stopVirtualMachine.json + */ + /** + * Sample code: stopVirtualMachine. + * + * @param manager Entry point to LabServicesManager. + */ + public static void stopVirtualMachine(com.azure.resourcemanager.labservices.LabServicesManager manager) { + manager.virtualMachines().stop("testrg123", "testlab", "template", Context.NONE); + } +}