From 9303c9078a7f09a4257fe93433802b98cc71fa00 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 13 Feb 2019 14:32:25 -0800 Subject: [PATCH] [AutoPR] labservices/resource-manager (#2723) * Generated from 7387a174e0b887c07c475469b1be00c1b816fb9e (#2669) Add first GA LabServices API * Generated from eef3c7046ebad353cb28ad76a425e1ea145d18d7 (#2747) [LabServices] Fix typo, remove required from optional param * Generated from 7b37f078178dfa4b7658a081031fd516249abfc1 (#2799) typo: labservices/resource-manager/Microsoft.LabServices - evironments -> environments --- .../resource-manager/v2018_10_15/pom.xml | 133 ++ .../labservices/v2018_10_15/AddRemove.java | 41 + .../v2018_10_15/AddUsersPayload.java | 44 + .../v2018_10_15/ConfigurationState.java | 41 + .../v2018_10_15/CreateLabProperties.java | 148 ++ .../labservices/v2018_10_15/Environment.java | 283 +++ .../v2018_10_15/EnvironmentDetails.java | 156 ++ .../v2018_10_15/EnvironmentFragment.java | 100 + .../EnvironmentOperationsPayload.java | 44 + .../v2018_10_15/EnvironmentSetting.java | 343 +++ .../EnvironmentSettingCreationParameters.java | 43 + .../EnvironmentSettingFragment.java | 180 ++ .../v2018_10_15/EnvironmentSettings.java | 104 + .../v2018_10_15/EnvironmentSize.java | 122 ++ .../v2018_10_15/EnvironmentSizeFragment.java | 72 + .../labservices/v2018_10_15/Environments.java | 112 + .../labservices/v2018_10_15/GalleryImage.java | 328 +++ .../v2018_10_15/GalleryImageFragment.java | 152 ++ .../v2018_10_15/GalleryImageReference.java | 147 ++ .../GalleryImageReferenceFragment.java | 147 ++ .../v2018_10_15/GalleryImages.java | 53 + .../v2018_10_15/GetEnvironmentResponse.java | 25 + .../GetPersonalPreferencesResponse.java | 31 + .../GetRegionalAvailabilityResponse.java | 26 + .../labservices/v2018_10_15/GlobalUsers.java | 118 ++ .../labservices/v2018_10_15/Lab.java | 324 +++ .../labservices/v2018_10_15/LabAccount.java | 165 ++ .../v2018_10_15/LabAccountFragment.java | 100 + .../labservices/v2018_10_15/LabAccounts.java | 47 + .../v2018_10_15/LabCreationParameters.java | 43 + .../labservices/v2018_10_15/LabDetails.java | 111 + .../labservices/v2018_10_15/LabFragment.java | 154 ++ .../v2018_10_15/LabUserAccessMode.java | 41 + .../labservices/v2018_10_15/Labs.java | 77 + .../v2018_10_15/LatestOperationResult.java | 107 + .../v2018_10_15/ListEnvironmentsPayload.java | 43 + .../v2018_10_15/ListEnvironmentsResponse.java | 26 + .../v2018_10_15/ListLabsResponse.java | 26 + .../v2018_10_15/ManagedLabVmSize.java | 44 + .../v2018_10_15/NetworkInterface.java | 77 + .../OperationBatchStatusPayload.java | 44 + .../OperationBatchStatusResponse.java | 26 + .../OperationBatchStatusResponseItem.java | 47 + .../v2018_10_15/OperationError.java | 69 + .../v2018_10_15/OperationMetadata.java | 30 + .../v2018_10_15/OperationMetadataDisplay.java | 121 ++ .../v2018_10_15/OperationResult.java | 30 + .../v2018_10_15/OperationStatusPayload.java | 43 + .../v2018_10_15/OperationStatusResponse.java | 25 + .../labservices/v2018_10_15/Operations.java | 29 + .../PersonalPerferencesOperationsPayload.java | 97 + .../PersonalPreferencesOperationsPayload.java | 97 + .../v2018_10_15/ProviderOperations.java | 27 + .../v2018_10_15/PublishPayload.java | 43 + .../v2018_10_15/PublishingState.java | 50 + .../labservices/v2018_10_15/ReferenceVm.java | 100 + .../ReferenceVmCreationParameters.java | 69 + .../v2018_10_15/ReferenceVmFragment.java | 70 + .../v2018_10_15/RegionalAvailability.java | 70 + .../v2018_10_15/RegisterPayload.java | 43 + .../v2018_10_15/ResetPasswordPayload.java | 95 + .../labservices/v2018_10_15/ResourceSet.java | 69 + .../v2018_10_15/ResourceSetFragment.java | 69 + .../ResourceSettingCreationParameters.java | 149 ++ .../v2018_10_15/ResourceSettings.java | 142 ++ .../v2018_10_15/ResourceSettingsFragment.java | 97 + .../v2018_10_15/SizeAvailability.java | 70 + .../SizeConfigurationProperties.java | 45 + .../SizeConfigurationPropertiesFragment.java | 45 + .../labservices/v2018_10_15/SizeInfo.java | 124 ++ .../v2018_10_15/SizeInfoFragment.java | 124 ++ .../labservices/v2018_10_15/User.java | 237 +++ .../labservices/v2018_10_15/UserFragment.java | 74 + .../labservices/v2018_10_15/Users.java | 56 + .../v2018_10_15/VirtualMachineDetails.java | 107 + .../v2018_10_15/VmStateDetails.java | 79 + .../implementation/EnvironmentImpl.java | 251 +++ .../implementation/EnvironmentInner.java | 240 +++ .../EnvironmentSettingImpl.java | 268 +++ .../EnvironmentSettingInner.java | 246 +++ .../EnvironmentSettingsImpl.java | 105 + .../EnvironmentSettingsInner.java | 1867 ++++++++++++++++ .../implementation/EnvironmentsImpl.java | 106 + .../implementation/EnvironmentsInner.java | 1881 +++++++++++++++++ .../implementation/GalleryImageImpl.java | 260 +++ .../implementation/GalleryImageInner.java | 260 +++ .../implementation/GalleryImagesImpl.java | 81 + .../implementation/GalleryImagesInner.java | 946 +++++++++ .../GetEnvironmentResponseImpl.java | 32 + .../GetEnvironmentResponseInner.java | 33 + .../GetPersonalPreferencesResponseImpl.java | 37 + .../GetPersonalPreferencesResponseInner.java | 70 + .../GetRegionalAvailabilityResponseImpl.java | 33 + .../GetRegionalAvailabilityResponseInner.java | 45 + .../implementation/GlobalUsersImpl.java | 135 ++ .../implementation/GlobalUsersInner.java | 1377 ++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/LabAccountImpl.java | 124 ++ .../implementation/LabAccountInner.java | 132 ++ .../implementation/LabAccountsImpl.java | 158 ++ .../implementation/LabAccountsInner.java | 1509 +++++++++++++ .../v2018_10_15/implementation/LabImpl.java | 256 +++ .../v2018_10_15/implementation/LabInner.java | 247 +++ .../implementation/LabServicesManager.java | 195 ++ .../v2018_10_15/implementation/LabsImpl.java | 94 + .../v2018_10_15/implementation/LabsInner.java | 1229 +++++++++++ .../ListEnvironmentsResponseImpl.java | 33 + .../ListEnvironmentsResponseInner.java | 45 + .../implementation/ListLabsResponseImpl.java | 33 + .../implementation/ListLabsResponseInner.java | 45 + .../implementation/ManagedLabsClientImpl.java | 308 +++ .../OperationBatchStatusResponseImpl.java | 33 + .../OperationBatchStatusResponseInner.java | 34 + .../implementation/OperationMetadataImpl.java | 37 + .../OperationMetadataInner.java | 70 + .../implementation/OperationResultImpl.java | 43 + .../implementation/OperationResultInner.java | 70 + .../OperationStatusResponseImpl.java | 31 + .../OperationStatusResponseInner.java | 32 + .../implementation/OperationsImpl.java | 46 + .../implementation/OperationsInner.java | 146 ++ .../v2018_10_15/implementation/PageImpl.java | 75 + .../ProviderOperationsImpl.java | 49 + .../ProviderOperationsInner.java | 283 +++ .../v2018_10_15/implementation/UserImpl.java | 212 ++ .../v2018_10_15/implementation/UserInner.java | 166 ++ .../v2018_10_15/implementation/UsersImpl.java | 81 + .../implementation/UsersInner.java | 1083 ++++++++++ .../implementation/package-info.java | 11 + .../labservices/v2018_10_15/package-info.java | 11 + 130 files changed, 22341 insertions(+) create mode 100644 labservices/resource-manager/v2018_10_15/pom.xml create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddRemove.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddUsersPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ConfigurationState.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/CreateLabProperties.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentDetails.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentOperationsPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSetting.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingCreationParameters.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettings.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSize.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSizeFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environments.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImage.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReference.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReferenceFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImages.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetEnvironmentResponse.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetPersonalPreferencesResponse.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetRegionalAvailabilityResponse.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GlobalUsers.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Lab.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccount.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccountFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccounts.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabCreationParameters.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabDetails.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabUserAccessMode.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Labs.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LatestOperationResult.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsResponse.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListLabsResponse.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ManagedLabVmSize.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/NetworkInterface.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponse.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponseItem.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationError.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadata.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadataDisplay.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationResult.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusResponse.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Operations.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPerferencesOperationsPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPreferencesOperationsPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ProviderOperations.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishingState.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVm.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmCreationParameters.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegionalAvailability.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegisterPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResetPasswordPayload.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSet.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSetFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingCreationParameters.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettings.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingsFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeAvailability.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationProperties.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationPropertiesFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfo.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfoFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/User.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/UserFragment.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Users.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VirtualMachineDetails.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VmStateDetails.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/IdParsingUtils.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabServicesManager.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ManagedLabsClientImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/PageImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersImpl.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/package-info.java create mode 100644 labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/package-info.java diff --git a/labservices/resource-manager/v2018_10_15/pom.xml b/labservices/resource-manager/v2018_10_15/pom.xml new file mode 100644 index 0000000000000..2f150e21ccf8f --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.labservices.v2018_10_15 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-labservices + 1.0.0-beta + jar + Microsoft Azure SDK for LabServices Management + This package contains Microsoft LabServices Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddRemove.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddRemove.java new file mode 100644 index 0000000000000..da80cafcac738 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddRemove.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddUsersPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddUsersPayload.java new file mode 100644 index 0000000000000..188d03e2fa758 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/AddUsersPayload.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Payload for Add Users operation on a Lab. + */ +public class AddUsersPayload { + /** + * List of user emails addresses to add to the lab. + */ + @JsonProperty(value = "emailAddresses", required = true) + private List emailAddresses; + + /** + * Get list of user emails addresses to add to the lab. + * + * @return the emailAddresses value + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ConfigurationState.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ConfigurationState.java new file mode 100644 index 0000000000000..95dc0ff540a41 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ConfigurationState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/CreateLabProperties.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/CreateLabProperties.java new file mode 100644 index 0000000000000..0cb06fcc6aa0a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/CreateLabProperties.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties for creating a managed lab and a default environment setting. + */ +public class CreateLabProperties { + /** + * 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 settings related to creating an environment setting. + * + * @return the environmentSettingCreationParameters value + */ + public EnvironmentSettingCreationParameters environmentSettingCreationParameters() { + return this.environmentSettingCreationParameters; + } + + /** + * Set 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 settings related to creating a lab. + * + * @return the labCreationParameters value + */ + public LabCreationParameters labCreationParameters() { + return this.labCreationParameters; + } + + /** + * Set 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 of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 of the resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set 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 of the resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environment.java new file mode 100644 index 0000000000000..57f3f4b4f3c1c --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environment.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.EnvironmentInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import java.util.Map; +import org.joda.time.Period; +import org.joda.time.DateTime; + +/** + * Type representing Environment. + */ +public interface Environment extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the claimedByUserName value. + */ + String claimedByUserName(); + + /** + * @return the claimedByUserObjectId value. + */ + String claimedByUserObjectId(); + + /** + * @return the claimedByUserPrincipalId value. + */ + String claimedByUserPrincipalId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isClaimed value. + */ + Boolean isClaimed(); + + /** + * @return the lastKnownPowerState value. + */ + String lastKnownPowerState(); + + /** + * @return the latestOperationResult value. + */ + LatestOperationResult latestOperationResult(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkInterface value. + */ + NetworkInterface networkInterface(); + + /** + * @return the passwordLastReset value. + */ + DateTime passwordLastReset(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceSets value. + */ + ResourceSet resourceSets(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the totalUsage value. + */ + Period totalUsage(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * The entirety of the Environment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithEnvironmentsetting, DefinitionStages.WithCreate { + } + + /** + * Grouping of Environment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Environment definition. + */ + interface Blank extends WithEnvironmentsetting { + } + + /** + * The stage of the environment definition allowing to specify Environmentsetting. + */ + interface WithEnvironmentsetting { + /** + * 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 allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the environment definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @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 ResourceSets. + */ + interface WithResourceSets { + /** + * Specifies resourceSets. + * @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 Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the environment definition allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next definition stage + */ + WithCreate withUniqueIdentifier(String uniqueIdentifier); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceSets, DefinitionStages.WithTags, DefinitionStages.WithUniqueIdentifier { + } + } + /** + * The template for a Environment update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithProvisioningState, UpdateStages.WithResourceSets, UpdateStages.WithTags, UpdateStages.WithUniqueIdentifier { + } + + /** + * Grouping of Environment update stages. + */ + interface UpdateStages { + /** + * The stage of the environment update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the environment update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the environment update allowing to specify ResourceSets. + */ + interface WithResourceSets { + /** + * Specifies resourceSets. + * @param resourceSets The set of a VM and the setting id it was created for + * @return the next update stage + */ + Update withResourceSets(ResourceSetFragment resourceSets); + } + + /** + * The stage of the environment update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the environment update allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next update stage + */ + Update withUniqueIdentifier(String uniqueIdentifier); + } + + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentDetails.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentDetails.java new file mode 100644 index 0000000000000..bc6522af1d04e --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentDetails.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import org.joda.time.Period; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This represents the details about a User's environment and its state. + */ +public class EnvironmentDetails { + /** + * 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 Period totalUsage; + + /** + * When the password was last reset on the environment. + */ + @JsonProperty(value = "passwordLastReset", access = JsonProperty.Access.WRITE_ONLY) + private DateTime passwordLastReset; + + /** + * Get name of the Environment. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get description of the Environment. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get resource Id of the environment. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the provisioning state of the environment. This also includes LabIsFull and NotYetProvisioned status. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get details of backing DTL virtual machine with compute and network details. + * + * @return the virtualMachineDetails value + */ + public VirtualMachineDetails virtualMachineDetails() { + return this.virtualMachineDetails; + } + + /** + * Get the details of the latest operation. ex: status, error. + * + * @return the latestOperationResult value + */ + public LatestOperationResult latestOperationResult() { + return this.latestOperationResult; + } + + /** + * Get publishing state of the environment setting Possible values are Creating, Created, Failed. + * + * @return the environmentState value + */ + public String environmentState() { + return this.environmentState; + } + + /** + * Get how long the environment has been used by a lab user. + * + * @return the totalUsage value + */ + public Period totalUsage() { + return this.totalUsage; + } + + /** + * Get when the password was last reset on the environment. + * + * @return the passwordLastReset value + */ + public DateTime passwordLastReset() { + return this.passwordLastReset; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentFragment.java new file mode 100644 index 0000000000000..85a67cf3cd80a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentFragment.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents an environment instance. + */ +@JsonFlatten +@SkipParentValidation +public class EnvironmentFragment extends Resource { + /** + * 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 set of a VM and the setting id it was created for. + * + * @return the resourceSets value + */ + public ResourceSetFragment resourceSets() { + return this.resourceSets; + } + + /** + * Set 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 provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentOperationsPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentOperationsPayload.java new file mode 100644 index 0000000000000..97a01c25902a1 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentOperationsPayload.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents payload for any Environment operations like get, start, stop, + * connect. + */ +public class EnvironmentOperationsPayload { + /** + * The resourceId of the environment. + */ + @JsonProperty(value = "environmentId", required = true) + private String environmentId; + + /** + * Get the resourceId of the environment. + * + * @return the environmentId value + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSetting.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSetting.java new file mode 100644 index 0000000000000..4c789ee6b0f8d --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSetting.java @@ -0,0 +1,343 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.EnvironmentSettingInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing EnvironmentSetting. + */ +public interface EnvironmentSetting extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the configurationState value. + */ + ConfigurationState configurationState(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastChanged value. + */ + DateTime lastChanged(); + + /** + * @return the lastPublished value. + */ + DateTime lastPublished(); + + /** + * @return the latestOperationResult value. + */ + LatestOperationResult latestOperationResult(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publishingState value. + */ + PublishingState publishingState(); + + /** + * @return the resourceSettings value. + */ + ResourceSettings resourceSettings(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the title value. + */ + String title(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * The entirety of the EnvironmentSetting definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLab, DefinitionStages.WithResourceSettings, DefinitionStages.WithCreate { + } + + /** + * Grouping of EnvironmentSetting definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a EnvironmentSetting definition. + */ + interface Blank extends WithLab { + } + + /** + * The stage of the environmentsetting definition allowing to specify Lab. + */ + interface WithLab { + /** + * 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 + */ + WithResourceSettings withExistingLab(String resourceGroupName, String labAccountName, String labName); + } + + /** + * The stage of the environmentsetting definition allowing to specify ResourceSettings. + */ + interface WithResourceSettings { + /** + * Specifies resourceSettings. + * @param resourceSettings The resource specific settings + * @return the next definition stage + */ + WithCreate withResourceSettings(ResourceSettings resourceSettings); + } + + /** + * The stage of the environmentsetting definition allowing to specify ConfigurationState. + */ + interface WithConfigurationState { + /** + * Specifies configurationState. + * @param configurationState Describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed' + * @return the next definition stage + */ + WithCreate withConfigurationState(ConfigurationState configurationState); + } + + /** + * The stage of the environmentsetting definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @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 Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the environmentsetting definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @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 Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the environmentsetting definition allowing to specify Title. + */ + interface WithTitle { + /** + * Specifies title. + * @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 UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next definition stage + */ + WithCreate withUniqueIdentifier(String uniqueIdentifier); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithConfigurationState, DefinitionStages.WithDescription, DefinitionStages.WithLocation, DefinitionStages.WithProvisioningState, DefinitionStages.WithTags, DefinitionStages.WithTitle, DefinitionStages.WithUniqueIdentifier { + } + } + /** + * The template for a EnvironmentSetting update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithConfigurationState, UpdateStages.WithDescription, UpdateStages.WithLocation, UpdateStages.WithProvisioningState, UpdateStages.WithResourceSettings, UpdateStages.WithTags, UpdateStages.WithTitle, UpdateStages.WithUniqueIdentifier { + } + + /** + * Grouping of EnvironmentSetting update stages. + */ + interface UpdateStages { + /** + * The stage of the environmentsetting update allowing to specify ConfigurationState. + */ + interface WithConfigurationState { + /** + * Specifies configurationState. + * @param configurationState Describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed' + * @return the next update stage + */ + Update withConfigurationState(ConfigurationState configurationState); + } + + /** + * The stage of the environmentsetting update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Describes the environment and its resource settings + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the environmentsetting update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the environmentsetting update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the environmentsetting update allowing to specify ResourceSettings. + */ + interface WithResourceSettings { + /** + * Specifies resourceSettings. + * @param resourceSettings The resource specific settings + * @return the next update stage + */ + Update withResourceSettings(ResourceSettingsFragment resourceSettings); + } + + /** + * The stage of the environmentsetting update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the environmentsetting update allowing to specify Title. + */ + interface WithTitle { + /** + * Specifies title. + * @param title Brief title describing the environment and its resource settings + * @return the next update stage + */ + Update withTitle(String title); + } + + /** + * The stage of the environmentsetting update allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next update stage + */ + Update withUniqueIdentifier(String uniqueIdentifier); + } + + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingCreationParameters.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingCreationParameters.java new file mode 100644 index 0000000000000..f9fc95704cf66 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingCreationParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings related to creating an environment setting. + */ +public class EnvironmentSettingCreationParameters { + /** + * The resource specific settings. + */ + @JsonProperty(value = "resourceSettingCreationParameters", required = true) + private ResourceSettingCreationParameters resourceSettingCreationParameters; + + /** + * Get the resource specific settings. + * + * @return the resourceSettingCreationParameters value + */ + public ResourceSettingCreationParameters resourceSettingCreationParameters() { + return this.resourceSettingCreationParameters; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingFragment.java new file mode 100644 index 0000000000000..99f3ebc7119fa --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettingFragment.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents settings of an environment, from which environment instances + * would be created. + */ +@JsonFlatten +@SkipParentValidation +public class EnvironmentSettingFragment extends Resource { + /** + * Describes the user's progress in configuring their environment setting. + * Possible values include: 'NotApplicable', 'Completed'. + */ + @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 describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed'. + * + * @return the configurationState value + */ + public ConfigurationState configurationState() { + return this.configurationState; + } + + /** + * Set describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed'. + * + * @param configurationState the configurationState value to set + * @return the EnvironmentSettingFragment object itself. + */ + public EnvironmentSettingFragment withConfigurationState(ConfigurationState configurationState) { + this.configurationState = configurationState; + return this; + } + + /** + * Get describes the environment and its resource settings. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 brief title describing the environment and its resource settings. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Set 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 resource specific settings. + * + * @return the resourceSettings value + */ + public ResourceSettingsFragment resourceSettings() { + return this.resourceSettings; + } + + /** + * Set 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 provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettings.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettings.java new file mode 100644 index 0000000000000..fac481ea3a1be --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSettings.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.EnvironmentSettingsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing EnvironmentSettings. + */ +public interface EnvironmentSettings extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable claimAnyAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable publishAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String labAccountName, final String labName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSize.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSize.java new file mode 100644 index 0000000000000..bcb1ecf16bb5f --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSize.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.List; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a size category supported by this Lab Account (small, medium or + * large). + */ +public class EnvironmentSize { + /** + * The size category. Possible values include: 'Basic', 'Standard', + * 'Performance'. + */ + @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 size category. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @return the name value + */ + public ManagedLabVmSize name() { + return this.name; + } + + /** + * Set the size category. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @param name the name value to set + * @return the EnvironmentSize object itself. + */ + public EnvironmentSize withName(ManagedLabVmSize name) { + this.name = name; + return this; + } + + /** + * Get represents a set of compute sizes that can serve this given size type. + * + * @return the vmSizes value + */ + public List vmSizes() { + return this.vmSizes; + } + + /** + * Set 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 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 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 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSizeFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSizeFragment.java new file mode 100644 index 0000000000000..8ade0d7962ab0 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/EnvironmentSizeFragment.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a size category supported by this Lab Account (small, medium or + * large). + */ +public class EnvironmentSizeFragment { + /** + * The size category. Possible values include: 'Basic', 'Standard', + * 'Performance'. + */ + @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 size category. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @return the name value + */ + public ManagedLabVmSize name() { + return this.name; + } + + /** + * Set the size category. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @param name the name value to set + * @return the EnvironmentSizeFragment object itself. + */ + public EnvironmentSizeFragment withName(ManagedLabVmSize name) { + this.name = name; + return this; + } + + /** + * Get represents a set of compute sizes that can serve this given size type. + * + * @return the vmSizes value + */ + public List vmSizes() { + return this.vmSizes; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environments.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environments.java new file mode 100644 index 0000000000000..5e234a6833c98 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Environments.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.EnvironmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Environments. + */ +public interface Environments extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable claimAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName); + + /** + * 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 + * @return the observable for the request + */ + Completable resetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload); + + /** + * 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 + * @return the observable for the request + */ + Completable startAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImage.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImage.java new file mode 100644 index 0000000000000..9dfb8d500221e --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImage.java @@ -0,0 +1,328 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.GalleryImageInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing GalleryImage. + */ +public interface GalleryImage extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the author value. + */ + String author(); + + /** + * @return the createdDate value. + */ + DateTime createdDate(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the icon value. + */ + String icon(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the imageReference value. + */ + GalleryImageReference imageReference(); + + /** + * @return the isEnabled value. + */ + Boolean isEnabled(); + + /** + * @return the isOverride value. + */ + Boolean isOverride(); + + /** + * @return the isPlanAuthorized value. + */ + Boolean isPlanAuthorized(); + + /** + * @return the latestOperationResult value. + */ + LatestOperationResult latestOperationResult(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the planId value. + */ + String planId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * The entirety of the GalleryImage definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLabaccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of GalleryImage definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a GalleryImage definition. + */ + interface Blank extends WithLabaccount { + } + + /** + * The stage of the galleryimage definition allowing to specify Labaccount. + */ + interface WithLabaccount { + /** + * 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 allowing to specify IsEnabled. + */ + interface WithIsEnabled { + /** + * Specifies isEnabled. + * @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 isOverride. + * @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 isPlanAuthorized. + * @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 Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the galleryimage definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @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 Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the galleryimage definition allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next definition stage + */ + WithCreate withUniqueIdentifier(String uniqueIdentifier); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithIsEnabled, DefinitionStages.WithIsOverride, DefinitionStages.WithIsPlanAuthorized, DefinitionStages.WithLocation, DefinitionStages.WithProvisioningState, DefinitionStages.WithTags, DefinitionStages.WithUniqueIdentifier { + } + } + /** + * The template for a GalleryImage update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIsEnabled, UpdateStages.WithIsOverride, UpdateStages.WithIsPlanAuthorized, UpdateStages.WithLocation, UpdateStages.WithProvisioningState, UpdateStages.WithTags, UpdateStages.WithUniqueIdentifier { + } + + /** + * Grouping of GalleryImage update stages. + */ + interface UpdateStages { + /** + * The stage of the galleryimage update allowing to specify IsEnabled. + */ + interface WithIsEnabled { + /** + * Specifies isEnabled. + * @param isEnabled Indicates whether this gallery image is enabled + * @return the next update stage + */ + Update withIsEnabled(Boolean isEnabled); + } + + /** + * The stage of the galleryimage update allowing to specify IsOverride. + */ + interface WithIsOverride { + /** + * Specifies isOverride. + * @param isOverride Indicates whether this gallery has been overridden for this lab account + * @return the next update stage + */ + Update withIsOverride(Boolean isOverride); + } + + /** + * The stage of the galleryimage update allowing to specify IsPlanAuthorized. + */ + interface WithIsPlanAuthorized { + /** + * Specifies isPlanAuthorized. + * @param isPlanAuthorized Indicates if the plan has been authorized for programmatic deployment + * @return the next update stage + */ + Update withIsPlanAuthorized(Boolean isPlanAuthorized); + } + + /** + * The stage of the galleryimage update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the galleryimage update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the galleryimage update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the galleryimage update allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next update stage + */ + Update withUniqueIdentifier(String uniqueIdentifier); + } + + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageFragment.java new file mode 100644 index 0000000000000..16d6529ff3322 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageFragment.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents an image from the Azure Marketplace. + */ +@JsonFlatten +@SkipParentValidation +public class GalleryImageFragment extends Resource { + /** + * 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 indicates whether this gallery image is enabled. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set 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 indicates whether this gallery has been overridden for this lab account. + * + * @return the isOverride value + */ + public Boolean isOverride() { + return this.isOverride; + } + + /** + * Set 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 indicates if the plan has been authorized for programmatic deployment. + * + * @return the isPlanAuthorized value + */ + public Boolean isPlanAuthorized() { + return this.isPlanAuthorized; + } + + /** + * Set 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 provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReference.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReference.java new file mode 100644 index 0000000000000..770efd07c4708 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReference.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The reference information for an Azure Marketplace image. + */ +public class GalleryImageReference { + /** + * The offer of the gallery image. + */ + @JsonProperty(value = "offer") + private String offer; + + /** + * The publisher of the gallery image. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * The SKU of the gallery image. + */ + @JsonProperty(value = "sku") + private String sku; + + /** + * The OS type of the gallery image. + */ + @JsonProperty(value = "osType") + private String osType; + + /** + * The version of the gallery image. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the offer of the gallery image. + * + * @return the offer value + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer of the gallery image. + * + * @param offer the offer value to set + * @return the GalleryImageReference object itself. + */ + public GalleryImageReference withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the publisher of the gallery image. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher of the gallery image. + * + * @param publisher the publisher value to set + * @return the GalleryImageReference object itself. + */ + public GalleryImageReference withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the SKU of the gallery image. + * + * @return the sku value + */ + public String sku() { + return this.sku; + } + + /** + * Set the SKU of the gallery image. + * + * @param sku the sku value to set + * @return the GalleryImageReference object itself. + */ + public GalleryImageReference withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the OS type of the gallery image. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set 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 of the gallery image. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the gallery image. + * + * @param version the version value to set + * @return the GalleryImageReference object itself. + */ + public GalleryImageReference withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReferenceFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReferenceFragment.java new file mode 100644 index 0000000000000..b05247ff7db6e --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImageReferenceFragment.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The reference information for an Azure Marketplace image. + */ +public class GalleryImageReferenceFragment { + /** + * The offer of the gallery image. + */ + @JsonProperty(value = "offer") + private String offer; + + /** + * The publisher of the gallery image. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * The SKU of the gallery image. + */ + @JsonProperty(value = "sku") + private String sku; + + /** + * The OS type of the gallery image. + */ + @JsonProperty(value = "osType") + private String osType; + + /** + * The version of the gallery image. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the offer of the gallery image. + * + * @return the offer value + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer of the gallery image. + * + * @param offer the offer value to set + * @return the GalleryImageReferenceFragment object itself. + */ + public GalleryImageReferenceFragment withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the publisher of the gallery image. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher of the gallery image. + * + * @param publisher the publisher value to set + * @return the GalleryImageReferenceFragment object itself. + */ + public GalleryImageReferenceFragment withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the SKU of the gallery image. + * + * @return the sku value + */ + public String sku() { + return this.sku; + } + + /** + * Set the SKU of the gallery image. + * + * @param sku the sku value to set + * @return the GalleryImageReferenceFragment object itself. + */ + public GalleryImageReferenceFragment withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the OS type of the gallery image. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set the OS type of the gallery image. + * + * @param osType the osType value to set + * @return the GalleryImageReferenceFragment object itself. + */ + public GalleryImageReferenceFragment withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the version of the gallery image. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the gallery image. + * + * @param version the version value to set + * @return the GalleryImageReferenceFragment object itself. + */ + public GalleryImageReferenceFragment withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImages.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImages.java new file mode 100644 index 0000000000000..f1073de8f43d5 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GalleryImages.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.GalleryImagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing GalleryImages. + */ +public interface GalleryImages extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String labAccountName, String galleryImageName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String labAccountName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String labAccountName, String galleryImageName); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetEnvironmentResponse.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetEnvironmentResponse.java new file mode 100644 index 0000000000000..4493ce42549d9 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetEnvironmentResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.GetEnvironmentResponseInner; + +/** + * Type representing GetEnvironmentResponse. + */ +public interface GetEnvironmentResponse extends HasInner, HasManager { + /** + * @return the environment value. + */ + EnvironmentDetails environment(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetPersonalPreferencesResponse.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetPersonalPreferencesResponse.java new file mode 100644 index 0000000000000..7593022665ebc --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetPersonalPreferencesResponse.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.GetPersonalPreferencesResponseInner; +import java.util.List; + +/** + * Type representing GetPersonalPreferencesResponse. + */ +public interface GetPersonalPreferencesResponse extends HasInner, HasManager { + /** + * @return the favoriteLabResourceIds value. + */ + List favoriteLabResourceIds(); + + /** + * @return the id value. + */ + String id(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetRegionalAvailabilityResponse.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetRegionalAvailabilityResponse.java new file mode 100644 index 0000000000000..4454e3617c06b --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GetRegionalAvailabilityResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.GetRegionalAvailabilityResponseInner; +import java.util.List; + +/** + * Type representing GetRegionalAvailabilityResponse. + */ +public interface GetRegionalAvailabilityResponse extends HasInner, HasManager { + /** + * @return the regionalAvailability value. + */ + List regionalAvailability(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GlobalUsers.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GlobalUsers.java new file mode 100644 index 0000000000000..63d165f5c259c --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/GlobalUsers.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import rx.Completable; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.GlobalUsersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing GlobalUsers. + */ +public interface GlobalUsers extends HasInner { + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEnvironmentAsync(String userName, String environmentId); + + /** + * Get batch operation status. + * + * @param userName The name of the user. + * @param urls The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getOperationBatchStatusAsync(String userName, List urls); + + /** + * Gets the status of long running operation. + * + * @param userName The name of the user. + * @param operationUrl The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getOperationStatusAsync(String userName, String operationUrl); + + /** + * 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 + * @return the observable for the request + */ + Observable getPersonalPreferencesAsync(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload); + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEnvironmentsAsync(String userName); + + /** + * List labs for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listLabsAsync(String userName); + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable registerAsync(String userName); + + /** + * 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 + * @return the observable for the request + */ + Completable resetPasswordAsync(String userName, ResetPasswordPayload resetPasswordPayload); + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startEnvironmentAsync(String userName, String environmentId); + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopEnvironmentAsync(String userName, String environmentId); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Lab.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Lab.java new file mode 100644 index 0000000000000..7d097a409b7e2 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Lab.java @@ -0,0 +1,324 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import java.util.Map; +import org.joda.time.Period; +import org.joda.time.DateTime; + +/** + * Type representing Lab. + */ +public interface Lab extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the createdByObjectId value. + */ + String createdByObjectId(); + + /** + * @return the createdByUserPrincipalName value. + */ + String createdByUserPrincipalName(); + + /** + * @return the createdDate value. + */ + DateTime createdDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the invitationCode value. + */ + String invitationCode(); + + /** + * @return the latestOperationResult value. + */ + LatestOperationResult latestOperationResult(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maxUsersInLab value. + */ + Integer maxUsersInLab(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * @return the usageQuota value. + */ + Period usageQuota(); + + /** + * @return the userAccessMode value. + */ + LabUserAccessMode userAccessMode(); + + /** + * @return the userQuota value. + */ + Integer userQuota(); + + /** + * The entirety of the Lab definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLabaccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of Lab definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Lab definition. + */ + interface Blank extends WithLabaccount { + } + + /** + * The stage of the lab definition allowing to specify Labaccount. + */ + interface WithLabaccount { + /** + * 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 lab definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the lab definition allowing to specify MaxUsersInLab. + */ + interface WithMaxUsersInLab { + /** + * Specifies maxUsersInLab. + * @param maxUsersInLab Maximum number of users allowed in the lab + * @return the next definition stage + */ + WithCreate withMaxUsersInLab(Integer maxUsersInLab); + } + + /** + * The stage of the lab definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the lab definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the lab definition allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next definition stage + */ + WithCreate withUniqueIdentifier(String uniqueIdentifier); + } + + /** + * The stage of the lab definition allowing to specify UsageQuota. + */ + interface WithUsageQuota { + /** + * Specifies usageQuota. + * @param usageQuota Maximum duration a user can use an environment for in the lab + * @return the next definition stage + */ + WithCreate withUsageQuota(Period usageQuota); + } + + /** + * The stage of the lab definition allowing to specify UserAccessMode. + */ + interface WithUserAccessMode { + /** + * Specifies userAccessMode. + * @param userAccessMode Lab user access mode (open to all vs. restricted to those listed on the lab). Possible values include: 'Restricted', 'Open' + * @return the next definition stage + */ + WithCreate withUserAccessMode(LabUserAccessMode userAccessMode); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithMaxUsersInLab, DefinitionStages.WithProvisioningState, DefinitionStages.WithTags, DefinitionStages.WithUniqueIdentifier, DefinitionStages.WithUsageQuota, DefinitionStages.WithUserAccessMode { + } + } + /** + * The template for a Lab update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithMaxUsersInLab, UpdateStages.WithProvisioningState, UpdateStages.WithTags, UpdateStages.WithUniqueIdentifier, UpdateStages.WithUsageQuota, UpdateStages.WithUserAccessMode { + } + + /** + * Grouping of Lab update stages. + */ + interface UpdateStages { + /** + * The stage of the lab update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the lab update allowing to specify MaxUsersInLab. + */ + interface WithMaxUsersInLab { + /** + * Specifies maxUsersInLab. + * @param maxUsersInLab Maximum number of users allowed in the lab + * @return the next update stage + */ + Update withMaxUsersInLab(Integer maxUsersInLab); + } + + /** + * The stage of the lab update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the lab update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the lab update allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next update stage + */ + Update withUniqueIdentifier(String uniqueIdentifier); + } + + /** + * The stage of the lab update allowing to specify UsageQuota. + */ + interface WithUsageQuota { + /** + * Specifies usageQuota. + * @param usageQuota Maximum duration a user can use an environment for in the lab + * @return the next update stage + */ + Update withUsageQuota(Period usageQuota); + } + + /** + * The stage of the lab update allowing to specify UserAccessMode. + */ + interface WithUserAccessMode { + /** + * Specifies userAccessMode. + * @param userAccessMode Lab user access mode (open to all vs. restricted to those listed on the lab). Possible values include: 'Restricted', 'Open' + * @return the next update stage + */ + Update withUserAccessMode(LabUserAccessMode userAccessMode); + } + + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccount.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccount.java new file mode 100644 index 0000000000000..6574f2fdeddc8 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccount.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabAccountInner; + +/** + * Type representing LabAccount. + */ +public interface LabAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the enabledRegionSelection value. + */ + Boolean enabledRegionSelection(); + + /** + * @return the latestOperationResult value. + */ + LatestOperationResult latestOperationResult(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the sizeConfiguration value. + */ + SizeConfigurationProperties sizeConfiguration(); + + /** + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * The entirety of the LabAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of LabAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LabAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the LabAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the labaccount definition allowing to specify EnabledRegionSelection. + */ + interface WithEnabledRegionSelection { + /** + * Specifies enabledRegionSelection. + * @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 provisioningState. + * @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 uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next definition stage + */ + WithCreate withUniqueIdentifier(String uniqueIdentifier); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithEnabledRegionSelection, DefinitionStages.WithProvisioningState, DefinitionStages.WithUniqueIdentifier { + } + } + /** + * The template for a LabAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEnabledRegionSelection, UpdateStages.WithProvisioningState, UpdateStages.WithUniqueIdentifier { + } + + /** + * Grouping of LabAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the labaccount update allowing to specify EnabledRegionSelection. + */ + interface WithEnabledRegionSelection { + /** + * Specifies enabledRegionSelection. + * @param enabledRegionSelection Represents if region selection is enabled + * @return the next update stage + */ + Update withEnabledRegionSelection(Boolean enabledRegionSelection); + } + + /** + * The stage of the labaccount update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the labaccount update allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next update stage + */ + Update withUniqueIdentifier(String uniqueIdentifier); + } + + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccountFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccountFragment.java new file mode 100644 index 0000000000000..e7a7dbe58314a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccountFragment.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents a lab account. + */ +@JsonFlatten +@SkipParentValidation +public class LabAccountFragment extends Resource { + /** + * 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 represents if region selection is enabled. + * + * @return the enabledRegionSelection value + */ + public Boolean enabledRegionSelection() { + return this.enabledRegionSelection; + } + + /** + * Set 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 provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccounts.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccounts.java new file mode 100644 index 0000000000000..0ddc3abc6c623 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabAccounts.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LabAccounts. + */ +public interface LabAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * 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 + * @return the observable for the request + */ + Completable createLabAsync(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties); + + /** + * 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 + * @return the observable for the request + */ + Observable getRegionalAvailabilityAsync(String resourceGroupName, String labAccountName); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabCreationParameters.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabCreationParameters.java new file mode 100644 index 0000000000000..436ec730a01ac --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabCreationParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings related to creating a lab. + */ +public class LabCreationParameters { + /** + * Maximum number of users allowed in the lab. + */ + @JsonProperty(value = "maxUsersInLab") + private Integer maxUsersInLab; + + /** + * Get maximum number of users allowed in the lab. + * + * @return the maxUsersInLab value + */ + public Integer maxUsersInLab() { + return this.maxUsersInLab; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabDetails.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabDetails.java new file mode 100644 index 0000000000000..508b7507544ff --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabDetails.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This represents the details about a lab that the User is in, and its state. + */ +public class LabDetails { + /** + * 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 Period usageQuota; + + /** + * Get name of the lab. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 provisioning state of the lab. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 of the lab. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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 maximum duration a user can use a VM in this lab. + * + * @return the usageQuota value + */ + public Period usageQuota() { + return this.usageQuota; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabFragment.java new file mode 100644 index 0000000000000..8c0d112fa8304 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabFragment.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents a lab. + */ +@JsonFlatten +@SkipParentValidation +public class LabFragment extends Resource { + /** + * 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 Period usageQuota; + + /** + * Lab user access mode (open to all vs. restricted to those listed on the + * lab). Possible values include: 'Restricted', 'Open'. + */ + @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 maximum number of users allowed in the lab. + * + * @return the maxUsersInLab value + */ + public Integer maxUsersInLab() { + return this.maxUsersInLab; + } + + /** + * Set 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 maximum duration a user can use an environment for in the lab. + * + * @return the usageQuota value + */ + public Period usageQuota() { + return this.usageQuota; + } + + /** + * Set 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(Period usageQuota) { + this.usageQuota = usageQuota; + return this; + } + + /** + * Get lab user access mode (open to all vs. restricted to those listed on the lab). Possible values include: 'Restricted', 'Open'. + * + * @return the userAccessMode value + */ + public LabUserAccessMode userAccessMode() { + return this.userAccessMode; + } + + /** + * Set lab user access mode (open to all vs. restricted to those listed on the lab). Possible values include: 'Restricted', 'Open'. + * + * @param userAccessMode the userAccessMode value to set + * @return the LabFragment object itself. + */ + public LabFragment withUserAccessMode(LabUserAccessMode userAccessMode) { + this.userAccessMode = userAccessMode; + return this; + } + + /** + * Get the provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabUserAccessMode.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabUserAccessMode.java new file mode 100644 index 0000000000000..d581431444690 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LabUserAccessMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Labs.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Labs.java new file mode 100644 index 0000000000000..c11754c6553fd --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Labs.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Labs. + */ +public interface Labs extends SupportsCreating, HasInner { + /** + * Add users 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 emailAddresses List of user emails addresses to add to the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable addUsersAsync(String resourceGroupName, String labAccountName, String labName, List emailAddresses); + + /** + * Register to managed 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 + * @return the observable for the request + */ + Completable registerAsync(String resourceGroupName, String labAccountName, String labName); + + /** + * Get 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String labAccountName, String labName); + + /** + * List labs 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String labAccountName); + + /** + * Delete lab. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String labAccountName, String labName); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LatestOperationResult.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LatestOperationResult.java new file mode 100644 index 0000000000000..c653f2e657f39 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/LatestOperationResult.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the status of an operation. + */ +public class LatestOperationResult { + /** + * 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 current status of the operation. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get error code on failure. + * + * @return the errorCode value + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the error message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get request URI of the operation. + * + * @return the requestUri value + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Get the HttpMethod - PUT/POST/DELETE for the operation. + * + * @return the httpMethod value + */ + public String httpMethod() { + return this.httpMethod; + } + + /** + * Get the URL to use to check long-running operation status. + * + * @return the operationUrl value + */ + public String operationUrl() { + return this.operationUrl; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsPayload.java new file mode 100644 index 0000000000000..ba973ae9c11b8 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsPayload.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the payload to list environments owned by a user. + */ +public class ListEnvironmentsPayload { + /** + * The resource Id of the lab. + */ + @JsonProperty(value = "labId") + private String labId; + + /** + * Get the resource Id of the lab. + * + * @return the labId value + */ + public String labId() { + return this.labId; + } + + /** + * Set the resource Id of the lab. + * + * @param labId the labId value to set + * @return the ListEnvironmentsPayload object itself. + */ + public ListEnvironmentsPayload withLabId(String labId) { + this.labId = labId; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsResponse.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsResponse.java new file mode 100644 index 0000000000000..4336008b761d9 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListEnvironmentsResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.ListEnvironmentsResponseInner; +import java.util.List; + +/** + * Type representing ListEnvironmentsResponse. + */ +public interface ListEnvironmentsResponse extends HasInner, HasManager { + /** + * @return the environments value. + */ + List environments(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListLabsResponse.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListLabsResponse.java new file mode 100644 index 0000000000000..8ea7245afbd8e --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ListLabsResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.ListLabsResponseInner; +import java.util.List; + +/** + * Type representing ListLabsResponse. + */ +public interface ListLabsResponse extends HasInner, HasManager { + /** + * @return the labs value. + */ + List labs(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ManagedLabVmSize.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ManagedLabVmSize.java new file mode 100644 index 0000000000000..e6ca5bad483b5 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ManagedLabVmSize.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/NetworkInterface.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/NetworkInterface.java new file mode 100644 index 0000000000000..5824e4f9f21f6 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/NetworkInterface.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network details of the environment. + */ +public class NetworkInterface { + /** + * 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 privateIp address of the Compute VM. + * + * @return the privateIpAddress value + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get connection information for Linux. + * + * @return the sshAuthority value + */ + public String sshAuthority() { + return this.sshAuthority; + } + + /** + * Get connection information for Windows. + * + * @return the rdpAuthority value + */ + public String rdpAuthority() { + return this.rdpAuthority; + } + + /** + * Get username of the VM. + * + * @return the username value + */ + public String username() { + return this.username; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusPayload.java new file mode 100644 index 0000000000000..4dd833f377ea4 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusPayload.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Payload to get the status of an operation. + */ +public class OperationBatchStatusPayload { + /** + * The operation url of long running operation. + */ + @JsonProperty(value = "urls", required = true) + private List urls; + + /** + * Get the operation url of long running operation. + * + * @return the urls value + */ + public List urls() { + return this.urls; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponse.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponse.java new file mode 100644 index 0000000000000..ef324c37ae427 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.OperationBatchStatusResponseInner; +import java.util.List; + +/** + * Type representing OperationBatchStatusResponse. + */ +public interface OperationBatchStatusResponse extends HasInner, HasManager { + /** + * @return the items value. + */ + List items(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponseItem.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponseItem.java new file mode 100644 index 0000000000000..8993d1588ba70 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationBatchStatusResponseItem.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the status of an operation that used the batch API. + */ +public class OperationBatchStatusResponseItem { + /** + * 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 status of the long running operation for an environment. + * + * @return the operationUrl value + */ + public String operationUrl() { + return this.operationUrl; + } + + /** + * Get status of the long running operation for an environment. + * + * @return the status value + */ + public String status() { + return this.status; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationError.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationError.java new file mode 100644 index 0000000000000..ba2d2e2a08bc7 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationError.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details for the operation in case of a failure. + */ +public class OperationError { + /** + * 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 error code of the operation error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set 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 error message of the operation error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadata.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadata.java new file mode 100644 index 0000000000000..0ed45b628c9ac --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadata.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.OperationMetadataInner; + +/** + * Type representing OperationMetadata. + */ +public interface OperationMetadata extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationMetadataDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadataDisplay.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadataDisplay.java new file mode 100644 index 0000000000000..4d1b3b203fca0 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationMetadataDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes the operations. + */ +public class OperationMetadataDisplay { + /** + * 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 friendly name of the resource provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set 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 resource type on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set 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 operation type: read, write, delete, listKeys/action, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set 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 friendly name of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationResult.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationResult.java new file mode 100644 index 0000000000000..92728454d3640 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.OperationResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; + +/** + * Type representing OperationResult. + */ +public interface OperationResult extends HasInner, HasManager { + /** + * @return the error value. + */ + OperationError error(); + + /** + * @return the status value. + */ + String status(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusPayload.java new file mode 100644 index 0000000000000..45113d94af0e8 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusPayload.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Payload to get the status of an operation. + */ +public class OperationStatusPayload { + /** + * The operation url of long running operation. + */ + @JsonProperty(value = "operationUrl", required = true) + private String operationUrl; + + /** + * Get the operation url of long running operation. + * + * @return the operationUrl value + */ + public String operationUrl() { + return this.operationUrl; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusResponse.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusResponse.java new file mode 100644 index 0000000000000..001967f49556a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/OperationStatusResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.OperationStatusResponseInner; + +/** + * Type representing OperationStatusResponse. + */ +public interface OperationStatusResponse extends HasInner, HasManager { + /** + * @return the status value. + */ + String status(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Operations.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Operations.java new file mode 100644 index 0000000000000..f25ca349d13d0 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Operations.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Get operation. + * + * @param locationName The name of the location. + * @param operationName The name of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String locationName, String operationName); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPerferencesOperationsPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPerferencesOperationsPayload.java new file mode 100644 index 0000000000000..1c2a7ff7bd196 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPerferencesOperationsPayload.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents payload for any Environment operations like get, start, stop, + * connect. + */ +public class PersonalPerferencesOperationsPayload { + /** + * Resource Id of the lab account. + */ + @JsonProperty(value = "labAccountResourceId") + private String labAccountResourceId; + + /** + * Enum indicating if user is adding or removing a favorite lab. Possible + * values include: 'Add', 'Remove'. + */ + @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 resource Id of the lab account. + * + * @return the labAccountResourceId value + */ + public String labAccountResourceId() { + return this.labAccountResourceId; + } + + /** + * Set resource Id of the lab account. + * + * @param labAccountResourceId the labAccountResourceId value to set + * @return the PersonalPerferencesOperationsPayload object itself. + */ + public PersonalPerferencesOperationsPayload withLabAccountResourceId(String labAccountResourceId) { + this.labAccountResourceId = labAccountResourceId; + return this; + } + + /** + * Get enum indicating if user is adding or removing a favorite lab. Possible values include: 'Add', 'Remove'. + * + * @return the addRemove value + */ + public AddRemove addRemove() { + return this.addRemove; + } + + /** + * Set enum indicating if user is adding or removing a favorite lab. Possible values include: 'Add', 'Remove'. + * + * @param addRemove the addRemove value to set + * @return the PersonalPerferencesOperationsPayload object itself. + */ + public PersonalPerferencesOperationsPayload withAddRemove(AddRemove addRemove) { + this.addRemove = addRemove; + return this; + } + + /** + * Get resource Id of the lab to add/remove from the favorites list. + * + * @return the labResourceId value + */ + public String labResourceId() { + return this.labResourceId; + } + + /** + * Set resource Id of the lab to add/remove from the favorites list. + * + * @param labResourceId the labResourceId value to set + * @return the PersonalPerferencesOperationsPayload object itself. + */ + public PersonalPerferencesOperationsPayload withLabResourceId(String labResourceId) { + this.labResourceId = labResourceId; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPreferencesOperationsPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPreferencesOperationsPayload.java new file mode 100644 index 0000000000000..ff67ac131ebba --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PersonalPreferencesOperationsPayload.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents payload for any Environment operations like get, start, stop, + * connect. + */ +public class PersonalPreferencesOperationsPayload { + /** + * Resource Id of the lab account. + */ + @JsonProperty(value = "labAccountResourceId") + private String labAccountResourceId; + + /** + * Enum indicating if user is adding or removing a favorite lab. Possible + * values include: 'Add', 'Remove'. + */ + @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 resource Id of the lab account. + * + * @return the labAccountResourceId value + */ + public String labAccountResourceId() { + return this.labAccountResourceId; + } + + /** + * Set 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 enum indicating if user is adding or removing a favorite lab. Possible values include: 'Add', 'Remove'. + * + * @return the addRemove value + */ + public AddRemove addRemove() { + return this.addRemove; + } + + /** + * Set enum indicating if user is adding or removing a favorite lab. Possible values include: 'Add', 'Remove'. + * + * @param addRemove the addRemove value to set + * @return the PersonalPreferencesOperationsPayload object itself. + */ + public PersonalPreferencesOperationsPayload withAddRemove(AddRemove addRemove) { + this.addRemove = addRemove; + return this; + } + + /** + * Get resource Id of the lab to add/remove from the favorites list. + * + * @return the labResourceId value + */ + public String labResourceId() { + return this.labResourceId; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ProviderOperations.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ProviderOperations.java new file mode 100644 index 0000000000000..b062abccdd715 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ProviderOperations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.ProviderOperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProviderOperations. + */ +public interface ProviderOperations extends HasInner { + /** + * Result of the request to list REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishPayload.java new file mode 100644 index 0000000000000..1bf9daa24a82e --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishPayload.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Payload for Publish operation on EnvironmentSetting. + */ +public class PublishPayload { + /** + * Whether to use existing VM custom image when publishing. + */ + @JsonProperty(value = "useExistingImage") + private Boolean useExistingImage; + + /** + * Get whether to use existing VM custom image when publishing. + * + * @return the useExistingImage value + */ + public Boolean useExistingImage() { + return this.useExistingImage; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishingState.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishingState.java new file mode 100644 index 0000000000000..757e44d9af3a9 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/PublishingState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVm.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVm.java new file mode 100644 index 0000000000000..a240f695c9fb5 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVm.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of a Reference Vm. + */ +public class ReferenceVm { + /** + * 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 of the virtual machine. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set 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 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 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 state details for the reference virtual machine. + * + * @return the vmStateDetails value + */ + public VmStateDetails vmStateDetails() { + return this.vmStateDetails; + } + + /** + * Get vM resource Id for the environment. + * + * @return the vmResourceId value + */ + public String vmResourceId() { + return this.vmResourceId; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmCreationParameters.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmCreationParameters.java new file mode 100644 index 0000000000000..96da8691f5b05 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmCreationParameters.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Creation parameters for Reference Vm. + */ +public class ReferenceVmCreationParameters { + /** + * The username of the virtual machine. + */ + @JsonProperty(value = "userName", required = true) + private String userName; + + /** + * The password of the virtual machine. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * Get the username of the virtual machine. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set the username of the virtual machine. + * + * @param userName the userName value to set + * @return the ReferenceVmCreationParameters object itself. + */ + public ReferenceVmCreationParameters withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get the password of the virtual machine. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password of the virtual machine. + * + * @param password the password value to set + * @return the ReferenceVmCreationParameters object itself. + */ + public ReferenceVmCreationParameters withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmFragment.java new file mode 100644 index 0000000000000..ad102c0d0d012 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ReferenceVmFragment.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of a Reference Vm. + */ +public class ReferenceVmFragment { + /** + * The username of the virtual machine. + */ + @JsonProperty(value = "userName") + 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; + + /** + * Get the username of the virtual machine. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set the username of the virtual machine. + * + * @param userName the userName value to set + * @return the ReferenceVmFragment object itself. + */ + public ReferenceVmFragment withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get 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 of the virtual machine. This will be set to null in GET resource API. + * + * @param password the password value to set + * @return the ReferenceVmFragment object itself. + */ + public ReferenceVmFragment withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegionalAvailability.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegionalAvailability.java new file mode 100644 index 0000000000000..507a69ec0add7 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegionalAvailability.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The availability information of sizes across regions. + */ +public class RegionalAvailability { + /** + * Corresponding region. + */ + @JsonProperty(value = "region") + private String region; + + /** + * List of all the size information for the region. + */ + @JsonProperty(value = "sizeAvailabilities") + private List sizeAvailabilities; + + /** + * Get corresponding region. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set 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 list of all the size information for the region. + * + * @return the sizeAvailabilities value + */ + public List sizeAvailabilities() { + return this.sizeAvailabilities; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegisterPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegisterPayload.java new file mode 100644 index 0000000000000..e25504df94b06 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/RegisterPayload.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents payload for Register action. + */ +public class RegisterPayload { + /** + * The registration code of the lab. + */ + @JsonProperty(value = "registrationCode") + private String registrationCode; + + /** + * Get the registration code of the lab. + * + * @return the registrationCode value + */ + public String registrationCode() { + return this.registrationCode; + } + + /** + * Set the registration code of the lab. + * + * @param registrationCode the registrationCode value to set + * @return the RegisterPayload object itself. + */ + public RegisterPayload withRegistrationCode(String registrationCode) { + this.registrationCode = registrationCode; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResetPasswordPayload.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResetPasswordPayload.java new file mode 100644 index 0000000000000..4572596cca29f --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResetPasswordPayload.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the payload for resetting passwords. + */ +public class ResetPasswordPayload { + /** + * 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 resourceId of the environment. + * + * @return the environmentId value + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set 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 for which the password will be reset. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set 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 to assign to the user specified in. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSet.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSet.java new file mode 100644 index 0000000000000..f9bf56a9cf14d --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSet.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a VM and the setting Id it was created for. + */ +public class ResourceSet { + /** + * VM resource Id for the environment. + */ + @JsonProperty(value = "vmResourceId") + private String vmResourceId; + + /** + * resourceSettingId for the environment. + */ + @JsonProperty(value = "resourceSettingId") + private String resourceSettingId; + + /** + * Get vM resource Id for the environment. + * + * @return the vmResourceId value + */ + public String vmResourceId() { + return this.vmResourceId; + } + + /** + * Set 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 resourceSettingId for the environment. + * + * @return the resourceSettingId value + */ + public String resourceSettingId() { + return this.resourceSettingId; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSetFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSetFragment.java new file mode 100644 index 0000000000000..74c603aa8560a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSetFragment.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a VM and the setting Id it was created for. + */ +public class ResourceSetFragment { + /** + * VM resource Id for the environment. + */ + @JsonProperty(value = "vmResourceId") + private String vmResourceId; + + /** + * resourceSettingId for the environment. + */ + @JsonProperty(value = "resourceSettingId") + private String resourceSettingId; + + /** + * Get vM resource Id for the environment. + * + * @return the vmResourceId value + */ + public String vmResourceId() { + return this.vmResourceId; + } + + /** + * Set 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 resourceSettingId for the environment. + * + * @return the resourceSettingId value + */ + public String resourceSettingId() { + return this.resourceSettingId; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingCreationParameters.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingCreationParameters.java new file mode 100644 index 0000000000000..f9345f0e365db --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingCreationParameters.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents resource specific settings. + */ +public class ResourceSettingCreationParameters { + /** + * 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. Possible values include: 'Basic', + * 'Standard', 'Performance'. + */ + @JsonProperty(value = "size") + private ManagedLabVmSize size; + + /** + * Creation parameters for Reference Vm. + */ + @JsonProperty(value = "referenceVmCreationParameters", required = true) + private ReferenceVmCreationParameters referenceVmCreationParameters; + + /** + * Get the location where the virtual machine will live. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set 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 of the resource setting. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 resource id of the gallery image used for creating the virtual machine. + * + * @return the galleryImageResourceId value + */ + public String galleryImageResourceId() { + return this.galleryImageResourceId; + } + + /** + * Set 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 of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @return the size value + */ + public ManagedLabVmSize size() { + return this.size; + } + + /** + * Set the size of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @param size the size value to set + * @return the ResourceSettingCreationParameters object itself. + */ + public ResourceSettingCreationParameters withSize(ManagedLabVmSize size) { + this.size = size; + return this; + } + + /** + * Get creation parameters for Reference Vm. + * + * @return the referenceVmCreationParameters value + */ + public ReferenceVmCreationParameters referenceVmCreationParameters() { + return this.referenceVmCreationParameters; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettings.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettings.java new file mode 100644 index 0000000000000..a932e9dd33643 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettings.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents resource specific settings. + */ +public class ResourceSettings { + /** + * 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. Possible values include: 'Basic', + * 'Standard', 'Performance'. + */ + @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 unique id of the resource setting. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get 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 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 name of the image used to created the environment setting. + * + * @return the imageName value + */ + public String imageName() { + return this.imageName; + } + + /** + * Get the size of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @return the size value + */ + public ManagedLabVmSize size() { + return this.size; + } + + /** + * Set the size of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @param size the size value to set + * @return the ResourceSettings object itself. + */ + public ResourceSettings withSize(ManagedLabVmSize size) { + this.size = size; + return this; + } + + /** + * Get the translated compute cores of the virtual machine. + * + * @return the cores value + */ + public Integer cores() { + return this.cores; + } + + /** + * Get details specific to Reference Vm. + * + * @return the referenceVm value + */ + public ReferenceVm referenceVm() { + return this.referenceVm; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingsFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingsFragment.java new file mode 100644 index 0000000000000..2c11ef07a7446 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/ResourceSettingsFragment.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents resource specific settings. + */ +public class ResourceSettingsFragment { + /** + * 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. Possible values include: 'Basic', + * 'Standard', 'Performance'. + */ + @JsonProperty(value = "size") + private ManagedLabVmSize size; + + /** + * Details specific to Reference Vm. + */ + @JsonProperty(value = "referenceVm") + private ReferenceVmFragment referenceVm; + + /** + * Get 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 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 of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @return the size value + */ + public ManagedLabVmSize size() { + return this.size; + } + + /** + * Set the size of the virtual machine. Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @param size the size value to set + * @return the ResourceSettingsFragment object itself. + */ + public ResourceSettingsFragment withSize(ManagedLabVmSize size) { + this.size = size; + return this; + } + + /** + * Get details specific to Reference Vm. + * + * @return the referenceVm value + */ + public ReferenceVmFragment referenceVm() { + return this.referenceVm; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeAvailability.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeAvailability.java new file mode 100644 index 0000000000000..6363c7ac34dc7 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeAvailability.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the size information. + */ +public class SizeAvailability { + /** + * The category of the size (Basic, Standard, Performance). Possible values + * include: '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 category of the size (Basic, Standard, Performance). Possible values include: 'Basic', 'Standard', 'Performance'. + * + * @return the sizeCategory value + */ + public ManagedLabVmSize sizeCategory() { + return this.sizeCategory; + } + + /** + * Set the category of the size (Basic, Standard, Performance). Possible values include: '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 whether or not this size category is available. + * + * @return the isAvailable value + */ + public Boolean isAvailable() { + return this.isAvailable; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationProperties.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationProperties.java new file mode 100644 index 0000000000000..e3340122dfaa1 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationProperties.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the size configuration under the lab account. + */ +public class SizeConfigurationProperties { + /** + * Represents a list of size categories supported by this Lab Account + * (Small, Medium, Large). + */ + @JsonProperty(value = "environmentSizes") + private List environmentSizes; + + /** + * Get 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 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationPropertiesFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationPropertiesFragment.java new file mode 100644 index 0000000000000..46407000d8bb6 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeConfigurationPropertiesFragment.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the size configuration under the lab account. + */ +public class SizeConfigurationPropertiesFragment { + /** + * Represents a list of size categories supported by this Lab Account + * (Small, Medium, Large). + */ + @JsonProperty(value = "environmentSizes") + private List environmentSizes; + + /** + * Get 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 represents a list of size categories supported by this Lab Account (Small, Medium, Large). + * + * @param environmentSizes the environmentSizes value to set + * @return the SizeConfigurationPropertiesFragment object itself. + */ + public SizeConfigurationPropertiesFragment withEnvironmentSizes(List environmentSizes) { + this.environmentSizes = environmentSizes; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfo.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfo.java new file mode 100644 index 0000000000000..055cfe391d3dd --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfo.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains detailed information about a size. + */ +public class SizeInfo { + /** + * 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 represents the actual compute size, e.g. Standard_A2_v2. + * + * @return the computeSize value + */ + public String computeSize() { + return this.computeSize; + } + + /** + * Set 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 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 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 number of cores a VM of this size has. + * + * @return the numberOfCores value + */ + public Integer numberOfCores() { + return this.numberOfCores; + } + + /** + * Set 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 amount of memory available (in GB). + * + * @return the memory value + */ + public Double memory() { + return this.memory; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfoFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfoFragment.java new file mode 100644 index 0000000000000..b5fba2f8c33a5 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/SizeInfoFragment.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains detailed information about a size. + */ +public class SizeInfoFragment { + /** + * 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 represents the actual compute size, e.g. Standard_A2_v2. + * + * @return the computeSize value + */ + public String computeSize() { + return this.computeSize; + } + + /** + * Set 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 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 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 number of cores a VM of this size has. + * + * @return the numberOfCores value + */ + public Integer numberOfCores() { + return this.numberOfCores; + } + + /** + * Set 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 amount of memory available (in GB). + * + * @return the memory value + */ + public Double memory() { + return this.memory; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/User.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/User.java new file mode 100644 index 0000000000000..f38eae33f429a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/User.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.UserInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.LabServicesManager; +import java.util.Map; +import org.joda.time.Period; + +/** + * Type representing User. + */ +public interface User extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the email value. + */ + String email(); + + /** + * @return the familyName value. + */ + String familyName(); + + /** + * @return the givenName value. + */ + String givenName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the latestOperationResult value. + */ + LatestOperationResult latestOperationResult(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tenantId value. + */ + String tenantId(); + + /** + * @return the totalUsage value. + */ + Period totalUsage(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueIdentifier value. + */ + String uniqueIdentifier(); + + /** + * The entirety of the User definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLab, DefinitionStages.WithCreate { + } + + /** + * Grouping of User definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a User definition. + */ + interface Blank extends WithLab { + } + + /** + * The stage of the user definition allowing to specify Lab. + */ + interface WithLab { + /** + * 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 user definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the user definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + + /** + * The stage of the user definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the user definition allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next definition stage + */ + WithCreate withUniqueIdentifier(String uniqueIdentifier); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithProvisioningState, DefinitionStages.WithTags, DefinitionStages.WithUniqueIdentifier { + } + } + /** + * The template for a User update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithProvisioningState, UpdateStages.WithTags, UpdateStages.WithUniqueIdentifier { + } + + /** + * Grouping of User update stages. + */ + interface UpdateStages { + /** + * The stage of the user update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the user update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning status of the resource + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + + /** + * The stage of the user update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the user update allowing to specify UniqueIdentifier. + */ + interface WithUniqueIdentifier { + /** + * Specifies uniqueIdentifier. + * @param uniqueIdentifier The unique immutable identifier of a resource (Guid) + * @return the next update stage + */ + Update withUniqueIdentifier(String uniqueIdentifier); + } + + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/UserFragment.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/UserFragment.java new file mode 100644 index 0000000000000..7cf7a5f854701 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/UserFragment.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The User registered to a lab. + */ +@JsonFlatten +@SkipParentValidation +public class UserFragment extends Resource { + /** + * 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 provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Users.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Users.java new file mode 100644 index 0000000000000..a7fa4ae962384 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/Users.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.implementation.UsersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Users. + */ +public interface Users extends SupportsCreating, HasInner { + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String labAccountName, String labName, String userName); + + /** + * List users 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String labAccountName, final String labName); + + /** + * Delete user. 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 userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String labAccountName, String labName, String userName); + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VirtualMachineDetails.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VirtualMachineDetails.java new file mode 100644 index 0000000000000..a0a266997bd83 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VirtualMachineDetails.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the backing virtual machine. + */ +public class VirtualMachineDetails { + /** + * 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 provisioning state of the Dtl VM. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get connection information for Windows. + * + * @return the rdpAuthority value + */ + public String rdpAuthority() { + return this.rdpAuthority; + } + + /** + * Get connection information for Linux. + * + * @return the sshAuthority value + */ + public String sshAuthority() { + return this.sshAuthority; + } + + /** + * Get privateIp address of the compute VM. + * + * @return the privateIpAddress value + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get compute VM login user name. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Get last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value + */ + public String lastKnownPowerState() { + return this.lastKnownPowerState; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VmStateDetails.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VmStateDetails.java new file mode 100644 index 0000000000000..94d31c19c7976 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/VmStateDetails.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about the state of the reference virtual machine. + */ +public class VmStateDetails { + /** + * 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 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 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 power state of the reference virtual machine. + * + * @return the powerState value + */ + public String powerState() { + return this.powerState; + } + + /** + * Get last known compute power state captured in DTL. + * + * @return the lastKnownPowerState value + */ + public String lastKnownPowerState() { + return this.lastKnownPowerState; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentImpl.java new file mode 100644 index 0000000000000..1f03567f30c4a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentImpl.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.Environment; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentFragment; +import java.util.Map; +import com.microsoft.azure.management.labservices.v2018_10_15.ResourceSet; +import com.microsoft.azure.management.labservices.v2018_10_15.NetworkInterface; +import org.joda.time.Period; +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.microsoft.azure.management.labservices.v2018_10_15.ResourceSetFragment; +import rx.functions.Func1; + +class EnvironmentImpl extends CreatableUpdatableImpl implements Environment, Environment.Definition, Environment.Update { + private final LabServicesManager manager; + private String resourceGroupName; + private String labAccountName; + private String labName; + private String environmentSettingName; + private String environmentName; + private EnvironmentFragment updateParameter; + + EnvironmentImpl(String name, LabServicesManager manager) { + super(name, new EnvironmentInner()); + this.manager = manager; + // Set resource name + this.environmentName = name; + // + this.updateParameter = new EnvironmentFragment(); + } + + EnvironmentImpl(EnvironmentInner inner, LabServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.environmentName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.labAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "labaccounts"); + this.labName = IdParsingUtils.getValueFromIdByName(inner.id(), "labs"); + this.environmentSettingName = IdParsingUtils.getValueFromIdByName(inner.id(), "environmentsettings"); + this.environmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "environments"); + // + this.updateParameter = new EnvironmentFragment(); + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EnvironmentsInner client = this.manager().inner().environments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.environmentSettingName, this.environmentName, this.inner()) + .map(new Func1() { + @Override + public EnvironmentInner call(EnvironmentInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EnvironmentsInner client = this.manager().inner().environments(); + return client.updateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.environmentSettingName, this.environmentName, this.updateParameter) + .map(new Func1() { + @Override + public EnvironmentInner call(EnvironmentInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EnvironmentsInner client = this.manager().inner().environments(); + return client.getAsync(this.resourceGroupName, this.labAccountName, this.labName, this.environmentSettingName, this.environmentName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new EnvironmentFragment(); + } + + @Override + public String claimedByUserName() { + return this.inner().claimedByUserName(); + } + + @Override + public String claimedByUserObjectId() { + return this.inner().claimedByUserObjectId(); + } + + @Override + public String claimedByUserPrincipalId() { + return this.inner().claimedByUserPrincipalId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isClaimed() { + return this.inner().isClaimed(); + } + + @Override + public String lastKnownPowerState() { + return this.inner().lastKnownPowerState(); + } + + @Override + public LatestOperationResult latestOperationResult() { + return this.inner().latestOperationResult(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkInterface networkInterface() { + return this.inner().networkInterface(); + } + + @Override + public DateTime passwordLastReset() { + return this.inner().passwordLastReset(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ResourceSet resourceSets() { + return this.inner().resourceSets(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Period totalUsage() { + return this.inner().totalUsage(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String uniqueIdentifier() { + return this.inner().uniqueIdentifier(); + } + + @Override + 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; + } + + @Override + public EnvironmentImpl withResourceSets(ResourceSet resourceSets) { + this.inner().withResourceSets(resourceSets); + return this; + } + + @Override + public EnvironmentImpl withResourceSets(ResourceSetFragment resourceSets) { + this.updateParameter.withResourceSets(resourceSets); + return this; + } + + @Override + public EnvironmentImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public EnvironmentImpl withProvisioningState(String provisioningState) { + if (isInCreateMode()) { + this.inner().withProvisioningState(provisioningState); + } else { + this.updateParameter.withProvisioningState(provisioningState); + } + return this; + } + + @Override + public EnvironmentImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public EnvironmentImpl withUniqueIdentifier(String uniqueIdentifier) { + if (isInCreateMode()) { + this.inner().withUniqueIdentifier(uniqueIdentifier); + } else { + this.updateParameter.withUniqueIdentifier(uniqueIdentifier); + } + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentInner.java new file mode 100644 index 0000000000000..f7c5bb2013e5b --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentInner.java @@ -0,0 +1,240 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.ResourceSet; +import com.microsoft.azure.management.labservices.v2018_10_15.NetworkInterface; +import org.joda.time.Period; +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents an environment instance. + */ +@JsonFlatten +@SkipParentValidation +public class EnvironmentInner extends Resource { + /** + * 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 Period totalUsage; + + /** + * When the password was last reset on the environment. + */ + @JsonProperty(value = "properties.passwordLastReset", access = JsonProperty.Access.WRITE_ONLY) + private DateTime 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 set of a VM and the setting id it was created for. + * + * @return the resourceSets value + */ + public ResourceSet resourceSets() { + return this.resourceSets; + } + + /** + * Set 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 AAD object Id of the user who has claimed the environment. + * + * @return the claimedByUserObjectId value + */ + public String claimedByUserObjectId() { + return this.claimedByUserObjectId; + } + + /** + * Get the user principal Id of the user who has claimed the environment. + * + * @return the claimedByUserPrincipalId value + */ + public String claimedByUserPrincipalId() { + return this.claimedByUserPrincipalId; + } + + /** + * Get the name or email address of the user who has claimed the environment. + * + * @return the claimedByUserName value + */ + public String claimedByUserName() { + return this.claimedByUserName; + } + + /** + * Get is the environment claimed or not. + * + * @return the isClaimed value + */ + public Boolean isClaimed() { + return this.isClaimed; + } + + /** + * Get last known power state of the environment. + * + * @return the lastKnownPowerState value + */ + public String lastKnownPowerState() { + return this.lastKnownPowerState; + } + + /** + * Get network details of the environment. + * + * @return the networkInterface value + */ + public NetworkInterface networkInterface() { + return this.networkInterface; + } + + /** + * Get how long the environment has been used by a lab user. + * + * @return the totalUsage value + */ + public Period totalUsage() { + return this.totalUsage; + } + + /** + * Get when the password was last reset on the environment. + * + * @return the passwordLastReset value + */ + public DateTime passwordLastReset() { + return this.passwordLastReset; + } + + /** + * Get the provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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 details of the latest operation. ex: status, error. + * + * @return the latestOperationResult value + */ + public LatestOperationResult latestOperationResult() { + return this.latestOperationResult; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingImpl.java new file mode 100644 index 0000000000000..e6f8d4f91df4c --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingImpl.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSetting; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettingFragment; +import java.util.Map; +import com.microsoft.azure.management.labservices.v2018_10_15.PublishingState; +import com.microsoft.azure.management.labservices.v2018_10_15.ConfigurationState; +import com.microsoft.azure.management.labservices.v2018_10_15.ResourceSettings; +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.microsoft.azure.management.labservices.v2018_10_15.ResourceSettingsFragment; +import rx.functions.Func1; + +class EnvironmentSettingImpl extends CreatableUpdatableImpl implements EnvironmentSetting, EnvironmentSetting.Definition, EnvironmentSetting.Update { + private final LabServicesManager manager; + private String resourceGroupName; + private String labAccountName; + private String labName; + private String environmentSettingName; + private EnvironmentSettingFragment updateParameter; + + EnvironmentSettingImpl(String name, LabServicesManager manager) { + super(name, new EnvironmentSettingInner()); + this.manager = manager; + // Set resource name + this.environmentSettingName = name; + // + this.updateParameter = new EnvironmentSettingFragment(); + } + + EnvironmentSettingImpl(EnvironmentSettingInner inner, LabServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.environmentSettingName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.labAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "labaccounts"); + this.labName = IdParsingUtils.getValueFromIdByName(inner.id(), "labs"); + this.environmentSettingName = IdParsingUtils.getValueFromIdByName(inner.id(), "environmentsettings"); + // + this.updateParameter = new EnvironmentSettingFragment(); + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EnvironmentSettingsInner client = this.manager().inner().environmentSettings(); + return client.createOrUpdateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.environmentSettingName, this.inner()) + .map(new Func1() { + @Override + public EnvironmentSettingInner call(EnvironmentSettingInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EnvironmentSettingsInner client = this.manager().inner().environmentSettings(); + return client.updateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.environmentSettingName, this.updateParameter) + .map(new Func1() { + @Override + public EnvironmentSettingInner call(EnvironmentSettingInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EnvironmentSettingsInner client = this.manager().inner().environmentSettings(); + return client.getAsync(this.resourceGroupName, this.labAccountName, this.labName, this.environmentSettingName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new EnvironmentSettingFragment(); + } + + @Override + public ConfigurationState configurationState() { + return this.inner().configurationState(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastChanged() { + return this.inner().lastChanged(); + } + + @Override + public DateTime lastPublished() { + return this.inner().lastPublished(); + } + + @Override + public LatestOperationResult latestOperationResult() { + return this.inner().latestOperationResult(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublishingState publishingState() { + return this.inner().publishingState(); + } + + @Override + public ResourceSettings resourceSettings() { + return this.inner().resourceSettings(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String title() { + return this.inner().title(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String uniqueIdentifier() { + return this.inner().uniqueIdentifier(); + } + + @Override + public EnvironmentSettingImpl withExistingLab(String resourceGroupName, String labAccountName, String labName) { + this.resourceGroupName = resourceGroupName; + this.labAccountName = labAccountName; + this.labName = labName; + return this; + } + + @Override + public EnvironmentSettingImpl withResourceSettings(ResourceSettings resourceSettings) { + this.inner().withResourceSettings(resourceSettings); + return this; + } + + @Override + public EnvironmentSettingImpl withResourceSettings(ResourceSettingsFragment resourceSettings) { + this.updateParameter.withResourceSettings(resourceSettings); + return this; + } + + @Override + public EnvironmentSettingImpl withConfigurationState(ConfigurationState configurationState) { + if (isInCreateMode()) { + this.inner().withConfigurationState(configurationState); + } else { + this.updateParameter.withConfigurationState(configurationState); + } + return this; + } + + @Override + public EnvironmentSettingImpl withDescription(String description) { + if (isInCreateMode()) { + this.inner().withDescription(description); + } else { + this.updateParameter.withDescription(description); + } + return this; + } + + @Override + public EnvironmentSettingImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public EnvironmentSettingImpl withProvisioningState(String provisioningState) { + if (isInCreateMode()) { + this.inner().withProvisioningState(provisioningState); + } else { + this.updateParameter.withProvisioningState(provisioningState); + } + return this; + } + + @Override + public EnvironmentSettingImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public EnvironmentSettingImpl withTitle(String title) { + if (isInCreateMode()) { + this.inner().withTitle(title); + } else { + this.updateParameter.withTitle(title); + } + return this; + } + + @Override + public EnvironmentSettingImpl withUniqueIdentifier(String uniqueIdentifier) { + if (isInCreateMode()) { + this.inner().withUniqueIdentifier(uniqueIdentifier); + } else { + this.updateParameter.withUniqueIdentifier(uniqueIdentifier); + } + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingInner.java new file mode 100644 index 0000000000000..2534d09135c2a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingInner.java @@ -0,0 +1,246 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.PublishingState; +import com.microsoft.azure.management.labservices.v2018_10_15.ConfigurationState; +import com.microsoft.azure.management.labservices.v2018_10_15.ResourceSettings; +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents settings of an environment, from which environment instances + * would be created. + */ +@JsonFlatten +@SkipParentValidation +public class EnvironmentSettingInner extends Resource { + /** + * Describes the readiness of this environment setting. Possible values + * include: 'Draft', 'Publishing', 'Published', 'PublishFailed', 'Scaling'. + */ + @JsonProperty(value = "properties.publishingState", access = JsonProperty.Access.WRITE_ONLY) + private PublishingState publishingState; + + /** + * Describes the user's progress in configuring their environment setting. + * Possible values include: 'NotApplicable', 'Completed'. + */ + @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", required = true) + private ResourceSettings resourceSettings; + + /** + * Time when the template VM was last changed. + */ + @JsonProperty(value = "properties.lastChanged", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastChanged; + + /** + * Time when the template VM was last sent for publishing. + */ + @JsonProperty(value = "properties.lastPublished", access = JsonProperty.Access.WRITE_ONLY) + private DateTime 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 describes the readiness of this environment setting. Possible values include: 'Draft', 'Publishing', 'Published', 'PublishFailed', 'Scaling'. + * + * @return the publishingState value + */ + public PublishingState publishingState() { + return this.publishingState; + } + + /** + * Get describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed'. + * + * @return the configurationState value + */ + public ConfigurationState configurationState() { + return this.configurationState; + } + + /** + * Set describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed'. + * + * @param configurationState the configurationState value to set + * @return the EnvironmentSettingInner object itself. + */ + public EnvironmentSettingInner withConfigurationState(ConfigurationState configurationState) { + this.configurationState = configurationState; + return this; + } + + /** + * Get describes the environment and its resource settings. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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 brief title describing the environment and its resource settings. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Set 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 resource specific settings. + * + * @return the resourceSettings value + */ + public ResourceSettings resourceSettings() { + return this.resourceSettings; + } + + /** + * Set 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 time when the template VM was last changed. + * + * @return the lastChanged value + */ + public DateTime lastChanged() { + return this.lastChanged; + } + + /** + * Get time when the template VM was last sent for publishing. + * + * @return the lastPublished value + */ + public DateTime lastPublished() { + return this.lastPublished; + } + + /** + * Get the provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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 details of the latest operation. ex: status, error. + * + * @return the latestOperationResult value + */ + public LatestOperationResult latestOperationResult() { + return this.latestOperationResult; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsImpl.java new file mode 100644 index 0000000000000..7636dcc7d6c7c --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsImpl.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSetting; + +class EnvironmentSettingsImpl extends WrapperImpl implements EnvironmentSettings { + private final LabServicesManager manager; + + EnvironmentSettingsImpl(LabServicesManager manager) { + super(manager.inner().environmentSettings()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + @Override + public EnvironmentSettingImpl define(String name) { + return wrapModel(name); + } + + private EnvironmentSettingImpl wrapModel(EnvironmentSettingInner inner) { + return new EnvironmentSettingImpl(inner, manager()); + } + + private EnvironmentSettingImpl wrapModel(String name) { + return new EnvironmentSettingImpl(name, this.manager()); + } + + @Override + public Completable claimAnyAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + EnvironmentSettingsInner client = this.inner(); + return client.claimAnyAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toCompletable(); + } + + @Override + public Completable publishAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + EnvironmentSettingsInner client = this.inner(); + return client.publishAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + EnvironmentSettingsInner client = this.inner(); + return client.startAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + EnvironmentSettingsInner client = this.inner(); + return client.stopAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String labAccountName, final String labName) { + EnvironmentSettingsInner client = this.inner(); + return client.listAsync(resourceGroupName, labAccountName, labName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EnvironmentSetting call(EnvironmentSettingInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + EnvironmentSettingsInner client = this.inner(); + return client.getAsync(resourceGroupName, labAccountName, labName, environmentSettingName) + .map(new Func1() { + @Override + public EnvironmentSetting call(EnvironmentSettingInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + EnvironmentSettingsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toCompletable(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java new file mode 100644 index 0000000000000..2c0ec8867a833 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java @@ -0,0 +1,1867 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettingFragment; +import com.microsoft.azure.management.labservices.v2018_10_15.PublishPayload; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in EnvironmentSettings. + */ +public class EnvironmentSettingsInner { + /** The Retrofit service to perform REST calls. */ + private EnvironmentSettingsService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of EnvironmentSettingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EnvironmentSettingsInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(EnvironmentSettingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for EnvironmentSettings to be + * used by Retrofit to perform actually REST calls. + */ + interface EnvironmentSettingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Query("$expand") String expand, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Body EnvironmentSettingInner environmentSetting, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Body EnvironmentSettingInner environmentSetting, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Body EnvironmentSettingFragment environmentSetting, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings claimAny" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/claimAny") + Observable> claimAny(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings publish" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/publish") + Observable> publish(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PublishPayload publishPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EnvironmentSettingInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String labName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, labName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, labName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentSettingInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String labName) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, labName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentSettingInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String labName) { + return listSinglePageAsync(resourceGroupName, labAccountName, labName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 + * @return the PagedList<EnvironmentSettingInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String labName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EnvironmentSettingInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentSettingInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentSettingInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List environment setting in a given lab. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param labAccountName The name of the lab Account. + ServiceResponse> * @param labName The name of the lab. + ServiceResponse> * @param expand Specify the $expand query. Example: 'properties($select=publishingState)' + ServiceResponse> * @param filter The filter to apply to the operation. + ServiceResponse> * @param top The maximum number of resources to return from the operation. + ServiceResponse> * @param orderby The ordering expression for the results, using OData notation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EnvironmentSettingInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentSettingInner object if successful. + */ + public EnvironmentSettingInner get(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, EnvironmentSettingInner>() { + @Override + public EnvironmentSettingInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentSettingInner object if successful. + */ + public EnvironmentSettingInner get(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand).map(new Func1, EnvironmentSettingInner>() { + @Override + public EnvironmentSettingInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentSettingInner object if successful. + */ + public EnvironmentSettingInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting).map(new Func1, EnvironmentSettingInner>() { + @Override + public EnvironmentSettingInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentSetting == null) { + throw new IllegalArgumentException("Parameter environmentSetting is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(environmentSetting); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentSettingInner object if successful. + */ + public EnvironmentSettingInner beginCreateOrUpdate(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting).map(new Func1, EnvironmentSettingInner>() { + @Override + public EnvironmentSettingInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingInner environmentSetting) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentSetting == null) { + throw new IllegalArgumentException("Parameter environmentSetting is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(environmentSetting); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentSettingInner object if successful. + */ + public EnvironmentSettingInner update(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingFragment environmentSetting) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingFragment environmentSetting, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable updateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingFragment environmentSetting) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting).map(new Func1, EnvironmentSettingInner>() { + @Override + public EnvironmentSettingInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentSettingInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingFragment environmentSetting) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentSetting == null) { + throw new IllegalArgumentException("Parameter environmentSetting is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(environmentSetting); + return service.update(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void claimAny(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + claimAnyWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture claimAnyAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(claimAnyWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable claimAnyAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return claimAnyWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> claimAnyWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.claimAny(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = claimAnyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse claimAnyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void publish(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + publishWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture publishAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(publishWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable publishAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return publishWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> publishWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean useExistingImage = null; + PublishPayload publishPayload = new PublishPayload(); + publishPayload.withUseExistingImage(null); + return service.publish(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), publishPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = publishDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 useExistingImage Whether to use existing VM custom image when publishing. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void publish(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, Boolean useExistingImage) { + publishWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, useExistingImage).toBlocking().single().body(); + } + + /** + * 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 useExistingImage Whether to use existing VM custom image when publishing. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture publishAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, Boolean useExistingImage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(publishWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, useExistingImage), serviceCallback); + } + + /** + * 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 useExistingImage Whether to use existing VM custom image when publishing. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable publishAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, Boolean useExistingImage) { + return publishWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, useExistingImage).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 useExistingImage Whether to use existing VM custom image when publishing. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> publishWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, Boolean useExistingImage) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + PublishPayload publishPayload = new PublishPayload(); + publishPayload.withUseExistingImage(useExistingImage); + return service.publish(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), publishPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = publishDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse publishDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + startWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return startWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + stopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return stopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + return beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List environment setting in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EnvironmentSettingInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List environment setting in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List environment setting in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EnvironmentSettingInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List environment setting in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EnvironmentSettingInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List environment setting in a given lab. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EnvironmentSettingInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsImpl.java new file mode 100644 index 0000000000000..d840819cee437 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.Environments; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.labservices.v2018_10_15.ResetPasswordPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.Environment; + +class EnvironmentsImpl extends WrapperImpl implements Environments { + private final LabServicesManager manager; + + EnvironmentsImpl(LabServicesManager manager) { + super(manager.inner().environments()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + @Override + public EnvironmentImpl define(String name) { + return wrapModel(name); + } + + private EnvironmentImpl wrapModel(EnvironmentInner inner) { + return new EnvironmentImpl(inner, manager()); + } + + private EnvironmentImpl wrapModel(String name) { + return new EnvironmentImpl(name, this.manager()); + } + + @Override + public Completable claimAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + EnvironmentsInner client = this.inner(); + return client.claimAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toCompletable(); + } + + @Override + public Completable resetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) { + EnvironmentsInner client = this.inner(); + return client.resetPasswordAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + EnvironmentsInner client = this.inner(); + return client.startAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + EnvironmentsInner client = this.inner(); + return client.stopAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName) { + EnvironmentsInner client = this.inner(); + return client.listAsync(resourceGroupName, labAccountName, labName, environmentSettingName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Environment call(EnvironmentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + EnvironmentsInner client = this.inner(); + return client.getAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName) + .map(new Func1() { + @Override + public Environment call(EnvironmentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + EnvironmentsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toCompletable(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java new file mode 100644 index 0000000000000..d8b1076e18293 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java @@ -0,0 +1,1881 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentFragment; +import com.microsoft.azure.management.labservices.v2018_10_15.ResetPasswordPayload; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Environments. + */ +public class EnvironmentsInner { + /** The Retrofit service to perform REST calls. */ + private EnvironmentsService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of EnvironmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EnvironmentsInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(EnvironmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Environments to be + * used by Retrofit to perform actually REST calls. + */ + interface EnvironmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Query("$expand") String expand, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Body EnvironmentInner environment, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Body EnvironmentFragment environment, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments claim" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/claim") + Observable> claim(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments resetPassword" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword") + Observable> resetPassword(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Body ResetPasswordPayload resetPasswordPayload, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments beginResetPassword" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword") + Observable> beginResetPassword(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Body ResetPasswordPayload resetPasswordPayload, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("environmentSettingName") String environmentSettingName, @Path("environmentName") String environmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Environments listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EnvironmentInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, labName, environmentSettingName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, labName, environmentSettingName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName) { + return listSinglePageAsync(resourceGroupName, labAccountName, labName, environmentSettingName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 + * @return the PagedList<EnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EnvironmentInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName, final String expand, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName, final String expand, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName, final String expand, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<EnvironmentInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName, final String expand, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List environments in a given environment setting. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param labAccountName The name of the lab Account. + ServiceResponse> * @param labName The name of the lab. + ServiceResponse> * @param environmentSettingName The name of the environment Setting. + ServiceResponse> * @param expand Specify the $expand query. Example: 'properties($expand=networkInterface)' + ServiceResponse> * @param filter The filter to apply to the operation. + ServiceResponse> * @param top The maximum number of resources to return from the operation. + ServiceResponse> * @param orderby The ordering expression for the results, using OData notation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String labName, final String environmentSettingName, final String expand, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentInner object if successful. + */ + public EnvironmentInner get(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, EnvironmentInner>() { + @Override + public EnvironmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentInner object if successful. + */ + public EnvironmentInner get(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, expand).map(new Func1, EnvironmentInner>() { + @Override + public EnvironmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentInner object if successful. + */ + public EnvironmentInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentInner environment) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentInner environment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentInner environment) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment).map(new Func1, EnvironmentInner>() { + @Override + public EnvironmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentInner environment) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (environment == null) { + throw new IllegalArgumentException("Parameter environment is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(environment); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EnvironmentInner object if successful. + */ + public EnvironmentInner update(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentFragment environment) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentFragment environment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment), serviceCallback); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable updateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentFragment environment) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment).map(new Func1, EnvironmentInner>() { + @Override + public EnvironmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the EnvironmentInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentFragment environment) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (environment == null) { + throw new IllegalArgumentException("Parameter environment is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(environment); + return service.update(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, environment, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void claim(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + claimWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture claimAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(claimWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable claimAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return claimWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> claimWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.claim(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = claimDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse claimDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetPassword(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) { + resetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable resetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) { + return resetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> resetPasswordWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (resetPasswordPayload == null) { + throw new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(resetPasswordPayload); + Observable> observable = service.resetPassword(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResetPassword(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) { + beginResetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetPasswordAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) { + return beginResetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetPasswordWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (resetPasswordPayload == null) { + throw new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(resetPasswordPayload); + return service.beginResetPassword(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, resetPasswordPayload, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetPasswordDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetPasswordDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + startWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return startWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return beginStartWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + stopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return stopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + return beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (environmentSettingName == null) { + throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null."); + } + if (environmentName == null) { + throw new IllegalArgumentException("Parameter environmentName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, environmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List environments in a given environment setting. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EnvironmentInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List environments in a given environment setting. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List environments in a given environment setting. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EnvironmentInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List environments in a given environment setting. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EnvironmentInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List environments in a given environment setting. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageImpl.java new file mode 100644 index 0000000000000..02eb9f6777323 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageImpl.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImage; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImageFragment; +import java.util.Map; +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImageReference; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import rx.functions.Func1; + +class GalleryImageImpl extends CreatableUpdatableImpl implements GalleryImage, GalleryImage.Definition, GalleryImage.Update { + private final LabServicesManager manager; + private String resourceGroupName; + private String labAccountName; + private String galleryImageName; + private GalleryImageFragment updateParameter; + + GalleryImageImpl(String name, LabServicesManager manager) { + super(name, new GalleryImageInner()); + this.manager = manager; + // Set resource name + this.galleryImageName = name; + // + this.updateParameter = new GalleryImageFragment(); + } + + GalleryImageImpl(GalleryImageInner inner, LabServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.galleryImageName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.labAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "labaccounts"); + this.galleryImageName = IdParsingUtils.getValueFromIdByName(inner.id(), "galleryimages"); + // + this.updateParameter = new GalleryImageFragment(); + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + GalleryImagesInner client = this.manager().inner().galleryImages(); + return client.createOrUpdateAsync(this.resourceGroupName, this.labAccountName, this.galleryImageName, this.inner()) + .map(new Func1() { + @Override + public GalleryImageInner call(GalleryImageInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + GalleryImagesInner client = this.manager().inner().galleryImages(); + return client.updateAsync(this.resourceGroupName, this.labAccountName, this.galleryImageName, this.updateParameter) + .map(new Func1() { + @Override + public GalleryImageInner call(GalleryImageInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + GalleryImagesInner client = this.manager().inner().galleryImages(); + return client.getAsync(this.resourceGroupName, this.labAccountName, this.galleryImageName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new GalleryImageFragment(); + } + + @Override + public String author() { + return this.inner().author(); + } + + @Override + public DateTime createdDate() { + return this.inner().createdDate(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String icon() { + return this.inner().icon(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public GalleryImageReference imageReference() { + return this.inner().imageReference(); + } + + @Override + public Boolean isEnabled() { + return this.inner().isEnabled(); + } + + @Override + public Boolean isOverride() { + return this.inner().isOverride(); + } + + @Override + public Boolean isPlanAuthorized() { + return this.inner().isPlanAuthorized(); + } + + @Override + public LatestOperationResult latestOperationResult() { + return this.inner().latestOperationResult(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String planId() { + return this.inner().planId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String uniqueIdentifier() { + return this.inner().uniqueIdentifier(); + } + + @Override + public GalleryImageImpl withExistingLabaccount(String resourceGroupName, String labAccountName) { + this.resourceGroupName = resourceGroupName; + this.labAccountName = labAccountName; + return this; + } + + @Override + public GalleryImageImpl withIsEnabled(Boolean isEnabled) { + if (isInCreateMode()) { + this.inner().withIsEnabled(isEnabled); + } else { + this.updateParameter.withIsEnabled(isEnabled); + } + return this; + } + + @Override + public GalleryImageImpl withIsOverride(Boolean isOverride) { + if (isInCreateMode()) { + this.inner().withIsOverride(isOverride); + } else { + this.updateParameter.withIsOverride(isOverride); + } + return this; + } + + @Override + public GalleryImageImpl withIsPlanAuthorized(Boolean isPlanAuthorized) { + if (isInCreateMode()) { + this.inner().withIsPlanAuthorized(isPlanAuthorized); + } else { + this.updateParameter.withIsPlanAuthorized(isPlanAuthorized); + } + return this; + } + + @Override + public GalleryImageImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public GalleryImageImpl withProvisioningState(String provisioningState) { + if (isInCreateMode()) { + this.inner().withProvisioningState(provisioningState); + } else { + this.updateParameter.withProvisioningState(provisioningState); + } + return this; + } + + @Override + public GalleryImageImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public GalleryImageImpl withUniqueIdentifier(String uniqueIdentifier) { + if (isInCreateMode()) { + this.inner().withUniqueIdentifier(uniqueIdentifier); + } else { + this.updateParameter.withUniqueIdentifier(uniqueIdentifier); + } + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageInner.java new file mode 100644 index 0000000000000..bc94443ef5308 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImageInner.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImageReference; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents an image from the Azure Marketplace. + */ +@JsonFlatten +@SkipParentValidation +public class GalleryImageInner extends Resource { + /** + * 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 DateTime 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 of the gallery image. + * + * @return the author value + */ + public String author() { + return this.author; + } + + /** + * Get the creation date of the gallery image. + * + * @return the createdDate value + */ + public DateTime createdDate() { + return this.createdDate; + } + + /** + * Get the description of the gallery image. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the image reference of the gallery image. + * + * @return the imageReference value + */ + public GalleryImageReference imageReference() { + return this.imageReference; + } + + /** + * Get the icon of the gallery image. + * + * @return the icon value + */ + public String icon() { + return this.icon; + } + + /** + * Get indicates whether this gallery image is enabled. + * + * @return the isEnabled value + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set 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 indicates whether this gallery has been overridden for this lab account. + * + * @return the isOverride value + */ + public Boolean isOverride() { + return this.isOverride; + } + + /** + * Set 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 third party plan that applies to this image. + * + * @return the planId value + */ + public String planId() { + return this.planId; + } + + /** + * Get indicates if the plan has been authorized for programmatic deployment. + * + * @return the isPlanAuthorized value + */ + public Boolean isPlanAuthorized() { + return this.isPlanAuthorized; + } + + /** + * Set 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 provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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 details of the latest operation. ex: status, error. + * + * @return the latestOperationResult value + */ + public LatestOperationResult latestOperationResult() { + return this.latestOperationResult; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesImpl.java new file mode 100644 index 0000000000000..bd8784c6eced8 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImage; + +class GalleryImagesImpl extends WrapperImpl implements GalleryImages { + private final LabServicesManager manager; + + GalleryImagesImpl(LabServicesManager manager) { + super(manager.inner().galleryImages()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + @Override + public GalleryImageImpl define(String name) { + return wrapModel(name); + } + + private GalleryImageImpl wrapModel(GalleryImageInner inner) { + return new GalleryImageImpl(inner, manager()); + } + + private GalleryImageImpl wrapModel(String name) { + return new GalleryImageImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String labAccountName) { + GalleryImagesInner client = this.inner(); + return client.listAsync(resourceGroupName, labAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public GalleryImage call(GalleryImageInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String labAccountName, String galleryImageName) { + GalleryImagesInner client = this.inner(); + return client.getAsync(resourceGroupName, labAccountName, galleryImageName) + .map(new Func1() { + @Override + public GalleryImage call(GalleryImageInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String labAccountName, String galleryImageName) { + GalleryImagesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, labAccountName, galleryImageName).toCompletable(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java new file mode 100644 index 0000000000000..2acd7bb05a830 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java @@ -0,0 +1,946 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImageFragment; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in GalleryImages. + */ +public class GalleryImagesInner { + /** The Retrofit service to perform REST calls. */ + private GalleryImagesService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of GalleryImagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GalleryImagesInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(GalleryImagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for GalleryImages to be + * used by Retrofit to perform actually REST calls. + */ + interface GalleryImagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Query("$expand") String expand, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("galleryImageName") String galleryImageName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("galleryImageName") String galleryImageName, @Body GalleryImageInner galleryImage, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("galleryImageName") String galleryImageName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/galleryimages/{galleryImageName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("galleryImageName") String galleryImageName, @Body GalleryImageFragment galleryImage, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<GalleryImageInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName) { + return listSinglePageAsync(resourceGroupName, labAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * 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 + * @return the PagedList<GalleryImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<GalleryImageInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, expand, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List gallery images in a given lab account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param labAccountName The name of the lab Account. + ServiceResponse> * @param expand Specify the $expand query. Example: 'properties($select=author)' + ServiceResponse> * @param filter The filter to apply to the operation. + ServiceResponse> * @param top The maximum number of resources to return from the operation. + ServiceResponse> * @param orderby The ordering expression for the results, using OData notation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GalleryImageInner object if successful. + */ + public GalleryImageInner get(String resourceGroupName, String labAccountName, String galleryImageName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String galleryImageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName), serviceCallback); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String galleryImageName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName).map(new Func1, GalleryImageInner>() { + @Override + public GalleryImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String galleryImageName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, galleryImageName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GalleryImageInner object if successful. + */ + public GalleryImageInner get(String resourceGroupName, String labAccountName, String galleryImageName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String galleryImageName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String galleryImageName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, expand).map(new Func1, GalleryImageInner>() { + @Override + public GalleryImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String galleryImageName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, galleryImageName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GalleryImageInner object if successful. + */ + public GalleryImageInner createOrUpdate(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage), serviceCallback); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).map(new Func1, GalleryImageInner>() { + @Override + public GalleryImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageInner galleryImage) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImage == null) { + throw new IllegalArgumentException("Parameter galleryImage is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(galleryImage); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, labAccountName, galleryImageName, galleryImage, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String labAccountName, String galleryImageName) { + deleteWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String labAccountName, String galleryImageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String labAccountName, String galleryImageName) { + return deleteWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String galleryImageName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, labAccountName, galleryImageName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GalleryImageInner object if successful. + */ + public GalleryImageInner update(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage), serviceCallback); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable updateAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).map(new Func1, GalleryImageInner>() { + @Override + public GalleryImageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GalleryImageInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (galleryImageName == null) { + throw new IllegalArgumentException("Parameter galleryImageName is required and cannot be null."); + } + if (galleryImage == null) { + throw new IllegalArgumentException("Parameter galleryImage is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(galleryImage); + return service.update(this.client.subscriptionId(), resourceGroupName, labAccountName, galleryImageName, galleryImage, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List gallery images in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<GalleryImageInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List gallery images in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List gallery images in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List gallery images in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GalleryImageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List gallery images in a given lab account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GalleryImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseImpl.java new file mode 100644 index 0000000000000..06d25e25e1e12 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.GetEnvironmentResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentDetails; + +class GetEnvironmentResponseImpl extends WrapperImpl implements GetEnvironmentResponse { + private final LabServicesManager manager; + GetEnvironmentResponseImpl(GetEnvironmentResponseInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public EnvironmentDetails environment() { + return this.inner().environment(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseInner.java new file mode 100644 index 0000000000000..dd2ad3e54ce42 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetEnvironmentResponseInner.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the environments details. + */ +public class GetEnvironmentResponseInner { + /** + * Details of the environment. + */ + @JsonProperty(value = "environment", access = JsonProperty.Access.WRITE_ONLY) + private EnvironmentDetails environment; + + /** + * Get details of the environment. + * + * @return the environment value + */ + public EnvironmentDetails environment() { + return this.environment; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseImpl.java new file mode 100644 index 0000000000000..a084d3071e528 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.GetPersonalPreferencesResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class GetPersonalPreferencesResponseImpl extends WrapperImpl implements GetPersonalPreferencesResponse { + private final LabServicesManager manager; + GetPersonalPreferencesResponseImpl(GetPersonalPreferencesResponseInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public List favoriteLabResourceIds() { + return this.inner().favoriteLabResourceIds(); + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseInner.java new file mode 100644 index 0000000000000..ed388f033a1ed --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetPersonalPreferencesResponseInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the PersonalPreferences for the user. + */ +public class GetPersonalPreferencesResponseInner { + /** + * 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 id to be used by the cache orchestrator. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set 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 array of favorite lab resource ids. + * + * @return the favoriteLabResourceIds value + */ + public List favoriteLabResourceIds() { + return this.favoriteLabResourceIds; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..0386aec4f49d1 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.GetRegionalAvailabilityResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.RegionalAvailability; + +class GetRegionalAvailabilityResponseImpl extends WrapperImpl implements GetRegionalAvailabilityResponse { + private final LabServicesManager manager; + GetRegionalAvailabilityResponseImpl(GetRegionalAvailabilityResponseInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public List regionalAvailability() { + return this.inner().regionalAvailability(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseInner.java new file mode 100644 index 0000000000000..873c72d62d892 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GetRegionalAvailabilityResponseInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.RegionalAvailability; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response model from the GetRegionalAvailability action. + */ +public class GetRegionalAvailabilityResponseInner { + /** + * Availability information for different size categories per region. + */ + @JsonProperty(value = "regionalAvailability") + private List regionalAvailability; + + /** + * Get availability information for different size categories per region. + * + * @return the regionalAvailability value + */ + public List regionalAvailability() { + return this.regionalAvailability; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersImpl.java new file mode 100644 index 0000000000000..e07954bc7f3d4 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.GetEnvironmentResponse; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationBatchStatusResponse; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationStatusResponse; +import com.microsoft.azure.management.labservices.v2018_10_15.GetPersonalPreferencesResponse; +import com.microsoft.azure.management.labservices.v2018_10_15.ListEnvironmentsResponse; +import com.microsoft.azure.management.labservices.v2018_10_15.ListLabsResponse; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.PersonalPreferencesOperationsPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.ResetPasswordPayload; + +class GlobalUsersImpl extends WrapperImpl implements GlobalUsers { + private final LabServicesManager manager; + + GlobalUsersImpl(LabServicesManager manager) { + super(manager.inner().globalUsers()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + @Override + public Observable getEnvironmentAsync(String userName, String environmentId) { + GlobalUsersInner client = this.inner(); + return client.getEnvironmentAsync(userName, environmentId) + .map(new Func1() { + @Override + public GetEnvironmentResponse call(GetEnvironmentResponseInner inner) { + return new GetEnvironmentResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getOperationBatchStatusAsync(String userName, List urls) { + GlobalUsersInner client = this.inner(); + return client.getOperationBatchStatusAsync(userName, urls) + .map(new Func1() { + @Override + public OperationBatchStatusResponse call(OperationBatchStatusResponseInner inner) { + return new OperationBatchStatusResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getOperationStatusAsync(String userName, String operationUrl) { + GlobalUsersInner client = this.inner(); + return client.getOperationStatusAsync(userName, operationUrl) + .map(new Func1() { + @Override + public OperationStatusResponse call(OperationStatusResponseInner inner) { + return new OperationStatusResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPersonalPreferencesAsync(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { + GlobalUsersInner client = this.inner(); + return client.getPersonalPreferencesAsync(userName, personalPreferencesOperationsPayload) + .map(new Func1() { + @Override + public GetPersonalPreferencesResponse call(GetPersonalPreferencesResponseInner inner) { + return new GetPersonalPreferencesResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEnvironmentsAsync(String userName) { + GlobalUsersInner client = this.inner(); + return client.listEnvironmentsAsync(userName) + .map(new Func1() { + @Override + public ListEnvironmentsResponse call(ListEnvironmentsResponseInner inner) { + return new ListEnvironmentsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listLabsAsync(String userName) { + GlobalUsersInner client = this.inner(); + return client.listLabsAsync(userName) + .map(new Func1() { + @Override + public ListLabsResponse call(ListLabsResponseInner inner) { + return new ListLabsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable registerAsync(String userName) { + GlobalUsersInner client = this.inner(); + return client.registerAsync(userName).toCompletable(); + } + + @Override + public Completable resetPasswordAsync(String userName, ResetPasswordPayload resetPasswordPayload) { + GlobalUsersInner client = this.inner(); + return client.resetPasswordAsync(userName, resetPasswordPayload).toCompletable(); + } + + @Override + public Completable startEnvironmentAsync(String userName, String environmentId) { + GlobalUsersInner client = this.inner(); + return client.startEnvironmentAsync(userName, environmentId).toCompletable(); + } + + @Override + public Completable stopEnvironmentAsync(String userName, String environmentId) { + GlobalUsersInner client = this.inner(); + return client.stopEnvironmentAsync(userName, environmentId).toCompletable(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java new file mode 100644 index 0000000000000..779c4bdc448d2 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java @@ -0,0 +1,1377 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentOperationsPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.ListEnvironmentsPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationBatchStatusPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationStatusPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.PersonalPreferencesOperationsPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.RegisterPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.ResetPasswordPayload; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in GlobalUsers. + */ +public class GlobalUsersInner { + /** The Retrofit service to perform REST calls. */ + private GlobalUsersService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of GlobalUsersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GlobalUsersInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(GlobalUsersService.class); + this.client = client; + } + + /** + * The interface defining all the services for GlobalUsers to be + * used by Retrofit to perform actually REST calls. + */ + interface GlobalUsersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers getEnvironment" }) + @POST("providers/Microsoft.LabServices/users/{userName}/getEnvironment") + Observable> getEnvironment(@Path("userName") String userName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body EnvironmentOperationsPayload environmentOperationsPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers getOperationBatchStatus" }) + @POST("providers/Microsoft.LabServices/users/{userName}/getOperationBatchStatus") + Observable> getOperationBatchStatus(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body OperationBatchStatusPayload operationBatchStatusPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers getOperationStatus" }) + @POST("providers/Microsoft.LabServices/users/{userName}/getOperationStatus") + Observable> getOperationStatus(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body OperationStatusPayload operationStatusPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers getPersonalPreferences" }) + @POST("providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences") + Observable> getPersonalPreferences(@Path("userName") String userName, @Body PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers listEnvironments" }) + @POST("providers/Microsoft.LabServices/users/{userName}/listEnvironments") + Observable> listEnvironments(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ListEnvironmentsPayload listEnvironmentsPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers listLabs" }) + @POST("providers/Microsoft.LabServices/users/{userName}/listLabs") + Observable> listLabs(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers register" }) + @POST("providers/Microsoft.LabServices/users/{userName}/register") + Observable> register(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegisterPayload registerPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers resetPassword" }) + @POST("providers/Microsoft.LabServices/users/{userName}/resetPassword") + Observable> resetPassword(@Path("userName") String userName, @Body ResetPasswordPayload resetPasswordPayload, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers beginResetPassword" }) + @POST("providers/Microsoft.LabServices/users/{userName}/resetPassword") + Observable> beginResetPassword(@Path("userName") String userName, @Body ResetPasswordPayload resetPasswordPayload, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers startEnvironment" }) + @POST("providers/Microsoft.LabServices/users/{userName}/startEnvironment") + Observable> startEnvironment(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body EnvironmentOperationsPayload environmentOperationsPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers beginStartEnvironment" }) + @POST("providers/Microsoft.LabServices/users/{userName}/startEnvironment") + Observable> beginStartEnvironment(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body EnvironmentOperationsPayload environmentOperationsPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers stopEnvironment" }) + @POST("providers/Microsoft.LabServices/users/{userName}/stopEnvironment") + Observable> stopEnvironment(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body EnvironmentOperationsPayload environmentOperationsPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers beginStopEnvironment" }) + @POST("providers/Microsoft.LabServices/users/{userName}/stopEnvironment") + Observable> beginStopEnvironment(@Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body EnvironmentOperationsPayload environmentOperationsPayload, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GetEnvironmentResponseInner object if successful. + */ + public GetEnvironmentResponseInner getEnvironment(String userName, String environmentId) { + return getEnvironmentWithServiceResponseAsync(userName, environmentId).toBlocking().single().body(); + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEnvironmentAsync(String userName, String environmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEnvironmentWithServiceResponseAsync(userName, environmentId), serviceCallback); + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GetEnvironmentResponseInner object + */ + public Observable getEnvironmentAsync(String userName, String environmentId) { + return getEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1, GetEnvironmentResponseInner>() { + @Override + public GetEnvironmentResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GetEnvironmentResponseInner object + */ + public Observable> getEnvironmentWithServiceResponseAsync(String userName, String environmentId) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (environmentId == null) { + throw new IllegalArgumentException("Parameter environmentId is required and cannot be null."); + } + final String expand = null; + EnvironmentOperationsPayload environmentOperationsPayload = new EnvironmentOperationsPayload(); + environmentOperationsPayload.withEnvironmentId(environmentId); + return service.getEnvironment(userName, expand, this.client.apiVersion(), this.client.acceptLanguage(), environmentOperationsPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @param expand Specify the $expand query. Example: 'properties($expand=environment)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GetEnvironmentResponseInner object if successful. + */ + public GetEnvironmentResponseInner getEnvironment(String userName, String environmentId, String expand) { + return getEnvironmentWithServiceResponseAsync(userName, environmentId, expand).toBlocking().single().body(); + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @param expand Specify the $expand query. Example: 'properties($expand=environment)' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEnvironmentAsync(String userName, String environmentId, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEnvironmentWithServiceResponseAsync(userName, environmentId, expand), serviceCallback); + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @param expand Specify the $expand query. Example: 'properties($expand=environment)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GetEnvironmentResponseInner object + */ + public Observable getEnvironmentAsync(String userName, String environmentId, String expand) { + return getEnvironmentWithServiceResponseAsync(userName, environmentId, expand).map(new Func1, GetEnvironmentResponseInner>() { + @Override + public GetEnvironmentResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the virtual machine details. + * + * @param userName The name of the user. + * @param environmentId The resourceId of the environment + * @param expand Specify the $expand query. Example: 'properties($expand=environment)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GetEnvironmentResponseInner object + */ + public Observable> getEnvironmentWithServiceResponseAsync(String userName, String environmentId, String expand) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (environmentId == null) { + throw new IllegalArgumentException("Parameter environmentId is required and cannot be null."); + } + EnvironmentOperationsPayload environmentOperationsPayload = new EnvironmentOperationsPayload(); + environmentOperationsPayload.withEnvironmentId(environmentId); + return service.getEnvironment(userName, expand, this.client.apiVersion(), this.client.acceptLanguage(), environmentOperationsPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get batch operation status. + * + * @param userName The name of the user. + * @param urls The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationBatchStatusResponseInner object if successful. + */ + public OperationBatchStatusResponseInner getOperationBatchStatus(String userName, List urls) { + return getOperationBatchStatusWithServiceResponseAsync(userName, urls).toBlocking().single().body(); + } + + /** + * Get batch operation status. + * + * @param userName The name of the user. + * @param urls The operation url of long running operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOperationBatchStatusAsync(String userName, List urls, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOperationBatchStatusWithServiceResponseAsync(userName, urls), serviceCallback); + } + + /** + * Get batch operation status. + * + * @param userName The name of the user. + * @param urls The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationBatchStatusResponseInner object + */ + public Observable getOperationBatchStatusAsync(String userName, List urls) { + return getOperationBatchStatusWithServiceResponseAsync(userName, urls).map(new Func1, OperationBatchStatusResponseInner>() { + @Override + public OperationBatchStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get batch operation status. + * + * @param userName The name of the user. + * @param urls The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationBatchStatusResponseInner object + */ + public Observable> getOperationBatchStatusWithServiceResponseAsync(String userName, List urls) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (urls == null) { + throw new IllegalArgumentException("Parameter urls is required and cannot be null."); + } + Validator.validate(urls); + OperationBatchStatusPayload operationBatchStatusPayload = new OperationBatchStatusPayload(); + operationBatchStatusPayload.withUrls(urls); + return service.getOperationBatchStatus(userName, this.client.apiVersion(), this.client.acceptLanguage(), operationBatchStatusPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOperationBatchStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOperationBatchStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the status of long running operation. + * + * @param userName The name of the user. + * @param operationUrl The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusResponseInner object if successful. + */ + public OperationStatusResponseInner getOperationStatus(String userName, String operationUrl) { + return getOperationStatusWithServiceResponseAsync(userName, operationUrl).toBlocking().single().body(); + } + + /** + * Gets the status of long running operation. + * + * @param userName The name of the user. + * @param operationUrl The operation url of long running operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOperationStatusAsync(String userName, String operationUrl, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOperationStatusWithServiceResponseAsync(userName, operationUrl), serviceCallback); + } + + /** + * Gets the status of long running operation. + * + * @param userName The name of the user. + * @param operationUrl The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable getOperationStatusAsync(String userName, String operationUrl) { + return getOperationStatusWithServiceResponseAsync(userName, operationUrl).map(new Func1, OperationStatusResponseInner>() { + @Override + public OperationStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of long running operation. + * + * @param userName The name of the user. + * @param operationUrl The operation url of long running operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusResponseInner object + */ + public Observable> getOperationStatusWithServiceResponseAsync(String userName, String operationUrl) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (operationUrl == null) { + throw new IllegalArgumentException("Parameter operationUrl is required and cannot be null."); + } + OperationStatusPayload operationStatusPayload = new OperationStatusPayload(); + operationStatusPayload.withOperationUrl(operationUrl); + return service.getOperationStatus(userName, this.client.apiVersion(), this.client.acceptLanguage(), operationStatusPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOperationStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOperationStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GetPersonalPreferencesResponseInner object if successful. + */ + public GetPersonalPreferencesResponseInner getPersonalPreferences(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { + return getPersonalPreferencesWithServiceResponseAsync(userName, personalPreferencesOperationsPayload).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPersonalPreferencesAsync(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPersonalPreferencesWithServiceResponseAsync(userName, personalPreferencesOperationsPayload), serviceCallback); + } + + /** + * 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 + * @return the observable to the GetPersonalPreferencesResponseInner object + */ + public Observable getPersonalPreferencesAsync(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { + return getPersonalPreferencesWithServiceResponseAsync(userName, personalPreferencesOperationsPayload).map(new Func1, GetPersonalPreferencesResponseInner>() { + @Override + public GetPersonalPreferencesResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GetPersonalPreferencesResponseInner object + */ + public Observable> getPersonalPreferencesWithServiceResponseAsync(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (personalPreferencesOperationsPayload == null) { + throw new IllegalArgumentException("Parameter personalPreferencesOperationsPayload is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(personalPreferencesOperationsPayload); + return service.getPersonalPreferences(userName, personalPreferencesOperationsPayload, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPersonalPreferencesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPersonalPreferencesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListEnvironmentsResponseInner object if successful. + */ + public ListEnvironmentsResponseInner listEnvironments(String userName) { + return listEnvironmentsWithServiceResponseAsync(userName).toBlocking().single().body(); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listEnvironmentsAsync(String userName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listEnvironmentsWithServiceResponseAsync(userName), serviceCallback); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListEnvironmentsResponseInner object + */ + public Observable listEnvironmentsAsync(String userName) { + return listEnvironmentsWithServiceResponseAsync(userName).map(new Func1, ListEnvironmentsResponseInner>() { + @Override + public ListEnvironmentsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListEnvironmentsResponseInner object + */ + public Observable> listEnvironmentsWithServiceResponseAsync(String userName) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String labId = null; + ListEnvironmentsPayload listEnvironmentsPayload = new ListEnvironmentsPayload(); + listEnvironmentsPayload.withLabId(null); + return service.listEnvironments(userName, this.client.apiVersion(), this.client.acceptLanguage(), listEnvironmentsPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listEnvironmentsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @param labId The resource Id of the lab + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListEnvironmentsResponseInner object if successful. + */ + public ListEnvironmentsResponseInner listEnvironments(String userName, String labId) { + return listEnvironmentsWithServiceResponseAsync(userName, labId).toBlocking().single().body(); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @param labId The resource Id of the lab + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listEnvironmentsAsync(String userName, String labId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listEnvironmentsWithServiceResponseAsync(userName, labId), serviceCallback); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @param labId The resource Id of the lab + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListEnvironmentsResponseInner object + */ + public Observable listEnvironmentsAsync(String userName, String labId) { + return listEnvironmentsWithServiceResponseAsync(userName, labId).map(new Func1, ListEnvironmentsResponseInner>() { + @Override + public ListEnvironmentsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Environments for the user. + * + * @param userName The name of the user. + * @param labId The resource Id of the lab + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListEnvironmentsResponseInner object + */ + public Observable> listEnvironmentsWithServiceResponseAsync(String userName, String labId) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + ListEnvironmentsPayload listEnvironmentsPayload = new ListEnvironmentsPayload(); + listEnvironmentsPayload.withLabId(labId); + return service.listEnvironments(userName, this.client.apiVersion(), this.client.acceptLanguage(), listEnvironmentsPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listEnvironmentsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listEnvironmentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List labs for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListLabsResponseInner object if successful. + */ + public ListLabsResponseInner listLabs(String userName) { + return listLabsWithServiceResponseAsync(userName).toBlocking().single().body(); + } + + /** + * List labs for the user. + * + * @param userName The name of the user. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listLabsAsync(String userName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listLabsWithServiceResponseAsync(userName), serviceCallback); + } + + /** + * List labs for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListLabsResponseInner object + */ + public Observable listLabsAsync(String userName) { + return listLabsWithServiceResponseAsync(userName).map(new Func1, ListLabsResponseInner>() { + @Override + public ListLabsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List labs for the user. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListLabsResponseInner object + */ + public Observable> listLabsWithServiceResponseAsync(String userName) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listLabs(userName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listLabsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listLabsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void register(String userName) { + registerWithServiceResponseAsync(userName).toBlocking().single().body(); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture registerAsync(String userName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(registerWithServiceResponseAsync(userName), serviceCallback); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable registerAsync(String userName) { + return registerWithServiceResponseAsync(userName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> registerWithServiceResponseAsync(String userName) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String registrationCode = null; + RegisterPayload registerPayload = new RegisterPayload(); + registerPayload.withRegistrationCode(null); + return service.register(userName, this.client.apiVersion(), this.client.acceptLanguage(), registerPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = registerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @param registrationCode The registration code of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void register(String userName, String registrationCode) { + registerWithServiceResponseAsync(userName, registrationCode).toBlocking().single().body(); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @param registrationCode The registration code of the lab. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture registerAsync(String userName, String registrationCode, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(registerWithServiceResponseAsync(userName, registrationCode), serviceCallback); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @param registrationCode The registration code of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable registerAsync(String userName, String registrationCode) { + return registerWithServiceResponseAsync(userName, registrationCode).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Register a user to a managed lab. + * + * @param userName The name of the user. + * @param registrationCode The registration code of the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> registerWithServiceResponseAsync(String userName, String registrationCode) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + RegisterPayload registerPayload = new RegisterPayload(); + registerPayload.withRegistrationCode(registrationCode); + return service.register(userName, this.client.apiVersion(), this.client.acceptLanguage(), registerPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = registerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse registerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resetPassword(String userName, ResetPasswordPayload resetPasswordPayload) { + resetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetPasswordAsync(String userName, ResetPasswordPayload resetPasswordPayload, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetPasswordWithServiceResponseAsync(userName, resetPasswordPayload), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable resetPasswordAsync(String userName, ResetPasswordPayload resetPasswordPayload) { + return resetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> resetPasswordWithServiceResponseAsync(String userName, ResetPasswordPayload resetPasswordPayload) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (resetPasswordPayload == null) { + throw new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(resetPasswordPayload); + Observable> observable = service.resetPassword(userName, resetPasswordPayload, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResetPassword(String userName, ResetPasswordPayload resetPasswordPayload) { + beginResetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetPasswordAsync(String userName, ResetPasswordPayload resetPasswordPayload, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetPasswordWithServiceResponseAsync(userName, resetPasswordPayload), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetPasswordAsync(String userName, ResetPasswordPayload resetPasswordPayload) { + return beginResetPasswordWithServiceResponseAsync(userName, resetPasswordPayload).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetPasswordWithServiceResponseAsync(String userName, ResetPasswordPayload resetPasswordPayload) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (resetPasswordPayload == null) { + throw new IllegalArgumentException("Parameter resetPasswordPayload is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(resetPasswordPayload); + return service.beginResetPassword(userName, resetPasswordPayload, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetPasswordDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetPasswordDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void startEnvironment(String userName, String environmentId) { + startEnvironmentWithServiceResponseAsync(userName, environmentId).toBlocking().last().body(); + } + + /** + * 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 environmentId The resourceId of the environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startEnvironmentAsync(String userName, String environmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startEnvironmentWithServiceResponseAsync(userName, environmentId), serviceCallback); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startEnvironmentAsync(String userName, String environmentId) { + return startEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startEnvironmentWithServiceResponseAsync(String userName, String environmentId) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (environmentId == null) { + throw new IllegalArgumentException("Parameter environmentId is required and cannot be null."); + } + EnvironmentOperationsPayload environmentOperationsPayload = new EnvironmentOperationsPayload(); + environmentOperationsPayload.withEnvironmentId(environmentId); + Observable> observable = service.startEnvironment(userName, this.client.apiVersion(), this.client.acceptLanguage(), environmentOperationsPayload, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStartEnvironment(String userName, String environmentId) { + beginStartEnvironmentWithServiceResponseAsync(userName, environmentId).toBlocking().single().body(); + } + + /** + * 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 environmentId The resourceId of the environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartEnvironmentAsync(String userName, String environmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartEnvironmentWithServiceResponseAsync(userName, environmentId), serviceCallback); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartEnvironmentAsync(String userName, String environmentId) { + return beginStartEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartEnvironmentWithServiceResponseAsync(String userName, String environmentId) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (environmentId == null) { + throw new IllegalArgumentException("Parameter environmentId is required and cannot be null."); + } + EnvironmentOperationsPayload environmentOperationsPayload = new EnvironmentOperationsPayload(); + environmentOperationsPayload.withEnvironmentId(environmentId); + return service.beginStartEnvironment(userName, this.client.apiVersion(), this.client.acceptLanguage(), environmentOperationsPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stopEnvironment(String userName, String environmentId) { + stopEnvironmentWithServiceResponseAsync(userName, environmentId).toBlocking().last().body(); + } + + /** + * 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 environmentId The resourceId of the environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopEnvironmentAsync(String userName, String environmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopEnvironmentWithServiceResponseAsync(userName, environmentId), serviceCallback); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopEnvironmentAsync(String userName, String environmentId) { + return stopEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopEnvironmentWithServiceResponseAsync(String userName, String environmentId) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (environmentId == null) { + throw new IllegalArgumentException("Parameter environmentId is required and cannot be null."); + } + EnvironmentOperationsPayload environmentOperationsPayload = new EnvironmentOperationsPayload(); + environmentOperationsPayload.withEnvironmentId(environmentId); + Observable> observable = service.stopEnvironment(userName, this.client.apiVersion(), this.client.acceptLanguage(), environmentOperationsPayload, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStopEnvironment(String userName, String environmentId) { + beginStopEnvironmentWithServiceResponseAsync(userName, environmentId).toBlocking().single().body(); + } + + /** + * 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 environmentId The resourceId of the environment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopEnvironmentAsync(String userName, String environmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopEnvironmentWithServiceResponseAsync(userName, environmentId), serviceCallback); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopEnvironmentAsync(String userName, String environmentId) { + return beginStopEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 environmentId The resourceId of the environment + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopEnvironmentWithServiceResponseAsync(String userName, String environmentId) { + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (environmentId == null) { + throw new IllegalArgumentException("Parameter environmentId is required and cannot be null."); + } + EnvironmentOperationsPayload environmentOperationsPayload = new EnvironmentOperationsPayload(); + environmentOperationsPayload.withEnvironmentId(environmentId); + return service.beginStopEnvironment(userName, this.client.apiVersion(), this.client.acceptLanguage(), environmentOperationsPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/IdParsingUtils.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..17b47173ed921 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountImpl.java new file mode 100644 index 0000000000000..ea73e9f011e74 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountImpl.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.LabAccount; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.LabAccountFragment; +import com.microsoft.azure.management.labservices.v2018_10_15.SizeConfigurationProperties; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import rx.functions.Func1; + +class LabAccountImpl extends GroupableResourceCoreImpl implements LabAccount, LabAccount.Definition, LabAccount.Update { + private LabAccountFragment updateParameter; + LabAccountImpl(String name, LabAccountInner inner, LabServicesManager manager) { + super(name, inner, manager); + this.updateParameter = new LabAccountFragment(); + } + + @Override + public Observable createResourceAsync() { + LabAccountsInner client = this.manager().inner().labAccounts(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public LabAccountInner call(LabAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LabAccountsInner client = this.manager().inner().labAccounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public LabAccountInner call(LabAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LabAccountsInner client = this.manager().inner().labAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new LabAccountFragment(); + } + + @Override + public Boolean enabledRegionSelection() { + return this.inner().enabledRegionSelection(); + } + + @Override + public LatestOperationResult latestOperationResult() { + return this.inner().latestOperationResult(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SizeConfigurationProperties sizeConfiguration() { + return this.inner().sizeConfiguration(); + } + + @Override + public String uniqueIdentifier() { + return this.inner().uniqueIdentifier(); + } + + @Override + public LabAccountImpl withEnabledRegionSelection(Boolean enabledRegionSelection) { + if (isInCreateMode()) { + this.inner().withEnabledRegionSelection(enabledRegionSelection); + } else { + this.updateParameter.withEnabledRegionSelection(enabledRegionSelection); + } + return this; + } + + @Override + public LabAccountImpl withProvisioningState(String provisioningState) { + if (isInCreateMode()) { + this.inner().withProvisioningState(provisioningState); + } else { + this.updateParameter.withProvisioningState(provisioningState); + } + return this; + } + + @Override + public LabAccountImpl withUniqueIdentifier(String uniqueIdentifier) { + if (isInCreateMode()) { + this.inner().withUniqueIdentifier(uniqueIdentifier); + } else { + this.updateParameter.withUniqueIdentifier(uniqueIdentifier); + } + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountInner.java new file mode 100644 index 0000000000000..f396f99156ab6 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountInner.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.SizeConfigurationProperties; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents a lab account. + */ +@JsonFlatten +@SkipParentValidation +public class LabAccountInner extends Resource { + /** + * 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 represents the size configuration under the lab account. + * + * @return the sizeConfiguration value + */ + public SizeConfigurationProperties sizeConfiguration() { + return this.sizeConfiguration; + } + + /** + * Get represents if region selection is enabled. + * + * @return the enabledRegionSelection value + */ + public Boolean enabledRegionSelection() { + return this.enabledRegionSelection; + } + + /** + * Set 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 provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set 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 unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set 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 details of the latest operation. ex: status, error. + * + * @return the latestOperationResult value + */ + public LatestOperationResult latestOperationResult() { + return this.latestOperationResult; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsImpl.java new file mode 100644 index 0000000000000..6b28708f7012c --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsImpl.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts; +import com.microsoft.azure.management.labservices.v2018_10_15.LabAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.labservices.v2018_10_15.GetRegionalAvailabilityResponse; +import com.microsoft.azure.management.labservices.v2018_10_15.CreateLabProperties; + +class LabAccountsImpl extends GroupableResourcesCoreImpl implements LabAccounts { + protected LabAccountsImpl(LabServicesManager manager) { + super(manager.inner().labAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + LabAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + LabAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + LabAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + LabAccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LabAccount call(LabAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + LabAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + LabAccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LabAccount call(LabAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public LabAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable createLabAsync(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { + LabAccountsInner client = this.inner(); + return client.createLabAsync(resourceGroupName, labAccountName, createLabProperties).toCompletable(); + } + + @Override + public Observable getRegionalAvailabilityAsync(String resourceGroupName, String labAccountName) { + LabAccountsInner client = this.inner(); + return client.getRegionalAvailabilityAsync(resourceGroupName, labAccountName) + .map(new Func1() { + @Override + public GetRegionalAvailabilityResponse call(GetRegionalAvailabilityResponseInner inner) { + return new GetRegionalAvailabilityResponseImpl(inner, manager()); + } + }); + } + + @Override + protected LabAccountImpl wrapModel(LabAccountInner inner) { + return new LabAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected LabAccountImpl wrapModel(String name) { + return new LabAccountImpl(name, new LabAccountInner(), this.manager()); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java new file mode 100644 index 0000000000000..cec9b2b023d47 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java @@ -0,0 +1,1509 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.labservices.v2018_10_15.CreateLabProperties; +import com.microsoft.azure.management.labservices.v2018_10_15.LabAccountFragment; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LabAccounts. + */ +public class LabAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private LabAccountsService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of LabAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LabAccountsInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(LabAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LabAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface LabAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labaccounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("$expand") String expand, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Body LabAccountInner labAccount, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Body LabAccountFragment labAccount, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts createLab" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/createLab") + Observable> createLab(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Body CreateLabProperties createLabProperties, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts getRegionalAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/getRegionalAvailability") + Observable> getRegionalAvailability(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List lab accounts in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabAccountInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List lab accounts in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List lab accounts in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List lab accounts in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List lab accounts in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabAccountInner> object if successful. + */ + public PagedList list(final String expand, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(expand, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String expand, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(expand, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable> listAsync(final String expand, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(expand, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable>> listWithServiceResponseAsync(final String expand, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(expand, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List lab accounts in a subscription. + * + ServiceResponse> * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)' + ServiceResponse> * @param filter The filter to apply to the operation. + ServiceResponse> * @param top The maximum number of resources to return from the operation. + ServiceResponse> * @param orderby The ordering expression for the results, using OData notation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String expand, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List lab accounts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabAccountInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List lab accounts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List lab accounts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List lab accounts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List lab accounts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabAccountInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String expand, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String expand, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String expand, final String filter, final Integer top, final String orderby) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, expand, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String expand, final String filter, final Integer top, final String orderby) { + return listByResourceGroupSinglePageAsync(resourceGroupName, expand, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List lab accounts in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param expand Specify the $expand query. Example: 'properties($expand=sizeConfiguration)' + ServiceResponse> * @param filter The filter to apply to the operation. + ServiceResponse> * @param top The maximum number of resources to return from the operation. + ServiceResponse> * @param orderby The ordering expression for the results, using OData notation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String expand, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabAccountInner object if successful. + */ + public LabAccountInner getByResourceGroup(String resourceGroupName, String labAccountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, labAccountName).toBlocking().single().body(); + } + + /** + * Get lab account. + * + * @param resourceGroupName The name of the resource group. + * @param labAccountName The name of the lab Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String labAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, labAccountName), serviceCallback); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String labAccountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, labAccountName).map(new Func1, LabAccountInner>() { + @Override + public LabAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String labAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, labAccountName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabAccountInner object if successful. + */ + public LabAccountInner getByResourceGroup(String resourceGroupName, String labAccountName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, labAccountName, expand).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String labAccountName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, labAccountName, expand), serviceCallback); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String labAccountName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, labAccountName, expand).map(new Func1, LabAccountInner>() { + @Override + public LabAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String labAccountName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, labAccountName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabAccountInner object if successful. + */ + public LabAccountInner createOrUpdate(String resourceGroupName, String labAccountName, LabAccountInner labAccount) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String labAccountName, LabAccountInner labAccount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount), serviceCallback); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String labAccountName, LabAccountInner labAccount) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount).map(new Func1, LabAccountInner>() { + @Override + public LabAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String labAccountName, LabAccountInner labAccount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labAccount == null) { + throw new IllegalArgumentException("Parameter labAccount is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(labAccount); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, labAccountName, labAccount, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String labAccountName) { + deleteWithServiceResponseAsync(resourceGroupName, labAccountName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String labAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, labAccountName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String labAccountName) { + return deleteWithServiceResponseAsync(resourceGroupName, labAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String labAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, labAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String labAccountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String labAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String labAccountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String labAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, labAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabAccountInner object if successful. + */ + public LabAccountInner update(String resourceGroupName, String labAccountName, LabAccountFragment labAccount) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String labAccountName, LabAccountFragment labAccount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount), serviceCallback); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String labAccountName, LabAccountFragment labAccount) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount).map(new Func1, LabAccountInner>() { + @Override + public LabAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the LabAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String labAccountName, LabAccountFragment labAccount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labAccount == null) { + throw new IllegalArgumentException("Parameter labAccount is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(labAccount); + return service.update(this.client.subscriptionId(), resourceGroupName, labAccountName, labAccount, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createLab(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { + createLabWithServiceResponseAsync(resourceGroupName, labAccountName, createLabProperties).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createLabAsync(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createLabWithServiceResponseAsync(resourceGroupName, labAccountName, createLabProperties), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createLabAsync(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { + return createLabWithServiceResponseAsync(resourceGroupName, labAccountName, createLabProperties).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createLabWithServiceResponseAsync(String resourceGroupName, String labAccountName, CreateLabProperties createLabProperties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (createLabProperties == null) { + throw new IllegalArgumentException("Parameter createLabProperties is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(createLabProperties); + return service.createLab(this.client.subscriptionId(), resourceGroupName, labAccountName, createLabProperties, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createLabDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createLabDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GetRegionalAvailabilityResponseInner object if successful. + */ + public GetRegionalAvailabilityResponseInner getRegionalAvailability(String resourceGroupName, String labAccountName) { + return getRegionalAvailabilityWithServiceResponseAsync(resourceGroupName, labAccountName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getRegionalAvailabilityAsync(String resourceGroupName, String labAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getRegionalAvailabilityWithServiceResponseAsync(resourceGroupName, labAccountName), serviceCallback); + } + + /** + * 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 + * @return the observable to the GetRegionalAvailabilityResponseInner object + */ + public Observable getRegionalAvailabilityAsync(String resourceGroupName, String labAccountName) { + return getRegionalAvailabilityWithServiceResponseAsync(resourceGroupName, labAccountName).map(new Func1, GetRegionalAvailabilityResponseInner>() { + @Override + public GetRegionalAvailabilityResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GetRegionalAvailabilityResponseInner object + */ + public Observable> getRegionalAvailabilityWithServiceResponseAsync(String resourceGroupName, String labAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getRegionalAvailability(this.client.subscriptionId(), resourceGroupName, labAccountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getRegionalAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getRegionalAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List lab accounts in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabAccountInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List lab accounts in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List lab accounts in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List lab accounts in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List lab accounts in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List lab accounts in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabAccountInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List lab accounts in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List lab accounts in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List lab accounts in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabAccountInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List lab accounts in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabImpl.java new file mode 100644 index 0000000000000..b7d134b73fb52 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabImpl.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.Lab; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.LabFragment; +import java.util.Map; +import org.joda.time.Period; +import com.microsoft.azure.management.labservices.v2018_10_15.LabUserAccessMode; +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import rx.functions.Func1; + +class LabImpl extends CreatableUpdatableImpl implements Lab, Lab.Definition, Lab.Update { + private final LabServicesManager manager; + private String resourceGroupName; + private String labAccountName; + private String labName; + private LabFragment updateParameter; + + LabImpl(String name, LabServicesManager manager) { + super(name, new LabInner()); + this.manager = manager; + // Set resource name + this.labName = name; + // + this.updateParameter = new LabFragment(); + } + + LabImpl(LabInner inner, LabServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.labName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.labAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "labaccounts"); + this.labName = IdParsingUtils.getValueFromIdByName(inner.id(), "labs"); + // + this.updateParameter = new LabFragment(); + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LabsInner client = this.manager().inner().labs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.inner()) + .map(new Func1() { + @Override + public LabInner call(LabInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LabsInner client = this.manager().inner().labs(); + return client.updateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.updateParameter) + .map(new Func1() { + @Override + public LabInner call(LabInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LabsInner client = this.manager().inner().labs(); + return client.getAsync(this.resourceGroupName, this.labAccountName, this.labName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new LabFragment(); + } + + @Override + public String createdByObjectId() { + return this.inner().createdByObjectId(); + } + + @Override + public String createdByUserPrincipalName() { + return this.inner().createdByUserPrincipalName(); + } + + @Override + public DateTime createdDate() { + return this.inner().createdDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String invitationCode() { + return this.inner().invitationCode(); + } + + @Override + public LatestOperationResult latestOperationResult() { + return this.inner().latestOperationResult(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Integer maxUsersInLab() { + return this.inner().maxUsersInLab(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String uniqueIdentifier() { + return this.inner().uniqueIdentifier(); + } + + @Override + public Period usageQuota() { + return this.inner().usageQuota(); + } + + @Override + public LabUserAccessMode userAccessMode() { + return this.inner().userAccessMode(); + } + + @Override + public Integer userQuota() { + return this.inner().userQuota(); + } + + @Override + public LabImpl withExistingLabaccount(String resourceGroupName, String labAccountName) { + this.resourceGroupName = resourceGroupName; + this.labAccountName = labAccountName; + return this; + } + + @Override + public LabImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public LabImpl withMaxUsersInLab(Integer maxUsersInLab) { + if (isInCreateMode()) { + this.inner().withMaxUsersInLab(maxUsersInLab); + } else { + this.updateParameter.withMaxUsersInLab(maxUsersInLab); + } + return this; + } + + @Override + public LabImpl withProvisioningState(String provisioningState) { + if (isInCreateMode()) { + this.inner().withProvisioningState(provisioningState); + } else { + this.updateParameter.withProvisioningState(provisioningState); + } + return this; + } + + @Override + public LabImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public LabImpl withUniqueIdentifier(String uniqueIdentifier) { + if (isInCreateMode()) { + this.inner().withUniqueIdentifier(uniqueIdentifier); + } else { + this.updateParameter.withUniqueIdentifier(uniqueIdentifier); + } + return this; + } + + @Override + public LabImpl withUsageQuota(Period usageQuota) { + if (isInCreateMode()) { + this.inner().withUsageQuota(usageQuota); + } else { + this.updateParameter.withUsageQuota(usageQuota); + } + return this; + } + + @Override + public LabImpl withUserAccessMode(LabUserAccessMode userAccessMode) { + if (isInCreateMode()) { + this.inner().withUserAccessMode(userAccessMode); + } else { + this.updateParameter.withUserAccessMode(userAccessMode); + } + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabInner.java new file mode 100644 index 0000000000000..b4a9b09bdf166 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabInner.java @@ -0,0 +1,247 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import org.joda.time.Period; +import com.microsoft.azure.management.labservices.v2018_10_15.LabUserAccessMode; +import org.joda.time.DateTime; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Represents a lab. + */ +@JsonFlatten +@SkipParentValidation +public class LabInner extends Resource { + /** + * Maximum number of users allowed in the lab. + */ + @JsonProperty(value = "properties.maxUsersInLab") + private Integer maxUsersInLab; + + /** + * Maximum value MaxUsersInLab can be set to, as specified by the service. + */ + @JsonProperty(value = "properties.userQuota", access = JsonProperty.Access.WRITE_ONLY) + private Integer userQuota; + + /** + * 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 Period usageQuota; + + /** + * Lab user access mode (open to all vs. restricted to those listed on the + * lab). Possible values include: 'Restricted', 'Open'. + */ + @JsonProperty(value = "properties.userAccessMode") + private LabUserAccessMode userAccessMode; + + /** + * Lab creator name. + */ + @JsonProperty(value = "properties.createdByUserPrincipalName", access = JsonProperty.Access.WRITE_ONLY) + private String createdByUserPrincipalName; + + /** + * Creation date for the lab. + */ + @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdDate; + + /** + * 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 maximum number of users allowed in the lab. + * + * @return the maxUsersInLab value + */ + public Integer maxUsersInLab() { + return this.maxUsersInLab; + } + + /** + * Set maximum number of users allowed in the lab. + * + * @param maxUsersInLab the maxUsersInLab value to set + * @return the LabInner object itself. + */ + public LabInner withMaxUsersInLab(Integer maxUsersInLab) { + this.maxUsersInLab = maxUsersInLab; + return this; + } + + /** + * Get maximum value MaxUsersInLab can be set to, as specified by the service. + * + * @return the userQuota value + */ + public Integer userQuota() { + return this.userQuota; + } + + /** + * Get invitation code that users can use to join a lab. + * + * @return the invitationCode value + */ + public String invitationCode() { + return this.invitationCode; + } + + /** + * Get object id of the user that created the lab. + * + * @return the createdByObjectId value + */ + public String createdByObjectId() { + return this.createdByObjectId; + } + + /** + * Get maximum duration a user can use an environment for in the lab. + * + * @return the usageQuota value + */ + public Period usageQuota() { + return this.usageQuota; + } + + /** + * Set maximum duration a user can use an environment for in the lab. + * + * @param usageQuota the usageQuota value to set + * @return the LabInner object itself. + */ + public LabInner withUsageQuota(Period usageQuota) { + this.usageQuota = usageQuota; + return this; + } + + /** + * Get lab user access mode (open to all vs. restricted to those listed on the lab). Possible values include: 'Restricted', 'Open'. + * + * @return the userAccessMode value + */ + public LabUserAccessMode userAccessMode() { + return this.userAccessMode; + } + + /** + * Set lab user access mode (open to all vs. restricted to those listed on the lab). Possible values include: 'Restricted', 'Open'. + * + * @param userAccessMode the userAccessMode value to set + * @return the LabInner object itself. + */ + public LabInner withUserAccessMode(LabUserAccessMode userAccessMode) { + this.userAccessMode = userAccessMode; + return this; + } + + /** + * Get lab creator name. + * + * @return the createdByUserPrincipalName value + */ + public String createdByUserPrincipalName() { + return this.createdByUserPrincipalName; + } + + /** + * Get creation date for the lab. + * + * @return the createdDate value + */ + public DateTime createdDate() { + return this.createdDate; + } + + /** + * Get the provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning status of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the LabInner object itself. + */ + public LabInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set the unique immutable identifier of a resource (Guid). + * + * @param uniqueIdentifier the uniqueIdentifier value to set + * @return the LabInner object itself. + */ + public LabInner withUniqueIdentifier(String uniqueIdentifier) { + this.uniqueIdentifier = uniqueIdentifier; + return this; + } + + /** + * Get the details of the latest operation. ex: status, error. + * + * @return the latestOperationResult value + */ + public LatestOperationResult latestOperationResult() { + return this.latestOperationResult; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabServicesManager.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabServicesManager.java new file mode 100644 index 0000000000000..ca26ce2f0eae7 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabServicesManager.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.labservices.v2018_10_15.ProviderOperations; +import com.microsoft.azure.management.labservices.v2018_10_15.GlobalUsers; +import com.microsoft.azure.management.labservices.v2018_10_15.LabAccounts; +import com.microsoft.azure.management.labservices.v2018_10_15.Operations; +import com.microsoft.azure.management.labservices.v2018_10_15.GalleryImages; +import com.microsoft.azure.management.labservices.v2018_10_15.Labs; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentSettings; +import com.microsoft.azure.management.labservices.v2018_10_15.Environments; +import com.microsoft.azure.management.labservices.v2018_10_15.Users; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure LabServices resource management. + */ +public final class LabServicesManager extends ManagerCore { + private ProviderOperations providerOperations; + private GlobalUsers globalUsers; + private LabAccounts labAccounts; + private Operations operations; + private GalleryImages galleryImages; + private Labs labs; + private EnvironmentSettings environmentSettings; + private Environments environments; + private Users users; + /** + * Get a Configurable instance that can be used to create LabServicesManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new LabServicesManager.ConfigurableImpl(); + } + /** + * Creates an instance of LabServicesManager that exposes LabServices resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the LabServicesManager + */ + public static LabServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new LabServicesManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of LabServicesManager that exposes LabServices resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the LabServicesManager + */ + public static LabServicesManager authenticate(RestClient restClient, String subscriptionId) { + return new LabServicesManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of LabServicesManager that exposes LabServices management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing LabServices management API entry points that work across subscriptions + */ + LabServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ProviderOperations. + */ + public ProviderOperations providerOperations() { + if (this.providerOperations == null) { + this.providerOperations = new ProviderOperationsImpl(this); + } + return this.providerOperations; + } + + /** + * @return Entry point to manage GlobalUsers. + */ + public GlobalUsers globalUsers() { + if (this.globalUsers == null) { + this.globalUsers = new GlobalUsersImpl(this); + } + return this.globalUsers; + } + + /** + * @return Entry point to manage LabAccounts. + */ + public LabAccounts labAccounts() { + if (this.labAccounts == null) { + this.labAccounts = new LabAccountsImpl(this); + } + return this.labAccounts; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage GalleryImages. + */ + public GalleryImages galleryImages() { + if (this.galleryImages == null) { + this.galleryImages = new GalleryImagesImpl(this); + } + return this.galleryImages; + } + + /** + * @return Entry point to manage Labs. + */ + public Labs labs() { + if (this.labs == null) { + this.labs = new LabsImpl(this); + } + return this.labs; + } + + /** + * @return Entry point to manage EnvironmentSettings. + */ + public EnvironmentSettings environmentSettings() { + if (this.environmentSettings == null) { + this.environmentSettings = new EnvironmentSettingsImpl(this); + } + return this.environmentSettings; + } + + /** + * @return Entry point to manage Environments. + */ + public Environments environments() { + if (this.environments == null) { + this.environments = new EnvironmentsImpl(this); + } + return this.environments; + } + + /** + * @return Entry point to manage Users. + */ + public Users users() { + if (this.users == null) { + this.users = new UsersImpl(this); + } + return this.users; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public LabServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return LabServicesManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private LabServicesManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ManagedLabsClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsImpl.java new file mode 100644 index 0000000000000..e61de2b9c6bc7 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.Labs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.Lab; + +class LabsImpl extends WrapperImpl implements Labs { + private final LabServicesManager manager; + + LabsImpl(LabServicesManager manager) { + super(manager.inner().labs()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + @Override + public LabImpl define(String name) { + return wrapModel(name); + } + + private LabImpl wrapModel(LabInner inner) { + return new LabImpl(inner, manager()); + } + + private LabImpl wrapModel(String name) { + return new LabImpl(name, this.manager()); + } + + @Override + public Completable addUsersAsync(String resourceGroupName, String labAccountName, String labName, List emailAddresses) { + LabsInner client = this.inner(); + return client.addUsersAsync(resourceGroupName, labAccountName, labName, emailAddresses).toCompletable(); + } + + @Override + public Completable registerAsync(String resourceGroupName, String labAccountName, String labName) { + LabsInner client = this.inner(); + return client.registerAsync(resourceGroupName, labAccountName, labName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String labAccountName) { + LabsInner client = this.inner(); + return client.listAsync(resourceGroupName, labAccountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Lab call(LabInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String labAccountName, String labName) { + LabsInner client = this.inner(); + return client.getAsync(resourceGroupName, labAccountName, labName) + .map(new Func1() { + @Override + public Lab call(LabInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String labAccountName, String labName) { + LabsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, labAccountName, labName).toCompletable(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java new file mode 100644 index 0000000000000..5a83f20d0058f --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java @@ -0,0 +1,1229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.labservices.v2018_10_15.AddUsersPayload; +import com.microsoft.azure.management.labservices.v2018_10_15.LabFragment; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Labs. + */ +public class LabsInner { + /** The Retrofit service to perform REST calls. */ + private LabsService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of LabsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LabsInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(LabsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Labs to be + * used by Retrofit to perform actually REST calls. + */ + interface LabsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Query("$expand") String expand, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Body LabInner lab, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Body LabFragment lab, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs addUsers" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/addUsers") + Observable> addUsers(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AddUsersPayload addUsersPayload, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs register" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/register") + Observable> register(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Labs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List labs 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List labs in a given lab account. + * + * @param resourceGroupName The name of the resource group. + * @param labAccountName The name of the lab Account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List labs 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 + * @return the observable to the PagedList<LabInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List labs 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 + * @return the observable to the PagedList<LabInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName) { + return listSinglePageAsync(resourceGroupName, labAccountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List labs 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 + * @return the PagedList<LabInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List labs 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=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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List labs 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=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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List labs 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=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 + * @return the observable to the PagedList<LabInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, expand, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List labs 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=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 + * @return the observable to the PagedList<LabInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, labAccountName, expand, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List labs in a given lab account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param labAccountName The name of the lab Account. + ServiceResponse> * @param expand Specify the $expand query. Example: 'properties($select=maxUsersInLab)' + ServiceResponse> * @param filter The filter to apply to the operation. + ServiceResponse> * @param top The maximum number of resources to return from the operation. + ServiceResponse> * @param orderby The ordering expression for the results, using OData notation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String expand, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabInner object if successful. + */ + public LabInner get(String resourceGroupName, String labAccountName, String labName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName).toBlocking().single().body(); + } + + /** + * Get 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName), serviceCallback); + } + + /** + * Get 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 + * @return the observable to the LabInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName).map(new Func1, LabInner>() { + @Override + public LabInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 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 + * @return the observable to the LabInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get 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=maxUsersInLab)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabInner object if successful. + */ + public LabInner get(String resourceGroupName, String labAccountName, String labName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, expand).toBlocking().single().body(); + } + + /** + * Get 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=maxUsersInLab)' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, expand), serviceCallback); + } + + /** + * Get 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=maxUsersInLab)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LabInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, expand).map(new Func1, LabInner>() { + @Override + public LabInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 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=maxUsersInLab)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LabInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or replace an existing 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 lab Represents a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabInner object if successful. + */ + public LabInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, LabInner lab) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab).toBlocking().single().body(); + } + + /** + * Create or replace an existing 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 lab Represents a lab. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, LabInner lab, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab), serviceCallback); + } + + /** + * Create or replace an existing 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 lab Represents a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LabInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, LabInner lab) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab).map(new Func1, LabInner>() { + @Override + public LabInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or replace an existing 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 lab Represents a lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LabInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, LabInner lab) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (lab == null) { + throw new IllegalArgumentException("Parameter lab is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(lab); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, lab, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete lab. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String labAccountName, String labName) { + deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName).toBlocking().last().body(); + } + + /** + * Delete lab. 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String labAccountName, String labName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName), serviceCallback); + } + + /** + * Delete lab. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String labAccountName, String labName) { + return deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete lab. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete lab. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String labAccountName, String labName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName).toBlocking().single().body(); + } + + /** + * Delete lab. 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String labAccountName, String labName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName), serviceCallback); + } + + /** + * Delete lab. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String labAccountName, String labName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete lab. 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Modify properties of labs. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LabInner object if successful. + */ + public LabInner update(String resourceGroupName, String labAccountName, String labName, LabFragment lab) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab).toBlocking().single().body(); + } + + /** + * Modify properties of labs. + * + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String labAccountName, String labName, LabFragment lab, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab), serviceCallback); + } + + /** + * Modify properties of labs. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LabInner object + */ + public Observable updateAsync(String resourceGroupName, String labAccountName, String labName, LabFragment lab) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab).map(new Func1, LabInner>() { + @Override + public LabInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Modify properties of labs. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LabInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, LabFragment lab) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (lab == null) { + throw new IllegalArgumentException("Parameter lab is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(lab); + return service.update(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, lab, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add users 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 emailAddresses List of user emails addresses to add to the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void addUsers(String resourceGroupName, String labAccountName, String labName, List emailAddresses) { + addUsersWithServiceResponseAsync(resourceGroupName, labAccountName, labName, emailAddresses).toBlocking().single().body(); + } + + /** + * Add users 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 emailAddresses List of user emails addresses to add to the lab. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addUsersAsync(String resourceGroupName, String labAccountName, String labName, List emailAddresses, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addUsersWithServiceResponseAsync(resourceGroupName, labAccountName, labName, emailAddresses), serviceCallback); + } + + /** + * Add users 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 emailAddresses List of user emails addresses to add to the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable addUsersAsync(String resourceGroupName, String labAccountName, String labName, List emailAddresses) { + return addUsersWithServiceResponseAsync(resourceGroupName, labAccountName, labName, emailAddresses).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add users 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 emailAddresses List of user emails addresses to add to the lab. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> addUsersWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, List emailAddresses) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (emailAddresses == null) { + throw new IllegalArgumentException("Parameter emailAddresses is required and cannot be null."); + } + Validator.validate(emailAddresses); + AddUsersPayload addUsersPayload = new AddUsersPayload(); + addUsersPayload.withEmailAddresses(emailAddresses); + return service.addUsers(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, this.client.apiVersion(), this.client.acceptLanguage(), addUsersPayload, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addUsersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addUsersDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Register to managed 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void register(String resourceGroupName, String labAccountName, String labName) { + registerWithServiceResponseAsync(resourceGroupName, labAccountName, labName).toBlocking().single().body(); + } + + /** + * Register to managed 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture registerAsync(String resourceGroupName, String labAccountName, String labName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(registerWithServiceResponseAsync(resourceGroupName, labAccountName, labName), serviceCallback); + } + + /** + * Register to managed 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable registerAsync(String resourceGroupName, String labAccountName, String labName) { + return registerWithServiceResponseAsync(resourceGroupName, labAccountName, labName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Register to managed 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> registerWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.register(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = registerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse registerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List labs in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LabInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List labs in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List labs in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List labs in a given lab account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LabInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List labs in a given lab account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LabInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseImpl.java new file mode 100644 index 0000000000000..888a1988bd4c3 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.ListEnvironmentsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentDetails; + +class ListEnvironmentsResponseImpl extends WrapperImpl implements ListEnvironmentsResponse { + private final LabServicesManager manager; + ListEnvironmentsResponseImpl(ListEnvironmentsResponseInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public List environments() { + return this.inner().environments(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseInner.java new file mode 100644 index 0000000000000..fc3bb6e087e66 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListEnvironmentsResponseInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.EnvironmentDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the list of environments owned by a user. + */ +public class ListEnvironmentsResponseInner { + /** + * List of all the environments. + */ + @JsonProperty(value = "environments") + private List environments; + + /** + * Get list of all the environments. + * + * @return the environments value + */ + public List environments() { + return this.environments; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseImpl.java new file mode 100644 index 0000000000000..9e3435b05bf27 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.ListLabsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.LabDetails; + +class ListLabsResponseImpl extends WrapperImpl implements ListLabsResponse { + private final LabServicesManager manager; + ListLabsResponseImpl(ListLabsResponseInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public List labs() { + return this.inner().labs(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseInner.java new file mode 100644 index 0000000000000..38819b747748b --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ListLabsResponseInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.LabDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lists the labs owned by a user. + */ +public class ListLabsResponseInner { + /** + * List of all the labs. + */ + @JsonProperty(value = "labs") + private List labs; + + /** + * Get list of all the labs. + * + * @return the labs value + */ + public List labs() { + return this.labs; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ManagedLabsClientImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ManagedLabsClientImpl.java new file mode 100644 index 0000000000000..e5a325f83bcb3 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ManagedLabsClientImpl.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ManagedLabsClientImpl class. + */ +public class ManagedLabsClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The subscription ID. */ + private String subscriptionId; + + /** + * Gets The subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ManagedLabsClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ManagedLabsClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ManagedLabsClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ManagedLabsClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ProviderOperationsInner object to access its operations. + */ + private ProviderOperationsInner providerOperations; + + /** + * Gets the ProviderOperationsInner object to access its operations. + * @return the ProviderOperationsInner object. + */ + public ProviderOperationsInner providerOperations() { + return this.providerOperations; + } + + /** + * The GlobalUsersInner object to access its operations. + */ + private GlobalUsersInner globalUsers; + + /** + * Gets the GlobalUsersInner object to access its operations. + * @return the GlobalUsersInner object. + */ + public GlobalUsersInner globalUsers() { + return this.globalUsers; + } + + /** + * The LabAccountsInner object to access its operations. + */ + private LabAccountsInner labAccounts; + + /** + * Gets the LabAccountsInner object to access its operations. + * @return the LabAccountsInner object. + */ + public LabAccountsInner labAccounts() { + return this.labAccounts; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The GalleryImagesInner object to access its operations. + */ + private GalleryImagesInner galleryImages; + + /** + * Gets the GalleryImagesInner object to access its operations. + * @return the GalleryImagesInner object. + */ + public GalleryImagesInner galleryImages() { + return this.galleryImages; + } + + /** + * The LabsInner object to access its operations. + */ + private LabsInner labs; + + /** + * Gets the LabsInner object to access its operations. + * @return the LabsInner object. + */ + public LabsInner labs() { + return this.labs; + } + + /** + * The EnvironmentSettingsInner object to access its operations. + */ + private EnvironmentSettingsInner environmentSettings; + + /** + * Gets the EnvironmentSettingsInner object to access its operations. + * @return the EnvironmentSettingsInner object. + */ + public EnvironmentSettingsInner environmentSettings() { + return this.environmentSettings; + } + + /** + * The EnvironmentsInner object to access its operations. + */ + private EnvironmentsInner environments; + + /** + * Gets the EnvironmentsInner object to access its operations. + * @return the EnvironmentsInner object. + */ + public EnvironmentsInner environments() { + return this.environments; + } + + /** + * The UsersInner object to access its operations. + */ + private UsersInner users; + + /** + * Gets the UsersInner object to access its operations. + * @return the UsersInner object. + */ + public UsersInner users() { + return this.users; + } + + /** + * Initializes an instance of ManagedLabsClient client. + * + * @param credentials the management credentials for Azure + */ + public ManagedLabsClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ManagedLabsClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ManagedLabsClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ManagedLabsClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ManagedLabsClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-10-15"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.providerOperations = new ProviderOperationsInner(restClient().retrofit(), this); + this.globalUsers = new GlobalUsersInner(restClient().retrofit(), this); + this.labAccounts = new LabAccountsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.galleryImages = new GalleryImagesInner(restClient().retrofit(), this); + this.labs = new LabsInner(restClient().retrofit(), this); + this.environmentSettings = new EnvironmentSettingsInner(restClient().retrofit(), this); + this.environments = new EnvironmentsInner(restClient().retrofit(), this); + this.users = new UsersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ManagedLabsClient", "2018-10-15"); + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseImpl.java new file mode 100644 index 0000000000000..7818a79fb3324 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.OperationBatchStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationBatchStatusResponseItem; + +class OperationBatchStatusResponseImpl extends WrapperImpl implements OperationBatchStatusResponse { + private final LabServicesManager manager; + OperationBatchStatusResponseImpl(OperationBatchStatusResponseInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public List items() { + return this.inner().items(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseInner.java new file mode 100644 index 0000000000000..8d56561f44adc --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationBatchStatusResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import java.util.List; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationBatchStatusResponseItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status Details of the long running operation for an environment. + */ +public class OperationBatchStatusResponseInner { + /** + * Gets a collection of items that contain the operation url and status. + */ + @JsonProperty(value = "items", access = JsonProperty.Access.WRITE_ONLY) + private List items; + + /** + * Get gets a collection of items that contain the operation url and status. + * + * @return the items value + */ + public List items() { + return this.items; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataImpl.java new file mode 100644 index 0000000000000..af6c63cafa52d --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.OperationMetadata; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationMetadataDisplay; + +class OperationMetadataImpl extends WrapperImpl implements OperationMetadata { + private final LabServicesManager manager; + OperationMetadataImpl(OperationMetadataInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public OperationMetadataDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataInner.java new file mode 100644 index 0000000000000..d841faeb2a620 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationMetadataInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.OperationMetadataDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The REST API operation supported by ManagedLab ResourceProvider. + */ +public class OperationMetadataInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that describes the operations. + */ + @JsonProperty(value = "display") + private OperationMetadataDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 object that describes the operations. + * + * @return the display value + */ + public OperationMetadataDisplay display() { + return this.display; + } + + /** + * Set 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; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultImpl.java new file mode 100644 index 0000000000000..8ffec34a972fd --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.OperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationError; + +class OperationResultImpl extends WrapperImpl implements OperationResult { + private final LabServicesManager manager; + private String locationName; + private String operationName; + + OperationResultImpl(OperationResultInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + + + @Override + public OperationError error() { + return this.inner().error(); + } + + @Override + public String status() { + return this.inner().status(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultInner.java new file mode 100644 index 0000000000000..61405bf2f5a4a --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationResultInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.OperationError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Operation Result. + */ +public class OperationResultInner { + /** + * The operation status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Error details for the operation in case of a failure. + */ + @JsonProperty(value = "error") + private OperationError error; + + /** + * Get the operation status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the operation status. + * + * @param status the status value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get error details for the operation in case of a failure. + * + * @return the error value + */ + public OperationError error() { + return this.error; + } + + /** + * Set error details for the operation in case of a failure. + * + * @param error the error value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withError(OperationError error) { + this.error = error; + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseImpl.java new file mode 100644 index 0000000000000..e2c28d3ec768d --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.OperationStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class OperationStatusResponseImpl extends WrapperImpl implements OperationStatusResponse { + private final LabServicesManager manager; + OperationStatusResponseImpl(OperationStatusResponseInner inner, LabServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public String status() { + return this.inner().status(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseInner.java new file mode 100644 index 0000000000000..91ab1076f3505 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationStatusResponseInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status Details of the long running operation for an environment. + */ +public class OperationStatusResponseInner { + /** + * status of the long running operation for an environment. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Get status of the long running operation for an environment. + * + * @return the status value + */ + public String status() { + return this.status; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..6e179d7065e86 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.Operations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final LabServicesManager manager; + + OperationsImpl(LabServicesManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + private OperationResultImpl wrapModel(OperationResultInner inner) { + return new OperationResultImpl(inner, manager()); + } + + @Override + public Observable getAsync(String locationName, String operationName) { + OperationsInner client = this.inner(); + return client.getAsync(locationName, operationName) + .map(new Func1() { + @Override + public OperationResult call(OperationResultInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsInner.java new file mode 100644 index 0000000000000..18c140a750197 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/OperationsInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Operations get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{locationName}/operations/{operationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Path("operationName") String operationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get operation. + * + * @param locationName The name of the location. + * @param operationName The name of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationResultInner object if successful. + */ + public OperationResultInner get(String locationName, String operationName) { + return getWithServiceResponseAsync(locationName, operationName).toBlocking().single().body(); + } + + /** + * Get operation. + * + * @param locationName The name of the location. + * @param operationName The name of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String locationName, String operationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(locationName, operationName), serviceCallback); + } + + /** + * Get operation. + * + * @param locationName The name of the location. + * @param operationName The name of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationResultInner object + */ + public Observable getAsync(String locationName, String operationName) { + return getWithServiceResponseAsync(locationName, operationName).map(new Func1, OperationResultInner>() { + @Override + public OperationResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get operation. + * + * @param locationName The name of the location. + * @param operationName The name of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationResultInner object + */ + public Observable> getWithServiceResponseAsync(String locationName, String operationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (operationName == null) { + throw new IllegalArgumentException("Parameter operationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), locationName, operationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/PageImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/PageImpl.java new file mode 100644 index 0000000000000..ad59c1c65e1c3 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsImpl.java new file mode 100644 index 0000000000000..e9671b57a8dba --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.ProviderOperations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.labservices.v2018_10_15.OperationMetadata; + +class ProviderOperationsImpl extends WrapperImpl implements ProviderOperations { + private final LabServicesManager manager; + + ProviderOperationsImpl(LabServicesManager manager) { + super(manager.inner().providerOperations()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + ProviderOperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationMetadata call(OperationMetadataInner inner) { + return new OperationMetadataImpl(inner, manager()); + } + }); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsInner.java new file mode 100644 index 0000000000000..4d6924821b16b --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/ProviderOperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProviderOperations. + */ +public class ProviderOperationsInner { + /** The Retrofit service to perform REST calls. */ + private ProviderOperationsService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of ProviderOperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProviderOperationsInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(ProviderOperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProviderOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface ProviderOperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.ProviderOperations list" }) + @GET("providers/Microsoft.LabServices/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.ProviderOperations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Result of the request to list REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationMetadataInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Result of the request to list REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Result of the request to list REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationMetadataInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Result of the request to list REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationMetadataInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Result of the request to list REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationMetadataInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Result of the request to list REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationMetadataInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Result of the request to list REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Result of the request to list REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationMetadataInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Result of the request to list REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationMetadataInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Result of the request to list REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationMetadataInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserImpl.java new file mode 100644 index 0000000000000..0d315dab38a5d --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserImpl.java @@ -0,0 +1,212 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.management.labservices.v2018_10_15.User; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.labservices.v2018_10_15.UserFragment; +import java.util.Map; +import org.joda.time.Period; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import rx.functions.Func1; + +class UserImpl extends CreatableUpdatableImpl implements User, User.Definition, User.Update { + private final LabServicesManager manager; + private String resourceGroupName; + private String labAccountName; + private String labName; + private String userName; + private UserFragment updateParameter; + + UserImpl(String name, LabServicesManager manager) { + super(name, new UserInner()); + this.manager = manager; + // Set resource name + this.userName = name; + // + this.updateParameter = new UserFragment(); + } + + UserImpl(UserInner inner, LabServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.userName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.labAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "labaccounts"); + this.labName = IdParsingUtils.getValueFromIdByName(inner.id(), "labs"); + this.userName = IdParsingUtils.getValueFromIdByName(inner.id(), "users"); + // + this.updateParameter = new UserFragment(); + } + + @Override + public LabServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + UsersInner client = this.manager().inner().users(); + return client.createOrUpdateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.userName, this.inner()) + .map(new Func1() { + @Override + public UserInner call(UserInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + UsersInner client = this.manager().inner().users(); + return client.updateAsync(this.resourceGroupName, this.labAccountName, this.labName, this.userName, this.updateParameter) + .map(new Func1() { + @Override + public UserInner call(UserInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + UsersInner client = this.manager().inner().users(); + return client.getAsync(this.resourceGroupName, this.labAccountName, this.labName, this.userName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new UserFragment(); + } + + @Override + public String email() { + return this.inner().email(); + } + + @Override + public String familyName() { + return this.inner().familyName(); + } + + @Override + public String givenName() { + return this.inner().givenName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public LatestOperationResult latestOperationResult() { + return this.inner().latestOperationResult(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String tenantId() { + return this.inner().tenantId(); + } + + @Override + public Period totalUsage() { + return this.inner().totalUsage(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String uniqueIdentifier() { + return this.inner().uniqueIdentifier(); + } + + @Override + public UserImpl withExistingLab(String resourceGroupName, String labAccountName, String labName) { + this.resourceGroupName = resourceGroupName; + this.labAccountName = labAccountName; + this.labName = labName; + return this; + } + + @Override + public UserImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public UserImpl withProvisioningState(String provisioningState) { + if (isInCreateMode()) { + this.inner().withProvisioningState(provisioningState); + } else { + this.updateParameter.withProvisioningState(provisioningState); + } + return this; + } + + @Override + public UserImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public UserImpl withUniqueIdentifier(String uniqueIdentifier) { + if (isInCreateMode()) { + this.inner().withUniqueIdentifier(uniqueIdentifier); + } else { + this.updateParameter.withUniqueIdentifier(uniqueIdentifier); + } + return this; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserInner.java new file mode 100644 index 0000000000000..b8dbb370ff8c6 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UserInner.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import org.joda.time.Period; +import com.microsoft.azure.management.labservices.v2018_10_15.LatestOperationResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The User registered to a lab. + */ +@JsonFlatten +@SkipParentValidation +public class UserInner extends Resource { + /** + * The user email address, as it was specified during registration. + */ + @JsonProperty(value = "properties.email", access = JsonProperty.Access.WRITE_ONLY) + private String email; + + /** + * The user family name, as it was specified during registration. + */ + @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 Period 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; + + /** + * Get the user email address, as it was specified during registration. + * + * @return the email value + */ + public String email() { + return this.email; + } + + /** + * Get the user family name, as it was specified during registration. + * + * @return the familyName value + */ + public String familyName() { + return this.familyName; + } + + /** + * Get the user given name, as it was specified during registration. + * + * @return the givenName value + */ + public String givenName() { + return this.givenName; + } + + /** + * Get the user tenant ID, as it was specified during registration. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get how long the user has used his VMs in this lab. + * + * @return the totalUsage value + */ + public Period totalUsage() { + return this.totalUsage; + } + + /** + * Get the provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning status of the resource. + * + * @param provisioningState the provisioningState value to set + * @return the UserInner object itself. + */ + public UserInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the unique immutable identifier of a resource (Guid). + * + * @return the uniqueIdentifier value + */ + public String uniqueIdentifier() { + return this.uniqueIdentifier; + } + + /** + * Set the unique immutable identifier of a resource (Guid). + * + * @param uniqueIdentifier the uniqueIdentifier value to set + * @return the UserInner object itself. + */ + public UserInner withUniqueIdentifier(String uniqueIdentifier) { + this.uniqueIdentifier = uniqueIdentifier; + return this; + } + + /** + * Get the details of the latest operation. ex: status, error. + * + * @return the latestOperationResult value + */ + public LatestOperationResult latestOperationResult() { + return this.latestOperationResult; + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersImpl.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersImpl.java new file mode 100644 index 0000000000000..63dc0ef9d98d8 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.labservices.v2018_10_15.Users; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.labservices.v2018_10_15.User; + +class UsersImpl extends WrapperImpl implements Users { + private final LabServicesManager manager; + + UsersImpl(LabServicesManager manager) { + super(manager.inner().users()); + this.manager = manager; + } + + public LabServicesManager manager() { + return this.manager; + } + + @Override + public UserImpl define(String name) { + return wrapModel(name); + } + + private UserImpl wrapModel(UserInner inner) { + return new UserImpl(inner, manager()); + } + + private UserImpl wrapModel(String name) { + return new UserImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String labAccountName, final String labName) { + UsersInner client = this.inner(); + return client.listAsync(resourceGroupName, labAccountName, labName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public User call(UserInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + UsersInner client = this.inner(); + return client.getAsync(resourceGroupName, labAccountName, labName, userName) + .map(new Func1() { + @Override + public User call(UserInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + UsersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, labAccountName, labName, userName).toCompletable(); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java new file mode 100644 index 0000000000000..4575c4d104102 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/UsersInner.java @@ -0,0 +1,1083 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.labservices.v2018_10_15.UserFragment; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Users. + */ +public class UsersInner { + /** The Retrofit service to perform REST calls. */ + private UsersService service; + /** The service client containing this operation class. */ + private ManagedLabsClientImpl client; + + /** + * Initializes an instance of UsersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsersInner(Retrofit retrofit, ManagedLabsClientImpl client) { + this.service = retrofit.create(UsersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Users to be + * used by Retrofit to perform actually REST calls. + */ + interface UsersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Users list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Query("$expand") String expand, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Users get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("userName") String userName, @Query("$expand") String expand, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Users createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("userName") String userName, @Body UserInner user, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Users delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Users beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("userName") String userName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Users update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/users/{userName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("labAccountName") String labAccountName, @Path("labName") String labName, @Path("userName") String userName, @Body UserFragment user, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.labservices.v2018_10_15.Users listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List users 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UserInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String labName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, labName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List users 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, labName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List users 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 + * @return the observable to the PagedList<UserInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String labName) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, labName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List users 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 + * @return the observable to the PagedList<UserInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String labName) { + return listSinglePageAsync(resourceGroupName, labAccountName, labName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List users 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 + * @return the PagedList<UserInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String labName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List users 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=email)' + * @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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UserInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List users 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=email)' + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List users 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=email)' + * @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 + * @return the observable to the PagedList<UserInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List users 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=email)' + * @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 + * @return the observable to the PagedList<UserInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, labAccountName, labName, expand, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List users in a given lab. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param labAccountName The name of the lab Account. + ServiceResponse> * @param labName The name of the lab. + ServiceResponse> * @param expand Specify the $expand query. Example: 'properties($select=email)' + ServiceResponse> * @param filter The filter to apply to the operation. + ServiceResponse> * @param top The maximum number of resources to return from the operation. + ServiceResponse> * @param orderby The ordering expression for the results, using OData notation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String labAccountName, final String labName, final String expand, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, expand, filter, top, orderby, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UserInner object if successful. + */ + public UserInner get(String resourceGroupName, String labAccountName, String labName, String userName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName).toBlocking().single().body(); + } + + /** + * Get 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, String userName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName), serviceCallback); + } + + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, userName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get 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)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UserInner object if successful. + */ + public UserInner get(String resourceGroupName, String labAccountName, String labName, String userName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, expand).toBlocking().single().body(); + } + + /** + * Get 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String labAccountName, String labName, String userName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, expand), serviceCallback); + } + + /** + * Get 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)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable getAsync(String resourceGroupName, String labAccountName, String labName, String userName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, expand).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 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)' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String userName, String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, userName, expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or replace an existing 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UserInner object if successful. + */ + public UserInner createOrUpdate(String resourceGroupName, String labAccountName, String labName, String userName, UserInner user) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user).toBlocking().single().body(); + } + + /** + * Create or replace an existing 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserInner user, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user), serviceCallback); + } + + /** + * Create or replace an existing 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserInner user) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or replace an existing 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserInner user) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (user == null) { + throw new IllegalArgumentException("Parameter user is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(user); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, userName, user, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete user. 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 userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String labAccountName, String labName, String userName) { + deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName).toBlocking().last().body(); + } + + /** + * Delete user. 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 userName The name of the user. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String labAccountName, String labName, String userName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName), serviceCallback); + } + + /** + * Delete user. 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 userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + return deleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete user. 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 userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, userName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete user. 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 userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String labAccountName, String labName, String userName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName).toBlocking().single().body(); + } + + /** + * Delete user. 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 userName The name of the user. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String labAccountName, String labName, String userName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName), serviceCallback); + } + + /** + * Delete user. 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 userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete user. 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 userName The name of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String userName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, userName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Modify properties of users. + * + * @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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UserInner object if successful. + */ + public UserInner update(String resourceGroupName, String labAccountName, String labName, String userName, UserFragment user) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user).toBlocking().single().body(); + } + + /** + * Modify properties of users. + * + * @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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserFragment user, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user), serviceCallback); + } + + /** + * Modify properties of users. + * + * @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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable updateAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserFragment user) { + return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, userName, user).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Modify properties of users. + * + * @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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String userName, UserFragment user) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (labAccountName == null) { + throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null."); + } + if (labName == null) { + throw new IllegalArgumentException("Parameter labName is required and cannot be null."); + } + if (userName == null) { + throw new IllegalArgumentException("Parameter userName is required and cannot be null."); + } + if (user == null) { + throw new IllegalArgumentException("Parameter user is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(user); + return service.update(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, userName, user, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List users in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UserInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List users in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List users in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List users in a given lab. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List users in a given lab. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/package-info.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/package-info.java new file mode 100644 index 0000000000000..bfccaecdb3a89 --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ManagedLabsClient. + * The Managed Labs Client. + */ +package com.microsoft.azure.management.labservices.v2018_10_15.implementation; diff --git a/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/package-info.java b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/package-info.java new file mode 100644 index 0000000000000..ff0c29db59e8d --- /dev/null +++ b/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ManagedLabsClient. + * The Managed Labs Client. + */ +package com.microsoft.azure.management.labservices.v2018_10_15;