From d3a4807ad6f961ad88d29aca995ea6579745d879 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 29 Oct 2020 00:34:25 +0000 Subject: [PATCH] Generated from 1d4aadd284f2e6cc9bf2ad4f3f292501594419b5 --- .../mgmt-v2020_10_19_preview/pom.xml | 135 ++ .../v2020_10_19_preview/Application.java | 430 ++++++ .../v2020_10_19_preview/ApplicationGroup.java | 165 +++ .../ApplicationGroupPatch.java | 99 ++ .../ApplicationGroupType.java | 41 + .../ApplicationGroups.java | 25 + .../v2020_10_19_preview/ApplicationPatch.java | 337 +++++ .../v2020_10_19_preview/ApplicationType.java | 41 + .../v2020_10_19_preview/Applications.java | 53 + .../AzureEntityResource.java | 35 + .../CloudErrorProperties.java | 69 + .../CommandLineSetting.java | 44 + .../v2020_10_19_preview/Desktop.java | 107 ++ .../v2020_10_19_preview/DesktopList.java | 32 + .../v2020_10_19_preview/DesktopPatch.java | 98 ++ .../v2020_10_19_preview/Desktops.java | 40 + .../v2020_10_19_preview/ExpandMsixImage.java | 102 ++ .../v2020_10_19_preview/HostPool.java | 555 +++++++ .../v2020_10_19_preview/HostPoolPatch.java | 471 ++++++ .../v2020_10_19_preview/HostPoolType.java | 41 + .../v2020_10_19_preview/HostPools.java | 25 + .../v2020_10_19_preview/LoadBalancerType.java | 44 + .../v2020_10_19_preview/MSIXImageURI.java | 43 + .../v2020_10_19_preview/MSIXPackage.java | 313 ++++ .../v2020_10_19_preview/MSIXPackagePatch.java | 98 ++ .../v2020_10_19_preview/MSIXPackages.java | 53 + .../v2020_10_19_preview/MsixImages.java | 29 + .../MsixPackageApplications.java | 200 +++ .../MsixPackageDependencies.java | 95 ++ .../v2020_10_19_preview/Operations.java | 27 + .../PersonalDesktopAssignmentType.java | 41 + .../PreferredAppGroupType.java | 44 + .../v2020_10_19_preview/RegistrationInfo.java | 97 ++ .../RegistrationInfoPatch.java | 71 + .../RegistrationTokenOperation.java | 44 + .../RemoteApplicationType.java | 41 + .../ResourceProviderOperation.java | 69 + .../ResourceProviderOperationDisplay.java | 121 ++ .../ResourceProviderOperationList.java | 26 + .../v2020_10_19_preview/SSOSecretType.java | 47 + .../v2020_10_19_preview/SendMessage.java | 69 + .../v2020_10_19_preview/SessionHost.java | 145 ++ .../v2020_10_19_preview/SessionHostPatch.java | 72 + .../v2020_10_19_preview/SessionHosts.java | 52 + .../v2020_10_19_preview/SessionState.java | 53 + .../v2020_10_19_preview/StartMenuItem.java | 65 + .../v2020_10_19_preview/StartMenuItems.java | 29 + .../v2020_10_19_preview/Status.java | 53 + .../v2020_10_19_preview/UpdateState.java | 50 + .../v2020_10_19_preview/UserSession.java | 61 + .../v2020_10_19_preview/UserSessions.java | 89 ++ .../v2020_10_19_preview/Workspace.java | 156 ++ .../v2020_10_19_preview/WorkspacePatch.java | 125 ++ .../v2020_10_19_preview/Workspaces.java | 25 + .../implementation/ApplicationGroupImpl.java | 125 ++ .../implementation/ApplicationGroupInner.java | 141 ++ .../implementation/ApplicationGroupsImpl.java | 138 ++ .../ApplicationGroupsInner.java | 1205 +++++++++++++++ .../implementation/ApplicationImpl.java | 300 ++++ .../implementation/ApplicationInner.java | 343 +++++ .../implementation/ApplicationsImpl.java | 85 ++ .../implementation/ApplicationsInner.java | 799 ++++++++++ .../implementation/DesktopImpl.java | 140 ++ .../implementation/DesktopInner.java | 102 ++ .../implementation/DesktopListImpl.java | 37 + .../implementation/DesktopListInner.java | 60 + .../DesktopVirtualizationAPIClientImpl.java | 336 +++++ .../DesktopVirtualizationManager.java | 219 +++ .../implementation/DesktopsImpl.java | 63 + .../implementation/DesktopsInner.java | 436 ++++++ .../implementation/ExpandMsixImageImpl.java | 110 ++ .../implementation/ExpandMsixImageInner.java | 364 +++++ .../implementation/HostPoolImpl.java | 333 +++++ .../implementation/HostPoolInner.java | 493 +++++++ .../implementation/HostPoolsImpl.java | 138 ++ .../implementation/HostPoolsInner.java | 1068 ++++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/MSIXPackageImpl.java | 257 ++++ .../implementation/MSIXPackageInner.java | 311 ++++ .../implementation/MSIXPackagesImpl.java | 85 ++ .../implementation/MSIXPackagesInner.java | 799 ++++++++++ .../implementation/MsixImagesImpl.java | 49 + .../implementation/MsixImagesInner.java | 432 ++++++ .../implementation/OperationsImpl.java | 42 + .../implementation/OperationsInner.java | 128 ++ .../implementation/PageImpl.java | 75 + .../ResourceProviderOperationListImpl.java | 33 + .../ResourceProviderOperationListInner.java | 45 + .../implementation/SessionHostImpl.java | 186 +++ .../implementation/SessionHostInner.java | 345 +++++ .../implementation/SessionHostsImpl.java | 76 + .../implementation/SessionHostsInner.java | 782 ++++++++++ .../implementation/StartMenuItemImpl.java | 75 + .../implementation/StartMenuItemInner.java | 176 +++ .../implementation/StartMenuItemsImpl.java | 53 + .../implementation/StartMenuItemsInner.java | 303 ++++ .../implementation/UserSessionImpl.java | 73 + .../implementation/UserSessionInner.java | 155 ++ .../implementation/UserSessionsImpl.java | 102 ++ .../implementation/UserSessionsInner.java | 1290 +++++++++++++++++ .../implementation/WorkspaceImpl.java | 113 ++ .../implementation/WorkspaceInner.java | 99 ++ .../implementation/WorkspacesImpl.java | 138 ++ .../implementation/WorkspacesInner.java | 985 +++++++++++++ .../implementation/package-info.java | 10 + .../v2020_10_19_preview/package-info.java | 10 + 106 files changed, 19811 insertions(+) create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/pom.xml create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Application.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroup.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroups.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Applications.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/AzureEntityResource.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CloudErrorProperties.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CommandLineSetting.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktop.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopList.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktops.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ExpandMsixImage.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPool.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPools.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/LoadBalancerType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXImageURI.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackage.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackagePatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackages.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixImages.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageApplications.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageDependencies.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Operations.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PersonalDesktopAssignmentType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PreferredAppGroupType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfo.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfoPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationTokenOperation.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RemoteApplicationType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperation.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationDisplay.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationList.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SSOSecretType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SendMessage.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHost.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHostPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHosts.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionState.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItem.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItems.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Status.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UpdateState.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSession.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSessions.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspace.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/WorkspacePatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspaces.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationAPIClientImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationManager.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/IdParsingUtils.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/PageImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/package-info.java create mode 100644 sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/package-info.java diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/pom.xml b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/pom.xml new file mode 100644 index 0000000000000..ae42c53fd5c2e --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.desktopvirtualization.v2020_10_19_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-desktopvirtualization + 1.0.0-beta + jar + Microsoft Azure SDK for DesktopVirtualization Management + This package contains Microsoft DesktopVirtualization 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 + + 1.6.5 + + + + + + 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Application.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Application.java new file mode 100644 index 0000000000000..ffadcda571c54 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Application.java @@ -0,0 +1,430 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.ApplicationInner; +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.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import java.util.Map; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the applicationType value. + */ + RemoteApplicationType applicationType(); + + /** + * @return the commandLineArguments value. + */ + String commandLineArguments(); + + /** + * @return the commandLineSetting value. + */ + CommandLineSetting commandLineSetting(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the filePath value. + */ + String filePath(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the iconContent value. + */ + byte[] iconContent(); + + /** + * @return the iconHash value. + */ + String iconHash(); + + /** + * @return the iconIndex value. + */ + Integer iconIndex(); + + /** + * @return the iconPath value. + */ + String iconPath(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the msixPackageApplicationId value. + */ + String msixPackageApplicationId(); + + /** + * @return the msixPackageFamilyName value. + */ + String msixPackageFamilyName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the showInPortal value. + */ + Boolean showInPortal(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Application definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApplicationGroup, DefinitionStages.WithCommandLineSetting, DefinitionStages.WithCreate { + } + + /** + * Grouping of Application definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Application definition. + */ + interface Blank extends WithApplicationGroup { + } + + /** + * The stage of the application definition allowing to specify ApplicationGroup. + */ + interface WithApplicationGroup { + /** + * Specifies resourceGroupName, applicationGroupName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param applicationGroupName The name of the application group + * @return the next definition stage + */ + WithCommandLineSetting withExistingApplicationGroup(String resourceGroupName, String applicationGroupName); + } + + /** + * The stage of the application definition allowing to specify CommandLineSetting. + */ + interface WithCommandLineSetting { + /** + * Specifies commandLineSetting. + * @param commandLineSetting Specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require' + * @return the next definition stage + */ + WithCreate withCommandLineSetting(CommandLineSetting commandLineSetting); + } + + /** + * The stage of the application definition allowing to specify ApplicationType. + */ + interface WithApplicationType { + /** + * Specifies applicationType. + * @param applicationType Resource Type of Application. Possible values include: 'InBuilt', 'MsixApplication' + * @return the next definition stage + */ + WithCreate withApplicationType(RemoteApplicationType applicationType); + } + + /** + * The stage of the application definition allowing to specify CommandLineArguments. + */ + interface WithCommandLineArguments { + /** + * Specifies commandLineArguments. + * @param commandLineArguments Command Line Arguments for Application + * @return the next definition stage + */ + WithCreate withCommandLineArguments(String commandLineArguments); + } + + /** + * The stage of the application definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of Application + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the application definition allowing to specify FilePath. + */ + interface WithFilePath { + /** + * Specifies filePath. + * @param filePath Specifies a path for the executable file for the application + * @return the next definition stage + */ + WithCreate withFilePath(String filePath); + } + + /** + * The stage of the application definition allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of Application + * @return the next definition stage + */ + WithCreate withFriendlyName(String friendlyName); + } + + /** + * The stage of the application definition allowing to specify IconIndex. + */ + interface WithIconIndex { + /** + * Specifies iconIndex. + * @param iconIndex Index of the icon + * @return the next definition stage + */ + WithCreate withIconIndex(Integer iconIndex); + } + + /** + * The stage of the application definition allowing to specify IconPath. + */ + interface WithIconPath { + /** + * Specifies iconPath. + * @param iconPath Path to icon + * @return the next definition stage + */ + WithCreate withIconPath(String iconPath); + } + + /** + * The stage of the application definition allowing to specify MsixPackageApplicationId. + */ + interface WithMsixPackageApplicationId { + /** + * Specifies msixPackageApplicationId. + * @param msixPackageApplicationId Specifies the package application Id for MSIX applications + * @return the next definition stage + */ + WithCreate withMsixPackageApplicationId(String msixPackageApplicationId); + } + + /** + * The stage of the application definition allowing to specify MsixPackageFamilyName. + */ + interface WithMsixPackageFamilyName { + /** + * Specifies msixPackageFamilyName. + * @param msixPackageFamilyName Specifies the package family name for MSIX applications + * @return the next definition stage + */ + WithCreate withMsixPackageFamilyName(String msixPackageFamilyName); + } + + /** + * The stage of the application definition allowing to specify ShowInPortal. + */ + interface WithShowInPortal { + /** + * Specifies showInPortal. + * @param showInPortal Specifies whether to show the RemoteApp program in the RD Web Access server + * @return the next definition stage + */ + WithCreate withShowInPortal(Boolean showInPortal); + } + + /** + * 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.WithApplicationType, DefinitionStages.WithCommandLineArguments, DefinitionStages.WithDescription, DefinitionStages.WithFilePath, DefinitionStages.WithFriendlyName, DefinitionStages.WithIconIndex, DefinitionStages.WithIconPath, DefinitionStages.WithMsixPackageApplicationId, DefinitionStages.WithMsixPackageFamilyName, DefinitionStages.WithShowInPortal { + } + } + /** + * The template for a Application update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithApplicationType, UpdateStages.WithCommandLineArguments, UpdateStages.WithCommandLineSetting, UpdateStages.WithDescription, UpdateStages.WithFilePath, UpdateStages.WithFriendlyName, UpdateStages.WithIconIndex, UpdateStages.WithIconPath, UpdateStages.WithMsixPackageApplicationId, UpdateStages.WithMsixPackageFamilyName, UpdateStages.WithShowInPortal, UpdateStages.WithTags { + } + + /** + * Grouping of Application update stages. + */ + interface UpdateStages { + /** + * The stage of the application update allowing to specify ApplicationType. + */ + interface WithApplicationType { + /** + * Specifies applicationType. + * @param applicationType Resource Type of Application. Possible values include: 'InBuilt', 'MsixApplication' + * @return the next update stage + */ + Update withApplicationType(RemoteApplicationType applicationType); + } + + /** + * The stage of the application update allowing to specify CommandLineArguments. + */ + interface WithCommandLineArguments { + /** + * Specifies commandLineArguments. + * @param commandLineArguments Command Line Arguments for Application + * @return the next update stage + */ + Update withCommandLineArguments(String commandLineArguments); + } + + /** + * The stage of the application update allowing to specify CommandLineSetting. + */ + interface WithCommandLineSetting { + /** + * Specifies commandLineSetting. + * @param commandLineSetting Specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require' + * @return the next update stage + */ + Update withCommandLineSetting(CommandLineSetting commandLineSetting); + } + + /** + * The stage of the application update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of Application + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the application update allowing to specify FilePath. + */ + interface WithFilePath { + /** + * Specifies filePath. + * @param filePath Specifies a path for the executable file for the application + * @return the next update stage + */ + Update withFilePath(String filePath); + } + + /** + * The stage of the application update allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of Application + * @return the next update stage + */ + Update withFriendlyName(String friendlyName); + } + + /** + * The stage of the application update allowing to specify IconIndex. + */ + interface WithIconIndex { + /** + * Specifies iconIndex. + * @param iconIndex Index of the icon + * @return the next update stage + */ + Update withIconIndex(Integer iconIndex); + } + + /** + * The stage of the application update allowing to specify IconPath. + */ + interface WithIconPath { + /** + * Specifies iconPath. + * @param iconPath Path to icon + * @return the next update stage + */ + Update withIconPath(String iconPath); + } + + /** + * The stage of the application update allowing to specify MsixPackageApplicationId. + */ + interface WithMsixPackageApplicationId { + /** + * Specifies msixPackageApplicationId. + * @param msixPackageApplicationId Specifies the package application Id for MSIX applications + * @return the next update stage + */ + Update withMsixPackageApplicationId(String msixPackageApplicationId); + } + + /** + * The stage of the application update allowing to specify MsixPackageFamilyName. + */ + interface WithMsixPackageFamilyName { + /** + * Specifies msixPackageFamilyName. + * @param msixPackageFamilyName Specifies the package family name for MSIX applications + * @return the next update stage + */ + Update withMsixPackageFamilyName(String msixPackageFamilyName); + } + + /** + * The stage of the application update allowing to specify ShowInPortal. + */ + interface WithShowInPortal { + /** + * Specifies showInPortal. + * @param showInPortal Specifies whether to show the RemoteApp program in the RD Web Access server + * @return the next update stage + */ + Update withShowInPortal(Boolean showInPortal); + } + + /** + * The stage of the application update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags tags to be updated + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroup.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroup.java new file mode 100644 index 0000000000000..88e20bab24080 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroup.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.desktopvirtualization.v2020_10_19_preview; + +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.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.ApplicationGroupInner; + +/** + * Type representing ApplicationGroup. + */ +public interface ApplicationGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationGroupType value. + */ + ApplicationGroupType applicationGroupType(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the hostPoolArmPath value. + */ + String hostPoolArmPath(); + + /** + * @return the workspaceArmPath value. + */ + String workspaceArmPath(); + + /** + * The entirety of the ApplicationGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithApplicationGroupType, DefinitionStages.WithHostPoolArmPath, DefinitionStages.WithCreate { + } + + /** + * Grouping of ApplicationGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ApplicationGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ApplicationGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the applicationgroup definition allowing to specify ApplicationGroupType. + */ + interface WithApplicationGroupType { + /** + * Specifies applicationGroupType. + * @param applicationGroupType Resource Type of ApplicationGroup. Possible values include: 'RemoteApp', 'Desktop' + * @return the next definition stage +*/ + WithHostPoolArmPath withApplicationGroupType(ApplicationGroupType applicationGroupType); + } + + /** + * The stage of the applicationgroup definition allowing to specify HostPoolArmPath. + */ + interface WithHostPoolArmPath { + /** + * Specifies hostPoolArmPath. + * @param hostPoolArmPath HostPool arm path of ApplicationGroup + * @return the next definition stage +*/ + WithCreate withHostPoolArmPath(String hostPoolArmPath); + } + + /** + * The stage of the applicationgroup definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of ApplicationGroup + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the applicationgroup definition allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of ApplicationGroup + * @return the next definition stage + */ + WithCreate withFriendlyName(String friendlyName); + } + + /** + * 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.WithDescription, DefinitionStages.WithFriendlyName { + } + } + /** + * The template for a ApplicationGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName { + } + + /** + * Grouping of ApplicationGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the applicationgroup update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of ApplicationGroup + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the applicationgroup update allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of ApplicationGroup + * @return the next update stage + */ + Update withFriendlyName(String friendlyName); + } + + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupPatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupPatch.java new file mode 100644 index 0000000000000..e46e50512b5b8 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupPatch.java @@ -0,0 +1,99 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * ApplicationGroup properties that can be patched. + */ +@JsonFlatten +public class ApplicationGroupPatch extends ProxyResource { + /** + * tags to be updated. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Description of ApplicationGroup. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of ApplicationGroup. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Get tags to be updated. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags to be updated. + * + * @param tags the tags value to set + * @return the ApplicationGroupPatch object itself. + */ + public ApplicationGroupPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get description of ApplicationGroup. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of ApplicationGroup. + * + * @param description the description value to set + * @return the ApplicationGroupPatch object itself. + */ + public ApplicationGroupPatch withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of ApplicationGroup. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of ApplicationGroup. + * + * @param friendlyName the friendlyName value to set + * @return the ApplicationGroupPatch object itself. + */ + public ApplicationGroupPatch withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupType.java new file mode 100644 index 0000000000000..167b2a0e281fa --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroupType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationGroupType. + */ +public final class ApplicationGroupType extends ExpandableStringEnum { + /** Static value RemoteApp for ApplicationGroupType. */ + public static final ApplicationGroupType REMOTE_APP = fromString("RemoteApp"); + + /** Static value Desktop for ApplicationGroupType. */ + public static final ApplicationGroupType DESKTOP = fromString("Desktop"); + + /** + * Creates or finds a ApplicationGroupType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationGroupType + */ + @JsonCreator + public static ApplicationGroupType fromString(String name) { + return fromString(name, ApplicationGroupType.class); + } + + /** + * @return known ApplicationGroupType values + */ + public static Collection values() { + return values(ApplicationGroupType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroups.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroups.java new file mode 100644 index 0000000000000..dafc607f431ff --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationGroups.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.desktopvirtualization.v2020_10_19_preview; + +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 com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.ApplicationGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationGroups. + */ +public interface ApplicationGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationPatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationPatch.java new file mode 100644 index 0000000000000..daab5b63d28cb --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationPatch.java @@ -0,0 +1,337 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Application properties that can be patched. + */ +@JsonFlatten +public class ApplicationPatch { + /** + * tags to be updated. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Description of Application. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of Application. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Specifies a path for the executable file for the application. + */ + @JsonProperty(value = "properties.filePath") + private String filePath; + + /** + * Specifies whether this published application can be launched with + * command line arguments provided by the client, command line arguments + * specified at publish time, or no command line arguments at all. Possible + * values include: 'DoNotAllow', 'Allow', 'Require'. + */ + @JsonProperty(value = "properties.commandLineSetting") + private CommandLineSetting commandLineSetting; + + /** + * Command Line Arguments for Application. + */ + @JsonProperty(value = "properties.commandLineArguments") + private String commandLineArguments; + + /** + * Specifies whether to show the RemoteApp program in the RD Web Access + * server. + */ + @JsonProperty(value = "properties.showInPortal") + private Boolean showInPortal; + + /** + * Path to icon. + */ + @JsonProperty(value = "properties.iconPath") + private String iconPath; + + /** + * Index of the icon. + */ + @JsonProperty(value = "properties.iconIndex") + private Integer iconIndex; + + /** + * Specifies the package family name for MSIX applications. + */ + @JsonProperty(value = "properties.msixPackageFamilyName") + private String msixPackageFamilyName; + + /** + * Specifies the package application Id for MSIX applications. + */ + @JsonProperty(value = "properties.msixPackageApplicationId") + private String msixPackageApplicationId; + + /** + * Resource Type of Application. Possible values include: 'InBuilt', + * 'MsixApplication'. + */ + @JsonProperty(value = "properties.applicationType") + private RemoteApplicationType applicationType; + + /** + * Get tags to be updated. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags to be updated. + * + * @param tags the tags value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get description of Application. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of Application. + * + * @param description the description value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of Application. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of Application. + * + * @param friendlyName the friendlyName value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get specifies a path for the executable file for the application. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set specifies a path for the executable file for the application. + * + * @param filePath the filePath value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require'. + * + * @return the commandLineSetting value + */ + public CommandLineSetting commandLineSetting() { + return this.commandLineSetting; + } + + /** + * Set specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require'. + * + * @param commandLineSetting the commandLineSetting value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withCommandLineSetting(CommandLineSetting commandLineSetting) { + this.commandLineSetting = commandLineSetting; + return this; + } + + /** + * Get command Line Arguments for Application. + * + * @return the commandLineArguments value + */ + public String commandLineArguments() { + return this.commandLineArguments; + } + + /** + * Set command Line Arguments for Application. + * + * @param commandLineArguments the commandLineArguments value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withCommandLineArguments(String commandLineArguments) { + this.commandLineArguments = commandLineArguments; + return this; + } + + /** + * Get specifies whether to show the RemoteApp program in the RD Web Access server. + * + * @return the showInPortal value + */ + public Boolean showInPortal() { + return this.showInPortal; + } + + /** + * Set specifies whether to show the RemoteApp program in the RD Web Access server. + * + * @param showInPortal the showInPortal value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withShowInPortal(Boolean showInPortal) { + this.showInPortal = showInPortal; + return this; + } + + /** + * Get path to icon. + * + * @return the iconPath value + */ + public String iconPath() { + return this.iconPath; + } + + /** + * Set path to icon. + * + * @param iconPath the iconPath value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withIconPath(String iconPath) { + this.iconPath = iconPath; + return this; + } + + /** + * Get index of the icon. + * + * @return the iconIndex value + */ + public Integer iconIndex() { + return this.iconIndex; + } + + /** + * Set index of the icon. + * + * @param iconIndex the iconIndex value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withIconIndex(Integer iconIndex) { + this.iconIndex = iconIndex; + return this; + } + + /** + * Get specifies the package family name for MSIX applications. + * + * @return the msixPackageFamilyName value + */ + public String msixPackageFamilyName() { + return this.msixPackageFamilyName; + } + + /** + * Set specifies the package family name for MSIX applications. + * + * @param msixPackageFamilyName the msixPackageFamilyName value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withMsixPackageFamilyName(String msixPackageFamilyName) { + this.msixPackageFamilyName = msixPackageFamilyName; + return this; + } + + /** + * Get specifies the package application Id for MSIX applications. + * + * @return the msixPackageApplicationId value + */ + public String msixPackageApplicationId() { + return this.msixPackageApplicationId; + } + + /** + * Set specifies the package application Id for MSIX applications. + * + * @param msixPackageApplicationId the msixPackageApplicationId value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withMsixPackageApplicationId(String msixPackageApplicationId) { + this.msixPackageApplicationId = msixPackageApplicationId; + return this; + } + + /** + * Get resource Type of Application. Possible values include: 'InBuilt', 'MsixApplication'. + * + * @return the applicationType value + */ + public RemoteApplicationType applicationType() { + return this.applicationType; + } + + /** + * Set resource Type of Application. Possible values include: 'InBuilt', 'MsixApplication'. + * + * @param applicationType the applicationType value to set + * @return the ApplicationPatch object itself. + */ + public ApplicationPatch withApplicationType(RemoteApplicationType applicationType) { + this.applicationType = applicationType; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationType.java new file mode 100644 index 0000000000000..24c694eb7757e --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ApplicationType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationType. + */ +public final class ApplicationType extends ExpandableStringEnum { + /** Static value RemoteApp for ApplicationType. */ + public static final ApplicationType REMOTE_APP = fromString("RemoteApp"); + + /** Static value Desktop for ApplicationType. */ + public static final ApplicationType DESKTOP = fromString("Desktop"); + + /** + * Creates or finds a ApplicationType from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationType + */ + @JsonCreator + public static ApplicationType fromString(String name) { + return fromString(name, ApplicationType.class); + } + + /** + * @return known ApplicationType values + */ + public static Collection values() { + return values(ApplicationType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Applications.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Applications.java new file mode 100644 index 0000000000000..9881618049cb9 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Applications.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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends SupportsCreating, HasInner { + /** + * Get an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String applicationGroupName, String applicationName); + + /** + * List applications. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String applicationGroupName); + + /** + * Remove an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/AzureEntityResource.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/AzureEntityResource.java new file mode 100644 index 0000000000000..5d630b124b938 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/AzureEntityResource.java @@ -0,0 +1,35 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Entity Resource. + * The resource model definition for an Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CloudErrorProperties.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CloudErrorProperties.java new file mode 100644 index 0000000000000..1b5242d314e3c --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CloudErrorProperties.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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CloudErrorProperties model. + */ +public class CloudErrorProperties { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the CloudErrorProperties object itself. + */ + public CloudErrorProperties withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the CloudErrorProperties object itself. + */ + public CloudErrorProperties withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CommandLineSetting.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CommandLineSetting.java new file mode 100644 index 0000000000000..6dc8e922a9138 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/CommandLineSetting.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CommandLineSetting. + */ +public final class CommandLineSetting extends ExpandableStringEnum { + /** Static value DoNotAllow for CommandLineSetting. */ + public static final CommandLineSetting DO_NOT_ALLOW = fromString("DoNotAllow"); + + /** Static value Allow for CommandLineSetting. */ + public static final CommandLineSetting ALLOW = fromString("Allow"); + + /** Static value Require for CommandLineSetting. */ + public static final CommandLineSetting REQUIRE = fromString("Require"); + + /** + * Creates or finds a CommandLineSetting from its string representation. + * @param name a name to look for + * @return the corresponding CommandLineSetting + */ + @JsonCreator + public static CommandLineSetting fromString(String name) { + return fromString(name, CommandLineSetting.class); + } + + /** + * @return known CommandLineSetting values + */ + public static Collection values() { + return values(CommandLineSetting.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktop.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktop.java new file mode 100644 index 0000000000000..af0547e92036f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktop.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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopInner; +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.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import java.util.Map; + +/** + * Type representing Desktop. + */ +public interface Desktop extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the iconContent value. + */ + byte[] iconContent(); + + /** + * @return the iconHash value. + */ + String iconHash(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a Desktop update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, UpdateStages.WithTags { + } + + /** + * Grouping of Desktop update stages. + */ + interface UpdateStages { + /** + * The stage of the desktop update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of Desktop + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the desktop update allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of Desktop + * @return the next update stage + */ + Update withFriendlyName(String friendlyName); + } + + /** + * The stage of the desktop update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags tags to be updated + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopList.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopList.java new file mode 100644 index 0000000000000..a9c1368a189e4 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopList.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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopListInner; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopInner; +import java.util.List; + +/** + * Type representing DesktopList. + */ +public interface DesktopList extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopPatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopPatch.java new file mode 100644 index 0000000000000..d152800a38d18 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/DesktopPatch.java @@ -0,0 +1,98 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Desktop properties that can be patched. + */ +@JsonFlatten +public class DesktopPatch { + /** + * tags to be updated. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Description of Desktop. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of Desktop. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Get tags to be updated. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags to be updated. + * + * @param tags the tags value to set + * @return the DesktopPatch object itself. + */ + public DesktopPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get description of Desktop. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of Desktop. + * + * @param description the description value to set + * @return the DesktopPatch object itself. + */ + public DesktopPatch withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of Desktop. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of Desktop. + * + * @param friendlyName the friendlyName value to set + * @return the DesktopPatch object itself. + */ + public DesktopPatch withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktops.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktops.java new file mode 100644 index 0000000000000..2a51508b43e2e --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Desktops.java @@ -0,0 +1,40 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Desktops. + */ +public interface Desktops extends HasInner { + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String applicationGroupName); + + /** + * Get a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String applicationGroupName, String desktopName); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ExpandMsixImage.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ExpandMsixImage.java new file mode 100644 index 0000000000000..82dbd83a9fa92 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ExpandMsixImage.java @@ -0,0 +1,102 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.ExpandMsixImageInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing ExpandMsixImage. + */ +public interface ExpandMsixImage extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the imagePath value. + */ + String imagePath(); + + /** + * @return the isActive value. + */ + boolean isActive(); + + /** + * @return the isRegularRegistration value. + */ + boolean isRegularRegistration(); + + /** + * @return the lastUpdated value. + */ + DateTime lastUpdated(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the packageAlias value. + */ + String packageAlias(); + + /** + * @return the packageApplications value. + */ + List packageApplications(); + + /** + * @return the packageDependencies value. + */ + List packageDependencies(); + + /** + * @return the packageFamilyName value. + */ + String packageFamilyName(); + + /** + * @return the packageFullName value. + */ + String packageFullName(); + + /** + * @return the packageName value. + */ + String packageName(); + + /** + * @return the packageRelativePath value. + */ + String packageRelativePath(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPool.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPool.java new file mode 100644 index 0000000000000..75a015ce47e1d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPool.java @@ -0,0 +1,555 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +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.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.HostPoolInner; + +/** + * Type representing HostPool. + */ +public interface HostPool extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationGroupReferences value. + */ + List applicationGroupReferences(); + + /** + * @return the customRdpProperty value. + */ + String customRdpProperty(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the hostPoolType value. + */ + HostPoolType hostPoolType(); + + /** + * @return the loadBalancerType value. + */ + LoadBalancerType loadBalancerType(); + + /** + * @return the maxSessionLimit value. + */ + Integer maxSessionLimit(); + + /** + * @return the personalDesktopAssignmentType value. + */ + PersonalDesktopAssignmentType personalDesktopAssignmentType(); + + /** + * @return the preferredAppGroupType value. + */ + PreferredAppGroupType preferredAppGroupType(); + + /** + * @return the registrationInfo value. + */ + RegistrationInfo registrationInfo(); + + /** + * @return the ring value. + */ + Integer ring(); + + /** + * @return the ssoadfsAuthority value. + */ + String ssoadfsAuthority(); + + /** + * @return the ssoClientId value. + */ + String ssoClientId(); + + /** + * @return the ssoClientSecretKeyVaultPath value. + */ + String ssoClientSecretKeyVaultPath(); + + /** + * @return the ssoContext value. + */ + String ssoContext(); + + /** + * @return the ssoSecretType value. + */ + SSOSecretType ssoSecretType(); + + /** + * @return the validationEnvironment value. + */ + Boolean validationEnvironment(); + + /** + * @return the vmTemplate value. + */ + String vmTemplate(); + + /** + * The entirety of the HostPool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithHostPoolType, DefinitionStages.WithLoadBalancerType, DefinitionStages.WithPreferredAppGroupType, DefinitionStages.WithCreate { + } + + /** + * Grouping of HostPool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a HostPool definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the HostPool definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the hostpool definition allowing to specify HostPoolType. + */ + interface WithHostPoolType { + /** + * Specifies hostPoolType. + * @param hostPoolType HostPool type for desktop. Possible values include: 'Personal', 'Pooled' + * @return the next definition stage +*/ + WithLoadBalancerType withHostPoolType(HostPoolType hostPoolType); + } + + /** + * The stage of the hostpool definition allowing to specify LoadBalancerType. + */ + interface WithLoadBalancerType { + /** + * Specifies loadBalancerType. + * @param loadBalancerType The type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + * @return the next definition stage +*/ + WithPreferredAppGroupType withLoadBalancerType(LoadBalancerType loadBalancerType); + } + + /** + * The stage of the hostpool definition allowing to specify PreferredAppGroupType. + */ + interface WithPreferredAppGroupType { + /** + * Specifies preferredAppGroupType. + * @param preferredAppGroupType The type of preferred application group type, default to Desktop Application Group. Possible values include: 'None', 'Desktop', 'RailApplications' + * @return the next definition stage +*/ + WithCreate withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType); + } + + /** + * The stage of the hostpool definition allowing to specify CustomRdpProperty. + */ + interface WithCustomRdpProperty { + /** + * Specifies customRdpProperty. + * @param customRdpProperty Custom rdp property of HostPool + * @return the next definition stage + */ + WithCreate withCustomRdpProperty(String customRdpProperty); + } + + /** + * The stage of the hostpool definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of HostPool + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the hostpool definition allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of HostPool + * @return the next definition stage + */ + WithCreate withFriendlyName(String friendlyName); + } + + /** + * The stage of the hostpool definition allowing to specify MaxSessionLimit. + */ + interface WithMaxSessionLimit { + /** + * Specifies maxSessionLimit. + * @param maxSessionLimit The max session limit of HostPool + * @return the next definition stage + */ + WithCreate withMaxSessionLimit(Integer maxSessionLimit); + } + + /** + * The stage of the hostpool definition allowing to specify PersonalDesktopAssignmentType. + */ + interface WithPersonalDesktopAssignmentType { + /** + * Specifies personalDesktopAssignmentType. + * @param personalDesktopAssignmentType PersonalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct' + * @return the next definition stage + */ + WithCreate withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType); + } + + /** + * The stage of the hostpool definition allowing to specify RegistrationInfo. + */ + interface WithRegistrationInfo { + /** + * Specifies registrationInfo. + * @param registrationInfo The registration info of HostPool + * @return the next definition stage + */ + WithCreate withRegistrationInfo(RegistrationInfo registrationInfo); + } + + /** + * The stage of the hostpool definition allowing to specify Ring. + */ + interface WithRing { + /** + * Specifies ring. + * @param ring The ring number of HostPool + * @return the next definition stage + */ + WithCreate withRing(Integer ring); + } + + /** + * The stage of the hostpool definition allowing to specify SsoadfsAuthority. + */ + interface WithSsoadfsAuthority { + /** + * Specifies ssoadfsAuthority. + * @param ssoadfsAuthority URL to customer ADFS server for signing WVD SSO certificates + * @return the next definition stage + */ + WithCreate withSsoadfsAuthority(String ssoadfsAuthority); + } + + /** + * The stage of the hostpool definition allowing to specify SsoClientId. + */ + interface WithSsoClientId { + /** + * Specifies ssoClientId. + * @param ssoClientId ClientId for the registered Relying Party used to issue WVD SSO certificates + * @return the next definition stage + */ + WithCreate withSsoClientId(String ssoClientId); + } + + /** + * The stage of the hostpool definition allowing to specify SsoClientSecretKeyVaultPath. + */ + interface WithSsoClientSecretKeyVaultPath { + /** + * Specifies ssoClientSecretKeyVaultPath. + * @param ssoClientSecretKeyVaultPath Path to Azure KeyVault storing the secret used for communication to ADFS + * @return the next definition stage + */ + WithCreate withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath); + } + + /** + * The stage of the hostpool definition allowing to specify SsoContext. + */ + interface WithSsoContext { + /** + * Specifies ssoContext. + * @param ssoContext Path to keyvault containing ssoContext secret + * @return the next definition stage + */ + WithCreate withSsoContext(String ssoContext); + } + + /** + * The stage of the hostpool definition allowing to specify SsoSecretType. + */ + interface WithSsoSecretType { + /** + * Specifies ssoSecretType. + * @param ssoSecretType The type of single sign on Secret Type. Possible values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault' + * @return the next definition stage + */ + WithCreate withSsoSecretType(SSOSecretType ssoSecretType); + } + + /** + * The stage of the hostpool definition allowing to specify ValidationEnvironment. + */ + interface WithValidationEnvironment { + /** + * Specifies validationEnvironment. + * @param validationEnvironment Is validation environment + * @return the next definition stage + */ + WithCreate withValidationEnvironment(Boolean validationEnvironment); + } + + /** + * The stage of the hostpool definition allowing to specify VmTemplate. + */ + interface WithVmTemplate { + /** + * Specifies vmTemplate. + * @param vmTemplate VM template for sessionhosts configuration within hostpool + * @return the next definition stage + */ + WithCreate withVmTemplate(String vmTemplate); + } + + /** + * 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.WithCustomRdpProperty, DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithMaxSessionLimit, DefinitionStages.WithPersonalDesktopAssignmentType, DefinitionStages.WithRegistrationInfo, DefinitionStages.WithRing, DefinitionStages.WithSsoadfsAuthority, DefinitionStages.WithSsoClientId, DefinitionStages.WithSsoClientSecretKeyVaultPath, DefinitionStages.WithSsoContext, DefinitionStages.WithSsoSecretType, DefinitionStages.WithValidationEnvironment, DefinitionStages.WithVmTemplate { + } + } + /** + * The template for a HostPool update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCustomRdpProperty, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, UpdateStages.WithLoadBalancerType, UpdateStages.WithMaxSessionLimit, UpdateStages.WithPersonalDesktopAssignmentType, UpdateStages.WithPreferredAppGroupType, UpdateStages.WithRegistrationInfo, UpdateStages.WithRing, UpdateStages.WithSsoadfsAuthority, UpdateStages.WithSsoClientId, UpdateStages.WithSsoClientSecretKeyVaultPath, UpdateStages.WithSsoContext, UpdateStages.WithSsoSecretType, UpdateStages.WithValidationEnvironment, UpdateStages.WithVmTemplate { + } + + /** + * Grouping of HostPool update stages. + */ + interface UpdateStages { + /** + * The stage of the hostpool update allowing to specify CustomRdpProperty. + */ + interface WithCustomRdpProperty { + /** + * Specifies customRdpProperty. + * @param customRdpProperty Custom rdp property of HostPool + * @return the next update stage + */ + Update withCustomRdpProperty(String customRdpProperty); + } + + /** + * The stage of the hostpool update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of HostPool + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the hostpool update allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of HostPool + * @return the next update stage + */ + Update withFriendlyName(String friendlyName); + } + + /** + * The stage of the hostpool update allowing to specify LoadBalancerType. + */ + interface WithLoadBalancerType { + /** + * Specifies loadBalancerType. + * @param loadBalancerType The type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + * @return the next update stage + */ + Update withLoadBalancerType(LoadBalancerType loadBalancerType); + } + + /** + * The stage of the hostpool update allowing to specify MaxSessionLimit. + */ + interface WithMaxSessionLimit { + /** + * Specifies maxSessionLimit. + * @param maxSessionLimit The max session limit of HostPool + * @return the next update stage + */ + Update withMaxSessionLimit(Integer maxSessionLimit); + } + + /** + * The stage of the hostpool update allowing to specify PersonalDesktopAssignmentType. + */ + interface WithPersonalDesktopAssignmentType { + /** + * Specifies personalDesktopAssignmentType. + * @param personalDesktopAssignmentType PersonalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct' + * @return the next update stage + */ + Update withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType); + } + + /** + * The stage of the hostpool update allowing to specify PreferredAppGroupType. + */ + interface WithPreferredAppGroupType { + /** + * Specifies preferredAppGroupType. + * @param preferredAppGroupType The type of preferred application group type, default to Desktop Application Group. Possible values include: 'None', 'Desktop', 'RailApplications' + * @return the next update stage + */ + Update withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType); + } + + /** + * The stage of the hostpool update allowing to specify RegistrationInfo. + */ + interface WithRegistrationInfo { + /** + * Specifies registrationInfo. + * @param registrationInfo The registration info of HostPool + * @return the next update stage + */ + Update withRegistrationInfo(RegistrationInfoPatch registrationInfo); + } + + /** + * The stage of the hostpool update allowing to specify Ring. + */ + interface WithRing { + /** + * Specifies ring. + * @param ring The ring number of HostPool + * @return the next update stage + */ + Update withRing(Integer ring); + } + + /** + * The stage of the hostpool update allowing to specify SsoadfsAuthority. + */ + interface WithSsoadfsAuthority { + /** + * Specifies ssoadfsAuthority. + * @param ssoadfsAuthority URL to customer ADFS server for signing WVD SSO certificates + * @return the next update stage + */ + Update withSsoadfsAuthority(String ssoadfsAuthority); + } + + /** + * The stage of the hostpool update allowing to specify SsoClientId. + */ + interface WithSsoClientId { + /** + * Specifies ssoClientId. + * @param ssoClientId ClientId for the registered Relying Party used to issue WVD SSO certificates + * @return the next update stage + */ + Update withSsoClientId(String ssoClientId); + } + + /** + * The stage of the hostpool update allowing to specify SsoClientSecretKeyVaultPath. + */ + interface WithSsoClientSecretKeyVaultPath { + /** + * Specifies ssoClientSecretKeyVaultPath. + * @param ssoClientSecretKeyVaultPath Path to Azure KeyVault storing the secret used for communication to ADFS + * @return the next update stage + */ + Update withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath); + } + + /** + * The stage of the hostpool update allowing to specify SsoContext. + */ + interface WithSsoContext { + /** + * Specifies ssoContext. + * @param ssoContext Path to keyvault containing ssoContext secret + * @return the next update stage + */ + Update withSsoContext(String ssoContext); + } + + /** + * The stage of the hostpool update allowing to specify SsoSecretType. + */ + interface WithSsoSecretType { + /** + * Specifies ssoSecretType. + * @param ssoSecretType The type of single sign on Secret Type. Possible values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault' + * @return the next update stage + */ + Update withSsoSecretType(SSOSecretType ssoSecretType); + } + + /** + * The stage of the hostpool update allowing to specify ValidationEnvironment. + */ + interface WithValidationEnvironment { + /** + * Specifies validationEnvironment. + * @param validationEnvironment Is validation environment + * @return the next update stage + */ + Update withValidationEnvironment(Boolean validationEnvironment); + } + + /** + * The stage of the hostpool update allowing to specify VmTemplate. + */ + interface WithVmTemplate { + /** + * Specifies vmTemplate. + * @param vmTemplate VM template for sessionhosts configuration within hostpool + * @return the next update stage + */ + Update withVmTemplate(String vmTemplate); + } + + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolPatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolPatch.java new file mode 100644 index 0000000000000..5d33831d43c60 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolPatch.java @@ -0,0 +1,471 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * HostPool properties that can be patched. + */ +@JsonFlatten +public class HostPoolPatch extends ProxyResource { + /** + * tags to be updated. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Friendly name of HostPool. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Description of HostPool. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Custom rdp property of HostPool. + */ + @JsonProperty(value = "properties.customRdpProperty") + private String customRdpProperty; + + /** + * The max session limit of HostPool. + */ + @JsonProperty(value = "properties.maxSessionLimit") + private Integer maxSessionLimit; + + /** + * PersonalDesktopAssignment type for HostPool. Possible values include: + * 'Automatic', 'Direct'. + */ + @JsonProperty(value = "properties.personalDesktopAssignmentType") + private PersonalDesktopAssignmentType personalDesktopAssignmentType; + + /** + * The type of the load balancer. Possible values include: 'BreadthFirst', + * 'DepthFirst', 'Persistent'. + */ + @JsonProperty(value = "properties.loadBalancerType") + private LoadBalancerType loadBalancerType; + + /** + * The ring number of HostPool. + */ + @JsonProperty(value = "properties.ring") + private Integer ring; + + /** + * Is validation environment. + */ + @JsonProperty(value = "properties.validationEnvironment") + private Boolean validationEnvironment; + + /** + * The registration info of HostPool. + */ + @JsonProperty(value = "properties.registrationInfo") + private RegistrationInfoPatch registrationInfo; + + /** + * VM template for sessionhosts configuration within hostpool. + */ + @JsonProperty(value = "properties.vmTemplate") + private String vmTemplate; + + /** + * Path to keyvault containing ssoContext secret. + */ + @JsonProperty(value = "properties.ssoContext") + private String ssoContext; + + /** + * URL to customer ADFS server for signing WVD SSO certificates. + */ + @JsonProperty(value = "properties.ssoadfsAuthority") + private String ssoadfsAuthority; + + /** + * ClientId for the registered Relying Party used to issue WVD SSO + * certificates. + */ + @JsonProperty(value = "properties.ssoClientId") + private String ssoClientId; + + /** + * Path to Azure KeyVault storing the secret used for communication to + * ADFS. + */ + @JsonProperty(value = "properties.ssoClientSecretKeyVaultPath") + private String ssoClientSecretKeyVaultPath; + + /** + * The type of single sign on Secret Type. Possible values include: + * 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', + * 'CertificateInKeyVault'. + */ + @JsonProperty(value = "properties.ssoSecretType") + private SSOSecretType ssoSecretType; + + /** + * The type of preferred application group type, default to Desktop + * Application Group. Possible values include: 'None', 'Desktop', + * 'RailApplications'. + */ + @JsonProperty(value = "properties.preferredAppGroupType") + private PreferredAppGroupType preferredAppGroupType; + + /** + * Get tags to be updated. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags to be updated. + * + * @param tags the tags value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get friendly name of HostPool. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of HostPool. + * + * @param friendlyName the friendlyName value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get description of HostPool. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of HostPool. + * + * @param description the description value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get custom rdp property of HostPool. + * + * @return the customRdpProperty value + */ + public String customRdpProperty() { + return this.customRdpProperty; + } + + /** + * Set custom rdp property of HostPool. + * + * @param customRdpProperty the customRdpProperty value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withCustomRdpProperty(String customRdpProperty) { + this.customRdpProperty = customRdpProperty; + return this; + } + + /** + * Get the max session limit of HostPool. + * + * @return the maxSessionLimit value + */ + public Integer maxSessionLimit() { + return this.maxSessionLimit; + } + + /** + * Set the max session limit of HostPool. + * + * @param maxSessionLimit the maxSessionLimit value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withMaxSessionLimit(Integer maxSessionLimit) { + this.maxSessionLimit = maxSessionLimit; + return this; + } + + /** + * Get personalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct'. + * + * @return the personalDesktopAssignmentType value + */ + public PersonalDesktopAssignmentType personalDesktopAssignmentType() { + return this.personalDesktopAssignmentType; + } + + /** + * Set personalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct'. + * + * @param personalDesktopAssignmentType the personalDesktopAssignmentType value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { + this.personalDesktopAssignmentType = personalDesktopAssignmentType; + return this; + } + + /** + * Get the type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent'. + * + * @return the loadBalancerType value + */ + public LoadBalancerType loadBalancerType() { + return this.loadBalancerType; + } + + /** + * Set the type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent'. + * + * @param loadBalancerType the loadBalancerType value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withLoadBalancerType(LoadBalancerType loadBalancerType) { + this.loadBalancerType = loadBalancerType; + return this; + } + + /** + * Get the ring number of HostPool. + * + * @return the ring value + */ + public Integer ring() { + return this.ring; + } + + /** + * Set the ring number of HostPool. + * + * @param ring the ring value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withRing(Integer ring) { + this.ring = ring; + return this; + } + + /** + * Get is validation environment. + * + * @return the validationEnvironment value + */ + public Boolean validationEnvironment() { + return this.validationEnvironment; + } + + /** + * Set is validation environment. + * + * @param validationEnvironment the validationEnvironment value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withValidationEnvironment(Boolean validationEnvironment) { + this.validationEnvironment = validationEnvironment; + return this; + } + + /** + * Get the registration info of HostPool. + * + * @return the registrationInfo value + */ + public RegistrationInfoPatch registrationInfo() { + return this.registrationInfo; + } + + /** + * Set the registration info of HostPool. + * + * @param registrationInfo the registrationInfo value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withRegistrationInfo(RegistrationInfoPatch registrationInfo) { + this.registrationInfo = registrationInfo; + return this; + } + + /** + * Get vM template for sessionhosts configuration within hostpool. + * + * @return the vmTemplate value + */ + public String vmTemplate() { + return this.vmTemplate; + } + + /** + * Set vM template for sessionhosts configuration within hostpool. + * + * @param vmTemplate the vmTemplate value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withVmTemplate(String vmTemplate) { + this.vmTemplate = vmTemplate; + return this; + } + + /** + * Get path to keyvault containing ssoContext secret. + * + * @return the ssoContext value + */ + public String ssoContext() { + return this.ssoContext; + } + + /** + * Set path to keyvault containing ssoContext secret. + * + * @param ssoContext the ssoContext value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withSsoContext(String ssoContext) { + this.ssoContext = ssoContext; + return this; + } + + /** + * Get uRL to customer ADFS server for signing WVD SSO certificates. + * + * @return the ssoadfsAuthority value + */ + public String ssoadfsAuthority() { + return this.ssoadfsAuthority; + } + + /** + * Set uRL to customer ADFS server for signing WVD SSO certificates. + * + * @param ssoadfsAuthority the ssoadfsAuthority value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withSsoadfsAuthority(String ssoadfsAuthority) { + this.ssoadfsAuthority = ssoadfsAuthority; + return this; + } + + /** + * Get clientId for the registered Relying Party used to issue WVD SSO certificates. + * + * @return the ssoClientId value + */ + public String ssoClientId() { + return this.ssoClientId; + } + + /** + * Set clientId for the registered Relying Party used to issue WVD SSO certificates. + * + * @param ssoClientId the ssoClientId value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withSsoClientId(String ssoClientId) { + this.ssoClientId = ssoClientId; + return this; + } + + /** + * Get path to Azure KeyVault storing the secret used for communication to ADFS. + * + * @return the ssoClientSecretKeyVaultPath value + */ + public String ssoClientSecretKeyVaultPath() { + return this.ssoClientSecretKeyVaultPath; + } + + /** + * Set path to Azure KeyVault storing the secret used for communication to ADFS. + * + * @param ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath) { + this.ssoClientSecretKeyVaultPath = ssoClientSecretKeyVaultPath; + return this; + } + + /** + * Get the type of single sign on Secret Type. Possible values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault'. + * + * @return the ssoSecretType value + */ + public SSOSecretType ssoSecretType() { + return this.ssoSecretType; + } + + /** + * Set the type of single sign on Secret Type. Possible values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault'. + * + * @param ssoSecretType the ssoSecretType value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withSsoSecretType(SSOSecretType ssoSecretType) { + this.ssoSecretType = ssoSecretType; + return this; + } + + /** + * Get the type of preferred application group type, default to Desktop Application Group. Possible values include: 'None', 'Desktop', 'RailApplications'. + * + * @return the preferredAppGroupType value + */ + public PreferredAppGroupType preferredAppGroupType() { + return this.preferredAppGroupType; + } + + /** + * Set the type of preferred application group type, default to Desktop Application Group. Possible values include: 'None', 'Desktop', 'RailApplications'. + * + * @param preferredAppGroupType the preferredAppGroupType value to set + * @return the HostPoolPatch object itself. + */ + public HostPoolPatch withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType) { + this.preferredAppGroupType = preferredAppGroupType; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolType.java new file mode 100644 index 0000000000000..a94c6d25b5c31 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPoolType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HostPoolType. + */ +public final class HostPoolType extends ExpandableStringEnum { + /** Static value Personal for HostPoolType. */ + public static final HostPoolType PERSONAL = fromString("Personal"); + + /** Static value Pooled for HostPoolType. */ + public static final HostPoolType POOLED = fromString("Pooled"); + + /** + * Creates or finds a HostPoolType from its string representation. + * @param name a name to look for + * @return the corresponding HostPoolType + */ + @JsonCreator + public static HostPoolType fromString(String name) { + return fromString(name, HostPoolType.class); + } + + /** + * @return known HostPoolType values + */ + public static Collection values() { + return values(HostPoolType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPools.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPools.java new file mode 100644 index 0000000000000..989fca7bce188 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/HostPools.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.desktopvirtualization.v2020_10_19_preview; + +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 com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.HostPoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing HostPools. + */ +public interface HostPools extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/LoadBalancerType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/LoadBalancerType.java new file mode 100644 index 0000000000000..3ba86cd509da7 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/LoadBalancerType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LoadBalancerType. + */ +public final class LoadBalancerType extends ExpandableStringEnum { + /** Static value BreadthFirst for LoadBalancerType. */ + public static final LoadBalancerType BREADTH_FIRST = fromString("BreadthFirst"); + + /** Static value DepthFirst for LoadBalancerType. */ + public static final LoadBalancerType DEPTH_FIRST = fromString("DepthFirst"); + + /** Static value Persistent for LoadBalancerType. */ + public static final LoadBalancerType PERSISTENT = fromString("Persistent"); + + /** + * Creates or finds a LoadBalancerType from its string representation. + * @param name a name to look for + * @return the corresponding LoadBalancerType + */ + @JsonCreator + public static LoadBalancerType fromString(String name) { + return fromString(name, LoadBalancerType.class); + } + + /** + * @return known LoadBalancerType values + */ + public static Collection values() { + return values(LoadBalancerType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXImageURI.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXImageURI.java new file mode 100644 index 0000000000000..7411113a9ea2b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXImageURI.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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents URI referring to MSIX Image. + */ +public class MSIXImageURI { + /** + * URI to Image. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Get uRI to Image. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set uRI to Image. + * + * @param uri the uri value to set + * @return the MSIXImageURI object itself. + */ + public MSIXImageURI withUri(String uri) { + this.uri = uri; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackage.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackage.java new file mode 100644 index 0000000000000..4d213ac670863 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackage.java @@ -0,0 +1,313 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.MSIXPackageInner; +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.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing MSIXPackage. + */ +public interface MSIXPackage extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the imagePath value. + */ + String imagePath(); + + /** + * @return the isActive value. + */ + boolean isActive(); + + /** + * @return the isRegularRegistration value. + */ + boolean isRegularRegistration(); + + /** + * @return the lastUpdated value. + */ + DateTime lastUpdated(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the packageApplications value. + */ + List packageApplications(); + + /** + * @return the packageDependencies value. + */ + List packageDependencies(); + + /** + * @return the packageFamilyName value. + */ + String packageFamilyName(); + + /** + * @return the packageName value. + */ + String packageName(); + + /** + * @return the packageRelativePath value. + */ + String packageRelativePath(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + + /** + * The entirety of the MSIXPackage definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithHostPool, DefinitionStages.WithCreate { + } + + /** + * Grouping of MSIXPackage definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MSIXPackage definition. + */ + interface Blank extends WithHostPool { + } + + /** + * The stage of the msixpackage definition allowing to specify HostPool. + */ + interface WithHostPool { + /** + * Specifies resourceGroupName, hostPoolName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param hostPoolName The name of the host pool within the specified resource group + * @return the next definition stage + */ + WithCreate withExistingHostPool(String resourceGroupName, String hostPoolName); + } + + /** + * The stage of the msixpackage definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName User friendly Name to be displayed in the portal + * @return the next definition stage + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the msixpackage definition allowing to specify ImagePath. + */ + interface WithImagePath { + /** + * Specifies imagePath. + * @param imagePath VHD/CIM image path on Network Share + * @return the next definition stage + */ + WithCreate withImagePath(String imagePath); + } + + /** + * The stage of the msixpackage definition allowing to specify IsActive. + */ + interface WithIsActive { + /** + * Specifies isActive. + * @param isActive Make this version of the package the active one across the hostpool + * @return the next definition stage + */ + WithCreate withIsActive(boolean isActive); + } + + /** + * The stage of the msixpackage definition allowing to specify IsRegularRegistration. + */ + interface WithIsRegularRegistration { + /** + * Specifies isRegularRegistration. + * @param isRegularRegistration Specifies how to register Package in feed + * @return the next definition stage + */ + WithCreate withIsRegularRegistration(boolean isRegularRegistration); + } + + /** + * The stage of the msixpackage definition allowing to specify LastUpdated. + */ + interface WithLastUpdated { + /** + * Specifies lastUpdated. + * @param lastUpdated Date Package was last updated, found in the appxmanifest.xml + * @return the next definition stage + */ + WithCreate withLastUpdated(DateTime lastUpdated); + } + + /** + * The stage of the msixpackage definition allowing to specify PackageApplications. + */ + interface WithPackageApplications { + /** + * Specifies packageApplications. + * @param packageApplications List of package applications + * @return the next definition stage + */ + WithCreate withPackageApplications(List packageApplications); + } + + /** + * The stage of the msixpackage definition allowing to specify PackageDependencies. + */ + interface WithPackageDependencies { + /** + * Specifies packageDependencies. + * @param packageDependencies List of package dependencies + * @return the next definition stage + */ + WithCreate withPackageDependencies(List packageDependencies); + } + + /** + * The stage of the msixpackage definition allowing to specify PackageFamilyName. + */ + interface WithPackageFamilyName { + /** + * Specifies packageFamilyName. + * @param packageFamilyName Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name + * @return the next definition stage + */ + WithCreate withPackageFamilyName(String packageFamilyName); + } + + /** + * The stage of the msixpackage definition allowing to specify PackageName. + */ + interface WithPackageName { + /** + * Specifies packageName. + * @param packageName Package Name from appxmanifest.xml + * @return the next definition stage + */ + WithCreate withPackageName(String packageName); + } + + /** + * The stage of the msixpackage definition allowing to specify PackageRelativePath. + */ + interface WithPackageRelativePath { + /** + * Specifies packageRelativePath. + * @param packageRelativePath Relative Path to the package inside the image + * @return the next definition stage + */ + WithCreate withPackageRelativePath(String packageRelativePath); + } + + /** + * The stage of the msixpackage definition allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + * @param version Package Version found in the appxmanifest.xml + * @return the next definition stage + */ + WithCreate withVersion(String version); + } + + /** + * 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.WithDisplayName, DefinitionStages.WithImagePath, DefinitionStages.WithIsActive, DefinitionStages.WithIsRegularRegistration, DefinitionStages.WithLastUpdated, DefinitionStages.WithPackageApplications, DefinitionStages.WithPackageDependencies, DefinitionStages.WithPackageFamilyName, DefinitionStages.WithPackageName, DefinitionStages.WithPackageRelativePath, DefinitionStages.WithVersion { + } + } + /** + * The template for a MSIXPackage update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDisplayName, UpdateStages.WithIsActive, UpdateStages.WithIsRegularRegistration { + } + + /** + * Grouping of MSIXPackage update stages. + */ + interface UpdateStages { + /** + * The stage of the msixpackage update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Display name for MSIX Package + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the msixpackage update allowing to specify IsActive. + */ + interface WithIsActive { + /** + * Specifies isActive. + * @param isActive Set a version of the package to be active across hostpool + * @return the next update stage + */ + Update withIsActive(Boolean isActive); + } + + /** + * The stage of the msixpackage update allowing to specify IsRegularRegistration. + */ + interface WithIsRegularRegistration { + /** + * Specifies isRegularRegistration. + * @param isRegularRegistration Set Registration mode. Regular or Delayed + * @return the next update stage + */ + Update withIsRegularRegistration(Boolean isRegularRegistration); + } + + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackagePatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackagePatch.java new file mode 100644 index 0000000000000..531a693020424 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackagePatch.java @@ -0,0 +1,98 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * MSIX Package properties that can be patched. + */ +@JsonFlatten +public class MSIXPackagePatch extends ProxyResource { + /** + * Set a version of the package to be active across hostpool. + */ + @JsonProperty(value = "properties.isActive") + private Boolean isActive; + + /** + * Set Registration mode. Regular or Delayed. + */ + @JsonProperty(value = "properties.isRegularRegistration") + private Boolean isRegularRegistration; + + /** + * Display name for MSIX Package. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get set a version of the package to be active across hostpool. + * + * @return the isActive value + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Set set a version of the package to be active across hostpool. + * + * @param isActive the isActive value to set + * @return the MSIXPackagePatch object itself. + */ + public MSIXPackagePatch withIsActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get set Registration mode. Regular or Delayed. + * + * @return the isRegularRegistration value + */ + public Boolean isRegularRegistration() { + return this.isRegularRegistration; + } + + /** + * Set set Registration mode. Regular or Delayed. + * + * @param isRegularRegistration the isRegularRegistration value to set + * @return the MSIXPackagePatch object itself. + */ + public MSIXPackagePatch withIsRegularRegistration(Boolean isRegularRegistration) { + this.isRegularRegistration = isRegularRegistration; + return this; + } + + /** + * Get display name for MSIX Package. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name for MSIX Package. + * + * @param displayName the displayName value to set + * @return the MSIXPackagePatch object itself. + */ + public MSIXPackagePatch withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackages.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackages.java new file mode 100644 index 0000000000000..26852282d42c3 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MSIXPackages.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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.MSIXPackagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MSIXPackages. + */ +public interface MSIXPackages extends SupportsCreating, HasInner { + /** + * Get a msixpackage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); + + /** + * List MSIX packages in hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String hostPoolName); + + /** + * Remove an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixImages.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixImages.java new file mode 100644 index 0000000000000..490402d4ba4c4 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixImages.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.desktopvirtualization.v2020_10_19_preview; + +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.MsixImagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MsixImages. + */ +public interface MsixImages extends HasInner { + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable expandAsync(final String resourceGroupName, final String hostPoolName); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageApplications.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageApplications.java new file mode 100644 index 0000000000000..067f8ac67aa6f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageApplications.java @@ -0,0 +1,200 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema for MSIX Package Application properties. + */ +public class MsixPackageApplications { + /** + * Package Application Id, found in appxmanifest.xml. + */ + @JsonProperty(value = "appId") + private String appId; + + /** + * Description of Package Application. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Used to activate Package Application. Consists of Package Name and + * ApplicationID. Found in appxmanifest.xml. + */ + @JsonProperty(value = "appUserModelID") + private String appUserModelID; + + /** + * User friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * User friendly name. + */ + @JsonProperty(value = "iconImageName") + private String iconImageName; + + /** + * the icon a 64 bit string as a byte array. + */ + @JsonProperty(value = "rawIcon") + private byte[] rawIcon; + + /** + * the icon a 64 bit string as a byte array. + */ + @JsonProperty(value = "rawPng") + private byte[] rawPng; + + /** + * Get package Application Id, found in appxmanifest.xml. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set package Application Id, found in appxmanifest.xml. + * + * @param appId the appId value to set + * @return the MsixPackageApplications object itself. + */ + public MsixPackageApplications withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get description of Package Application. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of Package Application. + * + * @param description the description value to set + * @return the MsixPackageApplications object itself. + */ + public MsixPackageApplications withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get used to activate Package Application. Consists of Package Name and ApplicationID. Found in appxmanifest.xml. + * + * @return the appUserModelID value + */ + public String appUserModelID() { + return this.appUserModelID; + } + + /** + * Set used to activate Package Application. Consists of Package Name and ApplicationID. Found in appxmanifest.xml. + * + * @param appUserModelID the appUserModelID value to set + * @return the MsixPackageApplications object itself. + */ + public MsixPackageApplications withAppUserModelID(String appUserModelID) { + this.appUserModelID = appUserModelID; + return this; + } + + /** + * Get user friendly name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set user friendly name. + * + * @param friendlyName the friendlyName value to set + * @return the MsixPackageApplications object itself. + */ + public MsixPackageApplications withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get user friendly name. + * + * @return the iconImageName value + */ + public String iconImageName() { + return this.iconImageName; + } + + /** + * Set user friendly name. + * + * @param iconImageName the iconImageName value to set + * @return the MsixPackageApplications object itself. + */ + public MsixPackageApplications withIconImageName(String iconImageName) { + this.iconImageName = iconImageName; + return this; + } + + /** + * Get the icon a 64 bit string as a byte array. + * + * @return the rawIcon value + */ + public byte[] rawIcon() { + return this.rawIcon; + } + + /** + * Set the icon a 64 bit string as a byte array. + * + * @param rawIcon the rawIcon value to set + * @return the MsixPackageApplications object itself. + */ + public MsixPackageApplications withRawIcon(byte[] rawIcon) { + this.rawIcon = rawIcon; + return this; + } + + /** + * Get the icon a 64 bit string as a byte array. + * + * @return the rawPng value + */ + public byte[] rawPng() { + return this.rawPng; + } + + /** + * Set the icon a 64 bit string as a byte array. + * + * @param rawPng the rawPng value to set + * @return the MsixPackageApplications object itself. + */ + public MsixPackageApplications withRawPng(byte[] rawPng) { + this.rawPng = rawPng; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageDependencies.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageDependencies.java new file mode 100644 index 0000000000000..3079c9dcb6fc7 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/MsixPackageDependencies.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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema for MSIX Package Dependencies properties. + */ +public class MsixPackageDependencies { + /** + * Name of package dependency. + */ + @JsonProperty(value = "dependencyName") + private String dependencyName; + + /** + * Name of dependency publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * Dependency version required. + */ + @JsonProperty(value = "minVersion") + private String minVersion; + + /** + * Get name of package dependency. + * + * @return the dependencyName value + */ + public String dependencyName() { + return this.dependencyName; + } + + /** + * Set name of package dependency. + * + * @param dependencyName the dependencyName value to set + * @return the MsixPackageDependencies object itself. + */ + public MsixPackageDependencies withDependencyName(String dependencyName) { + this.dependencyName = dependencyName; + return this; + } + + /** + * Get name of dependency publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set name of dependency publisher. + * + * @param publisher the publisher value to set + * @return the MsixPackageDependencies object itself. + */ + public MsixPackageDependencies withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get dependency version required. + * + * @return the minVersion value + */ + public String minVersion() { + return this.minVersion; + } + + /** + * Set dependency version required. + * + * @param minVersion the minVersion value to set + * @return the MsixPackageDependencies object itself. + */ + public MsixPackageDependencies withMinVersion(String minVersion) { + this.minVersion = minVersion; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Operations.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Operations.java new file mode 100644 index 0000000000000..73d672a71fa5c --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Operations.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.desktopvirtualization.v2020_10_19_preview; + +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List all of the available operations the Desktop Virtualization resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PersonalDesktopAssignmentType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PersonalDesktopAssignmentType.java new file mode 100644 index 0000000000000..9b91a70ad91ce --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PersonalDesktopAssignmentType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PersonalDesktopAssignmentType. + */ +public final class PersonalDesktopAssignmentType extends ExpandableStringEnum { + /** Static value Automatic for PersonalDesktopAssignmentType. */ + public static final PersonalDesktopAssignmentType AUTOMATIC = fromString("Automatic"); + + /** Static value Direct for PersonalDesktopAssignmentType. */ + public static final PersonalDesktopAssignmentType DIRECT = fromString("Direct"); + + /** + * Creates or finds a PersonalDesktopAssignmentType from its string representation. + * @param name a name to look for + * @return the corresponding PersonalDesktopAssignmentType + */ + @JsonCreator + public static PersonalDesktopAssignmentType fromString(String name) { + return fromString(name, PersonalDesktopAssignmentType.class); + } + + /** + * @return known PersonalDesktopAssignmentType values + */ + public static Collection values() { + return values(PersonalDesktopAssignmentType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PreferredAppGroupType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PreferredAppGroupType.java new file mode 100644 index 0000000000000..39cba9954cc72 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/PreferredAppGroupType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PreferredAppGroupType. + */ +public final class PreferredAppGroupType extends ExpandableStringEnum { + /** Static value None for PreferredAppGroupType. */ + public static final PreferredAppGroupType NONE = fromString("None"); + + /** Static value Desktop for PreferredAppGroupType. */ + public static final PreferredAppGroupType DESKTOP = fromString("Desktop"); + + /** Static value RailApplications for PreferredAppGroupType. */ + public static final PreferredAppGroupType RAIL_APPLICATIONS = fromString("RailApplications"); + + /** + * Creates or finds a PreferredAppGroupType from its string representation. + * @param name a name to look for + * @return the corresponding PreferredAppGroupType + */ + @JsonCreator + public static PreferredAppGroupType fromString(String name) { + return fromString(name, PreferredAppGroupType.class); + } + + /** + * @return known PreferredAppGroupType values + */ + public static Collection values() { + return values(PreferredAppGroupType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfo.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfo.java new file mode 100644 index 0000000000000..07ed514a4cfff --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfo.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.desktopvirtualization.v2020_10_19_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a RegistrationInfo definition. + */ +public class RegistrationInfo { + /** + * Expiration time of registration token. + */ + @JsonProperty(value = "expirationTime") + private DateTime expirationTime; + + /** + * The registration token base64 encoded string. + */ + @JsonProperty(value = "token") + private String token; + + /** + * The type of resetting the token. Possible values include: 'Delete', + * 'None', 'Update'. + */ + @JsonProperty(value = "registrationTokenOperation") + private RegistrationTokenOperation registrationTokenOperation; + + /** + * Get expiration time of registration token. + * + * @return the expirationTime value + */ + public DateTime expirationTime() { + return this.expirationTime; + } + + /** + * Set expiration time of registration token. + * + * @param expirationTime the expirationTime value to set + * @return the RegistrationInfo object itself. + */ + public RegistrationInfo withExpirationTime(DateTime expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + /** + * Get the registration token base64 encoded string. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set the registration token base64 encoded string. + * + * @param token the token value to set + * @return the RegistrationInfo object itself. + */ + public RegistrationInfo withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the type of resetting the token. Possible values include: 'Delete', 'None', 'Update'. + * + * @return the registrationTokenOperation value + */ + public RegistrationTokenOperation registrationTokenOperation() { + return this.registrationTokenOperation; + } + + /** + * Set the type of resetting the token. Possible values include: 'Delete', 'None', 'Update'. + * + * @param registrationTokenOperation the registrationTokenOperation value to set + * @return the RegistrationInfo object itself. + */ + public RegistrationInfo withRegistrationTokenOperation(RegistrationTokenOperation registrationTokenOperation) { + this.registrationTokenOperation = registrationTokenOperation; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfoPatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfoPatch.java new file mode 100644 index 0000000000000..3d19ec9519bb3 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationInfoPatch.java @@ -0,0 +1,71 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a RegistrationInfo definition. + */ +public class RegistrationInfoPatch { + /** + * Expiration time of registration token. + */ + @JsonProperty(value = "expirationTime") + private DateTime expirationTime; + + /** + * The type of resetting the token. Possible values include: 'Delete', + * 'None', 'Update'. + */ + @JsonProperty(value = "registrationTokenOperation") + private RegistrationTokenOperation registrationTokenOperation; + + /** + * Get expiration time of registration token. + * + * @return the expirationTime value + */ + public DateTime expirationTime() { + return this.expirationTime; + } + + /** + * Set expiration time of registration token. + * + * @param expirationTime the expirationTime value to set + * @return the RegistrationInfoPatch object itself. + */ + public RegistrationInfoPatch withExpirationTime(DateTime expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + /** + * Get the type of resetting the token. Possible values include: 'Delete', 'None', 'Update'. + * + * @return the registrationTokenOperation value + */ + public RegistrationTokenOperation registrationTokenOperation() { + return this.registrationTokenOperation; + } + + /** + * Set the type of resetting the token. Possible values include: 'Delete', 'None', 'Update'. + * + * @param registrationTokenOperation the registrationTokenOperation value to set + * @return the RegistrationInfoPatch object itself. + */ + public RegistrationInfoPatch withRegistrationTokenOperation(RegistrationTokenOperation registrationTokenOperation) { + this.registrationTokenOperation = registrationTokenOperation; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationTokenOperation.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationTokenOperation.java new file mode 100644 index 0000000000000..b1ef0f13540e6 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RegistrationTokenOperation.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RegistrationTokenOperation. + */ +public final class RegistrationTokenOperation extends ExpandableStringEnum { + /** Static value Delete for RegistrationTokenOperation. */ + public static final RegistrationTokenOperation DELETE = fromString("Delete"); + + /** Static value None for RegistrationTokenOperation. */ + public static final RegistrationTokenOperation NONE = fromString("None"); + + /** Static value Update for RegistrationTokenOperation. */ + public static final RegistrationTokenOperation UPDATE = fromString("Update"); + + /** + * Creates or finds a RegistrationTokenOperation from its string representation. + * @param name a name to look for + * @return the corresponding RegistrationTokenOperation + */ + @JsonCreator + public static RegistrationTokenOperation fromString(String name) { + return fromString(name, RegistrationTokenOperation.class); + } + + /** + * @return known RegistrationTokenOperation values + */ + public static Collection values() { + return values(RegistrationTokenOperation.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RemoteApplicationType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RemoteApplicationType.java new file mode 100644 index 0000000000000..d3f486b2caf95 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/RemoteApplicationType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RemoteApplicationType. + */ +public final class RemoteApplicationType extends ExpandableStringEnum { + /** Static value InBuilt for RemoteApplicationType. */ + public static final RemoteApplicationType IN_BUILT = fromString("InBuilt"); + + /** Static value MsixApplication for RemoteApplicationType. */ + public static final RemoteApplicationType MSIX_APPLICATION = fromString("MsixApplication"); + + /** + * Creates or finds a RemoteApplicationType from its string representation. + * @param name a name to look for + * @return the corresponding RemoteApplicationType + */ + @JsonCreator + public static RemoteApplicationType fromString(String name) { + return fromString(name, RemoteApplicationType.class); + } + + /** + * @return known RemoteApplicationType values + */ + public static Collection values() { + return values(RemoteApplicationType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperation.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperation.java new file mode 100644 index 0000000000000..b46e70f520786 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperation.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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Supported operation of this resource provider. + */ +public class ResourceProviderOperation { + /** + * Operation name, in format of {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private ResourceProviderOperationDisplay display; + + /** + * Get operation name, in format of {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name, in format of {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the ResourceProviderOperation object itself. + */ + public ResourceProviderOperation withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public ResourceProviderOperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the ResourceProviderOperation object itself. + */ + public ResourceProviderOperation withDisplay(ResourceProviderOperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationDisplay.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationDisplay.java new file mode 100644 index 0000000000000..b04d7be366b70 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationDisplay.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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class ResourceProviderOperationDisplay { + /** + * Resource provider: Microsoft Desktop Virtualization. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of this operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get resource provider: Microsoft Desktop Virtualization. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set resource provider: Microsoft Desktop Virtualization. + * + * @param provider the provider value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of this operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of this operation. + * + * @param description the description value to set + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationList.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationList.java new file mode 100644 index 0000000000000..022905c87946d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/ResourceProviderOperationList.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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.ResourceProviderOperationListInner; +import java.util.List; + +/** + * Type representing ResourceProviderOperationList. + */ +public interface ResourceProviderOperationList extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SSOSecretType.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SSOSecretType.java new file mode 100644 index 0000000000000..3ecb2eaca8756 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SSOSecretType.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SSOSecretType. + */ +public final class SSOSecretType extends ExpandableStringEnum { + /** Static value SharedKey for SSOSecretType. */ + public static final SSOSecretType SHARED_KEY = fromString("SharedKey"); + + /** Static value Certificate for SSOSecretType. */ + public static final SSOSecretType CERTIFICATE = fromString("Certificate"); + + /** Static value SharedKeyInKeyVault for SSOSecretType. */ + public static final SSOSecretType SHARED_KEY_IN_KEY_VAULT = fromString("SharedKeyInKeyVault"); + + /** Static value CertificateInKeyVault for SSOSecretType. */ + public static final SSOSecretType CERTIFICATE_IN_KEY_VAULT = fromString("CertificateInKeyVault"); + + /** + * Creates or finds a SSOSecretType from its string representation. + * @param name a name to look for + * @return the corresponding SSOSecretType + */ + @JsonCreator + public static SSOSecretType fromString(String name) { + return fromString(name, SSOSecretType.class); + } + + /** + * @return known SSOSecretType values + */ + public static Collection values() { + return values(SSOSecretType.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SendMessage.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SendMessage.java new file mode 100644 index 0000000000000..5afa8c70830cb --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SendMessage.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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents message sent to a UserSession. + */ +public class SendMessage { + /** + * Title of message. + */ + @JsonProperty(value = "messageTitle") + private String messageTitle; + + /** + * Body of message. + */ + @JsonProperty(value = "messageBody") + private String messageBody; + + /** + * Get title of message. + * + * @return the messageTitle value + */ + public String messageTitle() { + return this.messageTitle; + } + + /** + * Set title of message. + * + * @param messageTitle the messageTitle value to set + * @return the SendMessage object itself. + */ + public SendMessage withMessageTitle(String messageTitle) { + this.messageTitle = messageTitle; + return this; + } + + /** + * Get body of message. + * + * @return the messageBody value + */ + public String messageBody() { + return this.messageBody; + } + + /** + * Set body of message. + * + * @param messageBody the messageBody value to set + * @return the SendMessage object itself. + */ + public SendMessage withMessageBody(String messageBody) { + this.messageBody = messageBody; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHost.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHost.java new file mode 100644 index 0000000000000..ad5e31e2e8b6a --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHost.java @@ -0,0 +1,145 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.SessionHostInner; +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.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import org.joda.time.DateTime; + +/** + * Type representing SessionHost. + */ +public interface SessionHost extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * @return the allowNewSession value. + */ + Boolean allowNewSession(); + + /** + * @return the assignedUser value. + */ + String assignedUser(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastHeartBeat value. + */ + DateTime lastHeartBeat(); + + /** + * @return the lastUpdateTime value. + */ + DateTime lastUpdateTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the osVersion value. + */ + String osVersion(); + + /** + * @return the resourceId value. + */ + String resourceId(); + + /** + * @return the sessions value. + */ + Integer sessions(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the statusTimestamp value. + */ + DateTime statusTimestamp(); + + /** + * @return the sxSStackVersion value. + */ + String sxSStackVersion(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updateErrorMessage value. + */ + String updateErrorMessage(); + + /** + * @return the updateState value. + */ + UpdateState updateState(); + + /** + * @return the virtualMachineId value. + */ + String virtualMachineId(); + + /** + * The template for a SessionHost update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAllowNewSession, UpdateStages.WithAssignedUser { + } + + /** + * Grouping of SessionHost update stages. + */ + interface UpdateStages { + /** + * The stage of the sessionhost update allowing to specify AllowNewSession. + */ + interface WithAllowNewSession { + /** + * Specifies allowNewSession. + * @param allowNewSession Allow a new session + * @return the next update stage + */ + Update withAllowNewSession(Boolean allowNewSession); + } + + /** + * The stage of the sessionhost update allowing to specify AssignedUser. + */ + interface WithAssignedUser { + /** + * Specifies assignedUser. + * @param assignedUser User assigned to SessionHost + * @return the next update stage + */ + Update withAssignedUser(String assignedUser); + } + + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHostPatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHostPatch.java new file mode 100644 index 0000000000000..c1d41a72e4d7f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHostPatch.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.desktopvirtualization.v2020_10_19_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * SessionHost properties that can be patched. + */ +@JsonFlatten +public class SessionHostPatch extends ProxyResource { + /** + * Allow a new session. + */ + @JsonProperty(value = "properties.allowNewSession") + private Boolean allowNewSession; + + /** + * User assigned to SessionHost. + */ + @JsonProperty(value = "properties.assignedUser") + private String assignedUser; + + /** + * Get allow a new session. + * + * @return the allowNewSession value + */ + public Boolean allowNewSession() { + return this.allowNewSession; + } + + /** + * Set allow a new session. + * + * @param allowNewSession the allowNewSession value to set + * @return the SessionHostPatch object itself. + */ + public SessionHostPatch withAllowNewSession(Boolean allowNewSession) { + this.allowNewSession = allowNewSession; + return this; + } + + /** + * Get user assigned to SessionHost. + * + * @return the assignedUser value + */ + public String assignedUser() { + return this.assignedUser; + } + + /** + * Set user assigned to SessionHost. + * + * @param assignedUser the assignedUser value to set + * @return the SessionHostPatch object itself. + */ + public SessionHostPatch withAssignedUser(String assignedUser) { + this.assignedUser = assignedUser; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHosts.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHosts.java new file mode 100644 index 0000000000000..92275f43a5824 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionHosts.java @@ -0,0 +1,52 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.SessionHostsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SessionHosts. + */ +public interface SessionHosts extends HasInner { + /** + * Get a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String hostPoolName, String sessionHostName); + + /** + * List sessionHosts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String hostPoolName); + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionState.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionState.java new file mode 100644 index 0000000000000..472664ec1cac5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/SessionState.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SessionState. + */ +public final class SessionState extends ExpandableStringEnum { + /** Static value Unknown for SessionState. */ + public static final SessionState UNKNOWN = fromString("Unknown"); + + /** Static value Active for SessionState. */ + public static final SessionState ACTIVE = fromString("Active"); + + /** Static value Disconnected for SessionState. */ + public static final SessionState DISCONNECTED = fromString("Disconnected"); + + /** Static value Pending for SessionState. */ + public static final SessionState PENDING = fromString("Pending"); + + /** Static value LogOff for SessionState. */ + public static final SessionState LOG_OFF = fromString("LogOff"); + + /** Static value UserProfileDiskMounted for SessionState. */ + public static final SessionState USER_PROFILE_DISK_MOUNTED = fromString("UserProfileDiskMounted"); + + /** + * Creates or finds a SessionState from its string representation. + * @param name a name to look for + * @return the corresponding SessionState + */ + @JsonCreator + public static SessionState fromString(String name) { + return fromString(name, SessionState.class); + } + + /** + * @return known SessionState values + */ + public static Collection values() { + return values(SessionState.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItem.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItem.java new file mode 100644 index 0000000000000..05daef462ffd0 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItem.java @@ -0,0 +1,65 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.StartMenuItemInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; + +/** + * Type representing StartMenuItem. + */ +public interface StartMenuItem extends HasInner, HasManager { + /** + * @return the appAlias value. + */ + String appAlias(); + + /** + * @return the commandLineArguments value. + */ + String commandLineArguments(); + + /** + * @return the filePath value. + */ + String filePath(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the iconIndex value. + */ + Integer iconIndex(); + + /** + * @return the iconPath value. + */ + String iconPath(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItems.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItems.java new file mode 100644 index 0000000000000..fb28b518b11d2 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/StartMenuItems.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.desktopvirtualization.v2020_10_19_preview; + +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.StartMenuItemsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StartMenuItems. + */ +public interface StartMenuItems extends HasInner { + /** + * List start menu items in the given application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String applicationGroupName); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Status.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Status.java new file mode 100644 index 0000000000000..9eb973ad7fe72 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Status.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Status. + */ +public final class Status extends ExpandableStringEnum { + /** Static value Available for Status. */ + public static final Status AVAILABLE = fromString("Available"); + + /** Static value Unavailable for Status. */ + public static final Status UNAVAILABLE = fromString("Unavailable"); + + /** Static value Shutdown for Status. */ + public static final Status SHUTDOWN = fromString("Shutdown"); + + /** Static value Disconnected for Status. */ + public static final Status DISCONNECTED = fromString("Disconnected"); + + /** Static value Upgrading for Status. */ + public static final Status UPGRADING = fromString("Upgrading"); + + /** Static value UpgradeFailed for Status. */ + public static final Status UPGRADE_FAILED = fromString("UpgradeFailed"); + + /** + * Creates or finds a Status from its string representation. + * @param name a name to look for + * @return the corresponding Status + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * @return known Status values + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UpdateState.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UpdateState.java new file mode 100644 index 0000000000000..6260344b64631 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UpdateState.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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpdateState. + */ +public final class UpdateState extends ExpandableStringEnum { + /** Static value Initial for UpdateState. */ + public static final UpdateState INITIAL = fromString("Initial"); + + /** Static value Pending for UpdateState. */ + public static final UpdateState PENDING = fromString("Pending"); + + /** Static value Started for UpdateState. */ + public static final UpdateState STARTED = fromString("Started"); + + /** Static value Succeeded for UpdateState. */ + public static final UpdateState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for UpdateState. */ + public static final UpdateState FAILED = fromString("Failed"); + + /** + * Creates or finds a UpdateState from its string representation. + * @param name a name to look for + * @return the corresponding UpdateState + */ + @JsonCreator + public static UpdateState fromString(String name) { + return fromString(name, UpdateState.class); + } + + /** + * @return known UpdateState values + */ + public static Collection values() { + return values(UpdateState.class); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSession.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSession.java new file mode 100644 index 0000000000000..9713147090588 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSession.java @@ -0,0 +1,61 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.UserSessionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import org.joda.time.DateTime; + +/** + * Type representing UserSession. + */ +public interface UserSession extends HasInner, HasManager { + /** + * @return the activeDirectoryUserName value. + */ + String activeDirectoryUserName(); + + /** + * @return the applicationType value. + */ + ApplicationType applicationType(); + + /** + * @return the createTime value. + */ + DateTime createTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sessionState value. + */ + SessionState sessionState(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userPrincipalName value. + */ + String userPrincipalName(); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSessions.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSessions.java new file mode 100644 index 0000000000000..151c51d888e80 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/UserSessions.java @@ -0,0 +1,89 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.UserSessionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing UserSessions. + */ +public interface UserSessions extends HasInner { + /** + * Get a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String hostPoolName, final String sessionHostName); + + /** + * Disconnect a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable sendMessageMethodAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId); + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByHostPoolAsync(final String resourceGroupName, final String hostPoolName); + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspace.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspace.java new file mode 100644 index 0000000000000..e114d7539034a --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspace.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.desktopvirtualization.v2020_10_19_preview; + +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.desktopvirtualization.v2020_10_19_preview.implementation.DesktopVirtualizationManager; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.WorkspaceInner; + +/** + * Type representing Workspace. + */ +public interface Workspace extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the applicationGroupReferences value. + */ + List applicationGroupReferences(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * The entirety of the Workspace definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Workspace definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Workspace definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Workspace definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the workspace definition allowing to specify ApplicationGroupReferences. + */ + interface WithApplicationGroupReferences { + /** + * Specifies applicationGroupReferences. + * @param applicationGroupReferences List of applicationGroup resource Ids + * @return the next definition stage + */ + WithCreate withApplicationGroupReferences(List applicationGroupReferences); + } + + /** + * The stage of the workspace definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of Workspace + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the workspace definition allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of Workspace + * @return the next definition stage + */ + WithCreate withFriendlyName(String friendlyName); + } + + /** + * 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.WithApplicationGroupReferences, DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName { + } + } + /** + * The template for a Workspace update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApplicationGroupReferences, UpdateStages.WithDescription, UpdateStages.WithFriendlyName { + } + + /** + * Grouping of Workspace update stages. + */ + interface UpdateStages { + /** + * The stage of the workspace update allowing to specify ApplicationGroupReferences. + */ + interface WithApplicationGroupReferences { + /** + * Specifies applicationGroupReferences. + * @param applicationGroupReferences List of applicationGroup links + * @return the next update stage + */ + Update withApplicationGroupReferences(List applicationGroupReferences); + } + + /** + * The stage of the workspace update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description of Workspace + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the workspace update allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName Friendly name of Workspace + * @return the next update stage + */ + Update withFriendlyName(String friendlyName); + } + + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/WorkspacePatch.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/WorkspacePatch.java new file mode 100644 index 0000000000000..b2fb5cc0ebe8f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/WorkspacePatch.java @@ -0,0 +1,125 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Workspace properties that can be patched. + */ +@JsonFlatten +public class WorkspacePatch { + /** + * tags to be updated. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Description of Workspace. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of Workspace. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * List of applicationGroup links. + */ + @JsonProperty(value = "properties.applicationGroupReferences") + private List applicationGroupReferences; + + /** + * Get tags to be updated. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set tags to be updated. + * + * @param tags the tags value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get description of Workspace. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of Workspace. + * + * @param description the description value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of Workspace. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of Workspace. + * + * @param friendlyName the friendlyName value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get list of applicationGroup links. + * + * @return the applicationGroupReferences value + */ + public List applicationGroupReferences() { + return this.applicationGroupReferences; + } + + /** + * Set list of applicationGroup links. + * + * @param applicationGroupReferences the applicationGroupReferences value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withApplicationGroupReferences(List applicationGroupReferences) { + this.applicationGroupReferences = applicationGroupReferences; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspaces.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspaces.java new file mode 100644 index 0000000000000..b3d455eda54f6 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/Workspaces.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.desktopvirtualization.v2020_10_19_preview; + +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 com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation.WorkspacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Workspaces. + */ +public interface Workspaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupImpl.java new file mode 100644 index 0000000000000..f965f29dd7383 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupImpl.java @@ -0,0 +1,125 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroup; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroupPatch; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroupType; +import rx.functions.Func1; + +class ApplicationGroupImpl extends GroupableResourceCoreImpl implements ApplicationGroup, ApplicationGroup.Definition, ApplicationGroup.Update { + private ApplicationGroupPatch updateParameter; + ApplicationGroupImpl(String name, ApplicationGroupInner inner, DesktopVirtualizationManager manager) { + super(name, inner, manager); + this.updateParameter = new ApplicationGroupPatch(); + } + + @Override + public Observable createResourceAsync() { + ApplicationGroupsInner client = this.manager().inner().applicationGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ApplicationGroupInner call(ApplicationGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationGroupsInner client = this.manager().inner().applicationGroups(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ApplicationGroupInner call(ApplicationGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationGroupsInner client = this.manager().inner().applicationGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ApplicationGroupPatch(); + } + + @Override + public ApplicationGroupType applicationGroupType() { + return this.inner().applicationGroupType(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public String hostPoolArmPath() { + return this.inner().hostPoolArmPath(); + } + + @Override + public String workspaceArmPath() { + return this.inner().workspaceArmPath(); + } + + @Override + public ApplicationGroupImpl withApplicationGroupType(ApplicationGroupType applicationGroupType) { + this.inner().withApplicationGroupType(applicationGroupType); + return this; + } + + @Override + public ApplicationGroupImpl withHostPoolArmPath(String hostPoolArmPath) { + this.inner().withHostPoolArmPath(hostPoolArmPath); + return this; + } + + @Override + public ApplicationGroupImpl withDescription(String description) { + if (isInCreateMode()) { + this.inner().withDescription(description); + } else { + this.updateParameter.withDescription(description); + } + return this; + } + + @Override + public ApplicationGroupImpl withFriendlyName(String friendlyName) { + if (isInCreateMode()) { + this.inner().withFriendlyName(friendlyName); + } else { + this.updateParameter.withFriendlyName(friendlyName); + } + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupInner.java new file mode 100644 index 0000000000000..fdaf32cc46563 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupInner.java @@ -0,0 +1,141 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroupType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Represents a ApplicationGroup definition. + */ +@JsonFlatten +public class ApplicationGroupInner extends Resource { + /** + * Description of ApplicationGroup. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of ApplicationGroup. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * HostPool arm path of ApplicationGroup. + */ + @JsonProperty(value = "properties.hostPoolArmPath", required = true) + private String hostPoolArmPath; + + /** + * Workspace arm path of ApplicationGroup. + */ + @JsonProperty(value = "properties.workspaceArmPath", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceArmPath; + + /** + * Resource Type of ApplicationGroup. Possible values include: 'RemoteApp', + * 'Desktop'. + */ + @JsonProperty(value = "properties.applicationGroupType", required = true) + private ApplicationGroupType applicationGroupType; + + /** + * Get description of ApplicationGroup. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of ApplicationGroup. + * + * @param description the description value to set + * @return the ApplicationGroupInner object itself. + */ + public ApplicationGroupInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of ApplicationGroup. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of ApplicationGroup. + * + * @param friendlyName the friendlyName value to set + * @return the ApplicationGroupInner object itself. + */ + public ApplicationGroupInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get hostPool arm path of ApplicationGroup. + * + * @return the hostPoolArmPath value + */ + public String hostPoolArmPath() { + return this.hostPoolArmPath; + } + + /** + * Set hostPool arm path of ApplicationGroup. + * + * @param hostPoolArmPath the hostPoolArmPath value to set + * @return the ApplicationGroupInner object itself. + */ + public ApplicationGroupInner withHostPoolArmPath(String hostPoolArmPath) { + this.hostPoolArmPath = hostPoolArmPath; + return this; + } + + /** + * Get workspace arm path of ApplicationGroup. + * + * @return the workspaceArmPath value + */ + public String workspaceArmPath() { + return this.workspaceArmPath; + } + + /** + * Get resource Type of ApplicationGroup. Possible values include: 'RemoteApp', 'Desktop'. + * + * @return the applicationGroupType value + */ + public ApplicationGroupType applicationGroupType() { + return this.applicationGroupType; + } + + /** + * Set resource Type of ApplicationGroup. Possible values include: 'RemoteApp', 'Desktop'. + * + * @param applicationGroupType the applicationGroupType value to set + * @return the ApplicationGroupInner object itself. + */ + public ApplicationGroupInner withApplicationGroupType(ApplicationGroupType applicationGroupType) { + this.applicationGroupType = applicationGroupType; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsImpl.java new file mode 100644 index 0000000000000..c39c51aee86c3 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsImpl.java @@ -0,0 +1,138 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroups; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroup; +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; + +class ApplicationGroupsImpl extends GroupableResourcesCoreImpl implements ApplicationGroups { + protected ApplicationGroupsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().applicationGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ApplicationGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ApplicationGroupsInner 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) { + ApplicationGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ApplicationGroupsInner 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 ApplicationGroup call(ApplicationGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ApplicationGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ApplicationGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ApplicationGroup call(ApplicationGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ApplicationGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ApplicationGroupImpl wrapModel(ApplicationGroupInner inner) { + return new ApplicationGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ApplicationGroupImpl wrapModel(String name) { + return new ApplicationGroupImpl(name, new ApplicationGroupInner(), this.manager()); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsInner.java new file mode 100644 index 0000000000000..4a5be42d12981 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationGroupsInner.java @@ -0,0 +1,1205 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.ApplicationGroupPatch; +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 ApplicationGroups. + */ +public class ApplicationGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ApplicationGroupsService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of ApplicationGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationGroupsInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(ApplicationGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @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.desktopvirtualization.v2020_10_19_preview.ApplicationGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Query("api-version") String apiVersion, @Body ApplicationGroupInner applicationGroup, @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.desktopvirtualization.v2020_10_19_preview.ApplicationGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @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.desktopvirtualization.v2020_10_19_preview.ApplicationGroups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Query("api-version") String apiVersion, @Body ApplicationGroupPatch applicationGroup, @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.desktopvirtualization.v2020_10_19_preview.ApplicationGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.desktopvirtualization.v2020_10_19_preview.ApplicationGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.desktopvirtualization.v2020_10_19_preview.ApplicationGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.desktopvirtualization.v2020_10_19_preview.ApplicationGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get an application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 ApplicationGroupInner object if successful. + */ + public ApplicationGroupInner getByResourceGroup(String resourceGroupName, String applicationGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGroupName).toBlocking().single().body(); + } + + /** + * Get an application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 getByResourceGroupAsync(String resourceGroupName, String applicationGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGroupName), serviceCallback); + } + + /** + * Get an application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationGroupName).map(new Func1, ApplicationGroupInner>() { + @Override + public ApplicationGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationGroupName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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, applicationGroupName, 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 update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @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 ApplicationGroupInner object if successful. + */ + public ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationGroup).toBlocking().single().body(); + } + + /** + * Create or update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @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 applicationGroupName, ApplicationGroupInner applicationGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationGroup), serviceCallback); + } + + /** + * Create or update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationGroup).map(new Func1, ApplicationGroupInner>() { + @Override + public ApplicationGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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 (applicationGroup == null) { + throw new IllegalArgumentException("Parameter applicationGroup is required and cannot be null."); + } + Validator.validate(applicationGroup); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, applicationGroupName, this.client.apiVersion(), applicationGroup, 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); + } + + /** + * Remove an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 + */ + public void delete(String resourceGroupName, String applicationGroupName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationGroupName).toBlocking().single().body(); + } + + /** + * Remove an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 deleteAsync(String resourceGroupName, String applicationGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationGroupName), serviceCallback); + } + + /** + * Remove an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String applicationGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationGroupName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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, applicationGroupName, 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); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 ApplicationGroupInner object if successful. + */ + public ApplicationGroupInner update(String resourceGroupName, String applicationGroupName) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName).toBlocking().single().body(); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 updateAsync(String resourceGroupName, String applicationGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, applicationGroupName), serviceCallback); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String applicationGroupName) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName).map(new Func1, ApplicationGroupInner>() { + @Override + public ApplicationGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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 ApplicationGroupPatch applicationGroup = null; + return service.update(this.client.subscriptionId(), resourceGroupName, applicationGroupName, this.client.apiVersion(), applicationGroup, 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); + } + } + }); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @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 ApplicationGroupInner object if successful. + */ + public ApplicationGroupInner update(String resourceGroupName, String applicationGroupName, ApplicationGroupPatch applicationGroup) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationGroup).toBlocking().single().body(); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @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 applicationGroupName, ApplicationGroupPatch applicationGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationGroup), serviceCallback); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String applicationGroupName, ApplicationGroupPatch applicationGroup) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationGroup).map(new Func1, ApplicationGroupInner>() { + @Override + public ApplicationGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an applicationGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationGroup Object containing ApplicationGroup definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, ApplicationGroupPatch applicationGroup) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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(applicationGroup); + return service.update(this.client.subscriptionId(), resourceGroupName, applicationGroupName, this.client.apiVersion(), applicationGroup, 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 applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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<ApplicationGroupInner> 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 applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> 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 applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGroupInner> 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 filter = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, 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 applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @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<ApplicationGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @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 filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applicationGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter) + .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 applicationGroups. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter) { + 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, this.client.apiVersion(), filter, 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); + } + + /** + * List applicationGroups in 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<ApplicationGroupInner> 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 applicationGroups in 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 applicationGroups in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applicationGroups in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> 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 applicationGroups in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGroupInner> 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 filter = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, 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 applicationGroups in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @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<ApplicationGroupInner> object if successful. + */ + public PagedList list(final String filter) { + ServiceResponse> response = listSinglePageAsync(filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List applicationGroups in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @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 filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List applicationGroups in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> object + */ + public Observable> listAsync(final String filter) { + return listWithServiceResponseAsync(filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applicationGroups in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationGroupInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter) { + return listSinglePageAsync(filter) + .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 applicationGroups in subscription. + * + ServiceResponse> * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter) { + 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(), this.client.apiVersion(), filter, 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 applicationGroups. + * + * @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<ApplicationGroupInner> 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 applicationGroups. + * + * @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 applicationGroups. + * + * @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<ApplicationGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applicationGroups. + * + * @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<ApplicationGroupInner> 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 applicationGroups. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationGroupInner> 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); + } + + /** + * List applicationGroups in 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<ApplicationGroupInner> 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 applicationGroups in 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 applicationGroups in 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<ApplicationGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applicationGroups in 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<ApplicationGroupInner> 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 applicationGroups in 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<ApplicationGroupInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationImpl.java new file mode 100644 index 0000000000000..0f8101c8d85dc --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationImpl.java @@ -0,0 +1,300 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Application; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationPatch; +import java.util.Map; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.RemoteApplicationType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.CommandLineSetting; +import rx.functions.Func1; + +class ApplicationImpl extends CreatableUpdatableImpl implements Application, Application.Definition, Application.Update { + private final DesktopVirtualizationManager manager; + private String resourceGroupName; + private String applicationGroupName; + private String applicationName; + private ApplicationPatch updateParameter; + + ApplicationImpl(String name, DesktopVirtualizationManager manager) { + super(name, new ApplicationInner()); + this.manager = manager; + // Set resource name + this.applicationName = name; + // + this.updateParameter = new ApplicationPatch(); + } + + ApplicationImpl(ApplicationInner inner, DesktopVirtualizationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.applicationGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "applicationGroups"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + // + this.updateParameter = new ApplicationPatch(); + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createOrUpdateAsync(this.resourceGroupName, this.applicationGroupName, this.applicationName, this.inner()) + .map(new Func1() { + @Override + public ApplicationInner call(ApplicationInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.updateAsync(this.resourceGroupName, this.applicationGroupName, this.applicationName, this.updateParameter) + .map(new Func1() { + @Override + public ApplicationInner call(ApplicationInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.resourceGroupName, this.applicationGroupName, this.applicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ApplicationPatch(); + } + + @Override + public RemoteApplicationType applicationType() { + return this.inner().applicationType(); + } + + @Override + public String commandLineArguments() { + return this.inner().commandLineArguments(); + } + + @Override + public CommandLineSetting commandLineSetting() { + return this.inner().commandLineSetting(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String filePath() { + return this.inner().filePath(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public byte[] iconContent() { + return this.inner().iconContent(); + } + + @Override + public String iconHash() { + return this.inner().iconHash(); + } + + @Override + public Integer iconIndex() { + return this.inner().iconIndex(); + } + + @Override + public String iconPath() { + return this.inner().iconPath(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String msixPackageApplicationId() { + return this.inner().msixPackageApplicationId(); + } + + @Override + public String msixPackageFamilyName() { + return this.inner().msixPackageFamilyName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean showInPortal() { + return this.inner().showInPortal(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ApplicationImpl withExistingApplicationGroup(String resourceGroupName, String applicationGroupName) { + this.resourceGroupName = resourceGroupName; + this.applicationGroupName = applicationGroupName; + return this; + } + + @Override + public ApplicationImpl withTags(Map tags) { + this.updateParameter.withTags(tags); + return this; + } + + @Override + public ApplicationImpl withCommandLineSetting(CommandLineSetting commandLineSetting) { + if (isInCreateMode()) { + this.inner().withCommandLineSetting(commandLineSetting); + } else { + this.updateParameter.withCommandLineSetting(commandLineSetting); + } + return this; + } + + @Override + public ApplicationImpl withApplicationType(RemoteApplicationType applicationType) { + if (isInCreateMode()) { + this.inner().withApplicationType(applicationType); + } else { + this.updateParameter.withApplicationType(applicationType); + } + return this; + } + + @Override + public ApplicationImpl withCommandLineArguments(String commandLineArguments) { + if (isInCreateMode()) { + this.inner().withCommandLineArguments(commandLineArguments); + } else { + this.updateParameter.withCommandLineArguments(commandLineArguments); + } + return this; + } + + @Override + public ApplicationImpl withDescription(String description) { + if (isInCreateMode()) { + this.inner().withDescription(description); + } else { + this.updateParameter.withDescription(description); + } + return this; + } + + @Override + public ApplicationImpl withFilePath(String filePath) { + if (isInCreateMode()) { + this.inner().withFilePath(filePath); + } else { + this.updateParameter.withFilePath(filePath); + } + return this; + } + + @Override + public ApplicationImpl withFriendlyName(String friendlyName) { + if (isInCreateMode()) { + this.inner().withFriendlyName(friendlyName); + } else { + this.updateParameter.withFriendlyName(friendlyName); + } + return this; + } + + @Override + public ApplicationImpl withIconIndex(Integer iconIndex) { + if (isInCreateMode()) { + this.inner().withIconIndex(iconIndex); + } else { + this.updateParameter.withIconIndex(iconIndex); + } + return this; + } + + @Override + public ApplicationImpl withIconPath(String iconPath) { + if (isInCreateMode()) { + this.inner().withIconPath(iconPath); + } else { + this.updateParameter.withIconPath(iconPath); + } + return this; + } + + @Override + public ApplicationImpl withMsixPackageApplicationId(String msixPackageApplicationId) { + if (isInCreateMode()) { + this.inner().withMsixPackageApplicationId(msixPackageApplicationId); + } else { + this.updateParameter.withMsixPackageApplicationId(msixPackageApplicationId); + } + return this; + } + + @Override + public ApplicationImpl withMsixPackageFamilyName(String msixPackageFamilyName) { + if (isInCreateMode()) { + this.inner().withMsixPackageFamilyName(msixPackageFamilyName); + } else { + this.updateParameter.withMsixPackageFamilyName(msixPackageFamilyName); + } + return this; + } + + @Override + public ApplicationImpl withShowInPortal(Boolean showInPortal) { + if (isInCreateMode()) { + this.inner().withShowInPortal(showInPortal); + } else { + this.updateParameter.withShowInPortal(showInPortal); + } + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationInner.java new file mode 100644 index 0000000000000..d3210cc0b6b12 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationInner.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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.RemoteApplicationType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.CommandLineSetting; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Schema for Application properties. + */ +@JsonFlatten +public class ApplicationInner extends ProxyResource { + /** + * Description of Application. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of Application. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Specifies a path for the executable file for the application. + */ + @JsonProperty(value = "properties.filePath") + private String filePath; + + /** + * Specifies the package family name for MSIX applications. + */ + @JsonProperty(value = "properties.msixPackageFamilyName") + private String msixPackageFamilyName; + + /** + * Specifies the package application Id for MSIX applications. + */ + @JsonProperty(value = "properties.msixPackageApplicationId") + private String msixPackageApplicationId; + + /** + * Resource Type of Application. Possible values include: 'InBuilt', + * 'MsixApplication'. + */ + @JsonProperty(value = "properties.applicationType") + private RemoteApplicationType applicationType; + + /** + * Specifies whether this published application can be launched with + * command line arguments provided by the client, command line arguments + * specified at publish time, or no command line arguments at all. Possible + * values include: 'DoNotAllow', 'Allow', 'Require'. + */ + @JsonProperty(value = "properties.commandLineSetting", required = true) + private CommandLineSetting commandLineSetting; + + /** + * Command Line Arguments for Application. + */ + @JsonProperty(value = "properties.commandLineArguments") + private String commandLineArguments; + + /** + * Specifies whether to show the RemoteApp program in the RD Web Access + * server. + */ + @JsonProperty(value = "properties.showInPortal") + private Boolean showInPortal; + + /** + * Path to icon. + */ + @JsonProperty(value = "properties.iconPath") + private String iconPath; + + /** + * Index of the icon. + */ + @JsonProperty(value = "properties.iconIndex") + private Integer iconIndex; + + /** + * Hash of the icon. + */ + @JsonProperty(value = "properties.iconHash", access = JsonProperty.Access.WRITE_ONLY) + private String iconHash; + + /** + * the icon a 64 bit string as a byte array. + */ + @JsonProperty(value = "properties.iconContent", access = JsonProperty.Access.WRITE_ONLY) + private byte[] iconContent; + + /** + * Get description of Application. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of Application. + * + * @param description the description value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of Application. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of Application. + * + * @param friendlyName the friendlyName value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get specifies a path for the executable file for the application. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set specifies a path for the executable file for the application. + * + * @param filePath the filePath value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get specifies the package family name for MSIX applications. + * + * @return the msixPackageFamilyName value + */ + public String msixPackageFamilyName() { + return this.msixPackageFamilyName; + } + + /** + * Set specifies the package family name for MSIX applications. + * + * @param msixPackageFamilyName the msixPackageFamilyName value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withMsixPackageFamilyName(String msixPackageFamilyName) { + this.msixPackageFamilyName = msixPackageFamilyName; + return this; + } + + /** + * Get specifies the package application Id for MSIX applications. + * + * @return the msixPackageApplicationId value + */ + public String msixPackageApplicationId() { + return this.msixPackageApplicationId; + } + + /** + * Set specifies the package application Id for MSIX applications. + * + * @param msixPackageApplicationId the msixPackageApplicationId value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withMsixPackageApplicationId(String msixPackageApplicationId) { + this.msixPackageApplicationId = msixPackageApplicationId; + return this; + } + + /** + * Get resource Type of Application. Possible values include: 'InBuilt', 'MsixApplication'. + * + * @return the applicationType value + */ + public RemoteApplicationType applicationType() { + return this.applicationType; + } + + /** + * Set resource Type of Application. Possible values include: 'InBuilt', 'MsixApplication'. + * + * @param applicationType the applicationType value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withApplicationType(RemoteApplicationType applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require'. + * + * @return the commandLineSetting value + */ + public CommandLineSetting commandLineSetting() { + return this.commandLineSetting; + } + + /** + * Set specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require'. + * + * @param commandLineSetting the commandLineSetting value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withCommandLineSetting(CommandLineSetting commandLineSetting) { + this.commandLineSetting = commandLineSetting; + return this; + } + + /** + * Get command Line Arguments for Application. + * + * @return the commandLineArguments value + */ + public String commandLineArguments() { + return this.commandLineArguments; + } + + /** + * Set command Line Arguments for Application. + * + * @param commandLineArguments the commandLineArguments value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withCommandLineArguments(String commandLineArguments) { + this.commandLineArguments = commandLineArguments; + return this; + } + + /** + * Get specifies whether to show the RemoteApp program in the RD Web Access server. + * + * @return the showInPortal value + */ + public Boolean showInPortal() { + return this.showInPortal; + } + + /** + * Set specifies whether to show the RemoteApp program in the RD Web Access server. + * + * @param showInPortal the showInPortal value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withShowInPortal(Boolean showInPortal) { + this.showInPortal = showInPortal; + return this; + } + + /** + * Get path to icon. + * + * @return the iconPath value + */ + public String iconPath() { + return this.iconPath; + } + + /** + * Set path to icon. + * + * @param iconPath the iconPath value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withIconPath(String iconPath) { + this.iconPath = iconPath; + return this; + } + + /** + * Get index of the icon. + * + * @return the iconIndex value + */ + public Integer iconIndex() { + return this.iconIndex; + } + + /** + * Set index of the icon. + * + * @param iconIndex the iconIndex value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withIconIndex(Integer iconIndex) { + this.iconIndex = iconIndex; + return this; + } + + /** + * Get hash of the icon. + * + * @return the iconHash value + */ + public String iconHash() { + return this.iconHash; + } + + /** + * Get the icon a 64 bit string as a byte array. + * + * @return the iconContent value + */ + public byte[] iconContent() { + return this.iconContent; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsImpl.java new file mode 100644 index 0000000000000..31dc2582e50d6 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsImpl.java @@ -0,0 +1,85 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Application; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final DesktopVirtualizationManager manager; + + ApplicationsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public ApplicationImpl define(String name) { + return wrapModel(name); + } + + private ApplicationImpl wrapModel(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + + private ApplicationImpl wrapModel(String name) { + return new ApplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String applicationGroupName) { + ApplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, applicationGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, applicationGroupName, applicationName) + .flatMap(new Func1>() { + @Override + public Observable call(ApplicationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Application)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, applicationGroupName, applicationName).toCompletable(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsInner.java new file mode 100644 index 0000000000000..cd12ab29425c3 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ApplicationsInner.java @@ -0,0 +1,799 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.ApplicationPatch; +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 Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Path("applicationName") String applicationName, @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.desktopvirtualization.v2020_10_19_preview.Applications createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner application, @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.desktopvirtualization.v2020_10_19_preview.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Path("applicationName") String applicationName, @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.desktopvirtualization.v2020_10_19_preview.Applications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationPatch application, @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.desktopvirtualization.v2020_10_19_preview.Applications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @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.desktopvirtualization.v2020_10_19_preview.Applications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application 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 ApplicationInner object if successful. + */ + public ApplicationInner get(String resourceGroupName, String applicationGroupName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName).toBlocking().single().body(); + } + + /** + * Get an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application 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 getAsync(String resourceGroupName, String applicationGroupName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName), serviceCallback); + } + + /** + * Get an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable getAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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, applicationGroupName, applicationName, 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 update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @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 ApplicationInner object if successful. + */ + public ApplicationInner createOrUpdate(String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName, application).toBlocking().single().body(); + } + + /** + * Create or update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @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 applicationGroupName, String applicationName, ApplicationInner application, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName, application), serviceCallback); + } + + /** + * Create or update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName, application).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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 (application == null) { + throw new IllegalArgumentException("Parameter application is required and cannot be null."); + } + Validator.validate(application); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, applicationGroupName, applicationName, this.client.apiVersion(), application, 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); + } + + /** + * Remove an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application 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 + */ + public void delete(String resourceGroupName, String applicationGroupName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName).toBlocking().single().body(); + } + + /** + * Remove an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application 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 deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName), serviceCallback); + } + + /** + * Remove an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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, applicationGroupName, applicationName, 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); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application 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 ApplicationInner object if successful. + */ + public ApplicationInner update(String resourceGroupName, String applicationGroupName, String applicationName) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName).toBlocking().single().body(); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application 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 updateAsync(String resourceGroupName, String applicationGroupName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName), serviceCallback); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable updateAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String applicationName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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 ApplicationPatch application = null; + return service.update(this.client.subscriptionId(), resourceGroupName, applicationGroupName, applicationName, this.client.apiVersion(), application, 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); + } + } + }); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @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 ApplicationInner object if successful. + */ + public ApplicationInner update(String resourceGroupName, String applicationGroupName, String applicationName, ApplicationPatch application) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName, application).toBlocking().single().body(); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @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 applicationGroupName, String applicationName, ApplicationPatch application, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName, application), serviceCallback); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable updateAsync(String resourceGroupName, String applicationGroupName, String applicationName, ApplicationPatch application) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, applicationName, application).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param applicationName The name of the application within the specified application group + * @param application Object containing Application definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String applicationName, ApplicationPatch application) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName 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(application); + return service.update(this.client.subscriptionId(), resourceGroupName, applicationGroupName, applicationName, this.client.apiVersion(), application, 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 applications. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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<ApplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String applicationGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, applicationGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List applications. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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> listAsync(final String resourceGroupName, final String applicationGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, applicationGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List applications. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String applicationGroupName) { + return listWithServiceResponseAsync(resourceGroupName, applicationGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applications. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String applicationGroupName) { + return listSinglePageAsync(resourceGroupName, applicationGroupName) + .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 applications. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String applicationGroupName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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, applicationGroupName, 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 applications. + * + * @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<ApplicationInner> 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 applications. + * + * @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 applications. + * + * @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<ApplicationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List applications. + * + * @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<ApplicationInner> 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 applications. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopImpl.java new file mode 100644 index 0000000000000..9991af6bb89af --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopImpl.java @@ -0,0 +1,140 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Desktop; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.DesktopPatch; +import java.util.Map; +import rx.functions.Func1; + +class DesktopImpl extends CreatableUpdatableImpl implements Desktop, Desktop.Update { + private final DesktopVirtualizationManager manager; + private String resourceGroupName; + private String applicationGroupName; + private String desktopName; + private DesktopPatch updateParameter; + + DesktopImpl(String name, DesktopVirtualizationManager manager) { + super(name, new DesktopInner()); + this.manager = manager; + // Set resource name + this.desktopName = name; + // + this.updateParameter = new DesktopPatch(); + } + + DesktopImpl(DesktopInner inner, DesktopVirtualizationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.desktopName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.applicationGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "applicationGroups"); + this.desktopName = IdParsingUtils.getValueFromIdByName(inner.id(), "desktops"); + // + this.updateParameter = new DesktopPatch(); + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DesktopsInner client = this.manager().inner().desktops(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + DesktopsInner client = this.manager().inner().desktops(); + return client.updateAsync(this.resourceGroupName, this.applicationGroupName, this.desktopName, this.updateParameter) + .map(new Func1() { + @Override + public DesktopInner call(DesktopInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DesktopsInner client = this.manager().inner().desktops(); + return client.getAsync(this.resourceGroupName, this.applicationGroupName, this.desktopName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new DesktopPatch(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public byte[] iconContent() { + return this.inner().iconContent(); + } + + @Override + public String iconHash() { + return this.inner().iconHash(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DesktopImpl withDescription(String description) { + this.updateParameter.withDescription(description); + return this; + } + + @Override + public DesktopImpl withFriendlyName(String friendlyName) { + this.updateParameter.withFriendlyName(friendlyName); + return this; + } + + @Override + public DesktopImpl withTags(Map tags) { + this.updateParameter.withTags(tags); + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopInner.java new file mode 100644 index 0000000000000..2b700e62462a8 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopInner.java @@ -0,0 +1,102 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Schema for Desktop properties. + */ +@JsonFlatten +public class DesktopInner extends ProxyResource { + /** + * Description of Desktop. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of Desktop. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Hash of the icon. + */ + @JsonProperty(value = "properties.iconHash", access = JsonProperty.Access.WRITE_ONLY) + private String iconHash; + + /** + * The icon a 64 bit string as a byte array. + */ + @JsonProperty(value = "properties.iconContent", access = JsonProperty.Access.WRITE_ONLY) + private byte[] iconContent; + + /** + * Get description of Desktop. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of Desktop. + * + * @param description the description value to set + * @return the DesktopInner object itself. + */ + public DesktopInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of Desktop. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of Desktop. + * + * @param friendlyName the friendlyName value to set + * @return the DesktopInner object itself. + */ + public DesktopInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get hash of the icon. + * + * @return the iconHash value + */ + public String iconHash() { + return this.iconHash; + } + + /** + * Get the icon a 64 bit string as a byte array. + * + * @return the iconContent value + */ + public byte[] iconContent() { + return this.iconContent; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListImpl.java new file mode 100644 index 0000000000000..c27707cd5b0ea --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListImpl.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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.DesktopList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DesktopListImpl extends WrapperImpl implements DesktopList { + private final DesktopVirtualizationManager manager; + DesktopListImpl(DesktopListInner inner, DesktopVirtualizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListInner.java new file mode 100644 index 0000000000000..d522789b3792b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopListInner.java @@ -0,0 +1,60 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DesktopList. + * List of Desktop definitions. + */ +public class DesktopListInner { + /** + * List of Desktop definitions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Link to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get list of Desktop definitions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of Desktop definitions. + * + * @param value the value value to set + * @return the DesktopListInner object itself. + */ + public DesktopListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get link to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationAPIClientImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationAPIClientImpl.java new file mode 100644 index 0000000000000..c74dee7a83fb2 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationAPIClientImpl.java @@ -0,0 +1,336 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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 DesktopVirtualizationAPIClientImpl class. + */ +public class DesktopVirtualizationAPIClientImpl 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; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DesktopVirtualizationAPIClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 DesktopVirtualizationAPIClientImpl 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 DesktopVirtualizationAPIClientImpl 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 DesktopVirtualizationAPIClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * 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 WorkspacesInner object to access its operations. + */ + private WorkspacesInner workspaces; + + /** + * Gets the WorkspacesInner object to access its operations. + * @return the WorkspacesInner object. + */ + public WorkspacesInner workspaces() { + return this.workspaces; + } + + /** + * The ApplicationGroupsInner object to access its operations. + */ + private ApplicationGroupsInner applicationGroups; + + /** + * Gets the ApplicationGroupsInner object to access its operations. + * @return the ApplicationGroupsInner object. + */ + public ApplicationGroupsInner applicationGroups() { + return this.applicationGroups; + } + + /** + * The StartMenuItemsInner object to access its operations. + */ + private StartMenuItemsInner startMenuItems; + + /** + * Gets the StartMenuItemsInner object to access its operations. + * @return the StartMenuItemsInner object. + */ + public StartMenuItemsInner startMenuItems() { + return this.startMenuItems; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The DesktopsInner object to access its operations. + */ + private DesktopsInner desktops; + + /** + * Gets the DesktopsInner object to access its operations. + * @return the DesktopsInner object. + */ + public DesktopsInner desktops() { + return this.desktops; + } + + /** + * The HostPoolsInner object to access its operations. + */ + private HostPoolsInner hostPools; + + /** + * Gets the HostPoolsInner object to access its operations. + * @return the HostPoolsInner object. + */ + public HostPoolsInner hostPools() { + return this.hostPools; + } + + /** + * The UserSessionsInner object to access its operations. + */ + private UserSessionsInner userSessions; + + /** + * Gets the UserSessionsInner object to access its operations. + * @return the UserSessionsInner object. + */ + public UserSessionsInner userSessions() { + return this.userSessions; + } + + /** + * The SessionHostsInner object to access its operations. + */ + private SessionHostsInner sessionHosts; + + /** + * Gets the SessionHostsInner object to access its operations. + * @return the SessionHostsInner object. + */ + public SessionHostsInner sessionHosts() { + return this.sessionHosts; + } + + /** + * The MSIXPackagesInner object to access its operations. + */ + private MSIXPackagesInner mSIXPackages; + + /** + * Gets the MSIXPackagesInner object to access its operations. + * @return the MSIXPackagesInner object. + */ + public MSIXPackagesInner mSIXPackages() { + return this.mSIXPackages; + } + + /** + * The MsixImagesInner object to access its operations. + */ + private MsixImagesInner msixImages; + + /** + * Gets the MsixImagesInner object to access its operations. + * @return the MsixImagesInner object. + */ + public MsixImagesInner msixImages() { + return this.msixImages; + } + + /** + * Initializes an instance of DesktopVirtualizationAPIClient client. + * + * @param credentials the management credentials for Azure + */ + public DesktopVirtualizationAPIClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DesktopVirtualizationAPIClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DesktopVirtualizationAPIClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DesktopVirtualizationAPIClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DesktopVirtualizationAPIClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-10-19-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.workspaces = new WorkspacesInner(restClient().retrofit(), this); + this.applicationGroups = new ApplicationGroupsInner(restClient().retrofit(), this); + this.startMenuItems = new StartMenuItemsInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.desktops = new DesktopsInner(restClient().retrofit(), this); + this.hostPools = new HostPoolsInner(restClient().retrofit(), this); + this.userSessions = new UserSessionsInner(restClient().retrofit(), this); + this.sessionHosts = new SessionHostsInner(restClient().retrofit(), this); + this.mSIXPackages = new MSIXPackagesInner(restClient().retrofit(), this); + this.msixImages = new MsixImagesInner(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(), "DesktopVirtualizationAPIClient", "2020-10-19-preview"); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationManager.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationManager.java new file mode 100644 index 0000000000000..f98410b975144 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopVirtualizationManager.java @@ -0,0 +1,219 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.Operations; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Workspaces; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationGroups; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.StartMenuItems; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Applications; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Desktops; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPools; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.UserSessions; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionHosts; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MSIXPackages; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixImages; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DesktopVirtualization resource management. + */ +public final class DesktopVirtualizationManager extends ManagerCore { + private Operations operations; + private Workspaces workspaces; + private ApplicationGroups applicationGroups; + private StartMenuItems startMenuItems; + private Applications applications; + private Desktops desktops; + private HostPools hostPools; + private UserSessions userSessions; + private SessionHosts sessionHosts; + private MSIXPackages mSIXPackages; + private MsixImages msixImages; + /** + * Get a Configurable instance that can be used to create DesktopVirtualizationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DesktopVirtualizationManager.ConfigurableImpl(); + } + /** + * Creates an instance of DesktopVirtualizationManager that exposes DesktopVirtualization resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DesktopVirtualizationManager + */ + public static DesktopVirtualizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DesktopVirtualizationManager(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 DesktopVirtualizationManager that exposes DesktopVirtualization resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DesktopVirtualizationManager + */ + public static DesktopVirtualizationManager authenticate(RestClient restClient, String subscriptionId) { + return new DesktopVirtualizationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DesktopVirtualizationManager that exposes DesktopVirtualization management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DesktopVirtualization management API entry points that work across subscriptions + */ + DesktopVirtualizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @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 Workspaces. + */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(this); + } + return this.workspaces; + } + + /** + * @return Entry point to manage ApplicationGroups. + */ + public ApplicationGroups applicationGroups() { + if (this.applicationGroups == null) { + this.applicationGroups = new ApplicationGroupsImpl(this); + } + return this.applicationGroups; + } + + /** + * @return Entry point to manage StartMenuItems. + */ + public StartMenuItems startMenuItems() { + if (this.startMenuItems == null) { + this.startMenuItems = new StartMenuItemsImpl(this); + } + return this.startMenuItems; + } + + /** + * @return Entry point to manage Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(this); + } + return this.applications; + } + + /** + * @return Entry point to manage Desktops. + */ + public Desktops desktops() { + if (this.desktops == null) { + this.desktops = new DesktopsImpl(this); + } + return this.desktops; + } + + /** + * @return Entry point to manage HostPools. + */ + public HostPools hostPools() { + if (this.hostPools == null) { + this.hostPools = new HostPoolsImpl(this); + } + return this.hostPools; + } + + /** + * @return Entry point to manage UserSessions. + */ + public UserSessions userSessions() { + if (this.userSessions == null) { + this.userSessions = new UserSessionsImpl(this); + } + return this.userSessions; + } + + /** + * @return Entry point to manage SessionHosts. + */ + public SessionHosts sessionHosts() { + if (this.sessionHosts == null) { + this.sessionHosts = new SessionHostsImpl(this); + } + return this.sessionHosts; + } + + /** + * @return Entry point to manage MSIXPackages. + */ + public MSIXPackages mSIXPackages() { + if (this.mSIXPackages == null) { + this.mSIXPackages = new MSIXPackagesImpl(this); + } + return this.mSIXPackages; + } + + /** + * @return Entry point to manage MsixImages. + */ + public MsixImages msixImages() { + if (this.msixImages == null) { + this.msixImages = new MsixImagesImpl(this); + } + return this.msixImages; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DesktopVirtualizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DesktopVirtualizationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DesktopVirtualizationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DesktopVirtualizationAPIClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsImpl.java new file mode 100644 index 0000000000000..fa999861ed15b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsImpl.java @@ -0,0 +1,63 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Desktops; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.DesktopList; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Desktop; + +class DesktopsImpl extends WrapperImpl implements Desktops { + private final DesktopVirtualizationManager manager; + + DesktopsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().desktops()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + private DesktopImpl wrapModel(DesktopInner inner) { + return new DesktopImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String applicationGroupName) { + DesktopsInner client = this.inner(); + return client.listAsync(resourceGroupName, applicationGroupName) + .map(new Func1() { + @Override + public DesktopList call(DesktopListInner inner) { + return new DesktopListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String applicationGroupName, String desktopName) { + DesktopsInner client = this.inner(); + return client.getAsync(resourceGroupName, applicationGroupName, desktopName) + .flatMap(new Func1>() { + @Override + public Observable call(DesktopInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Desktop)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsInner.java new file mode 100644 index 0000000000000..e05c498be89f1 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/DesktopsInner.java @@ -0,0 +1,436 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.DesktopPatch; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +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 Desktops. + */ +public class DesktopsInner { + /** The Retrofit service to perform REST calls. */ + private DesktopsService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of DesktopsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DesktopsInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(DesktopsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Desktops to be + * used by Retrofit to perform actually REST calls. + */ + interface DesktopsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Desktops get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Path("desktopName") String desktopName, @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.desktopvirtualization.v2020_10_19_preview.Desktops update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Path("desktopName") String desktopName, @Query("api-version") String apiVersion, @Body DesktopPatch desktop, @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.desktopvirtualization.v2020_10_19_preview.Desktops list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop 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 DesktopInner object if successful. + */ + public DesktopInner get(String resourceGroupName, String applicationGroupName, String desktopName) { + return getWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName).toBlocking().single().body(); + } + + /** + * Get a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop 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 getAsync(String resourceGroupName, String applicationGroupName, String desktopName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName), serviceCallback); + } + + /** + * Get a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopInner object + */ + public Observable getAsync(String resourceGroupName, String applicationGroupName, String desktopName) { + return getWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName).map(new Func1, DesktopInner>() { + @Override + public DesktopInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String desktopName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (desktopName == null) { + throw new IllegalArgumentException("Parameter desktopName 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, applicationGroupName, desktopName, 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); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop 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 DesktopInner object if successful. + */ + public DesktopInner update(String resourceGroupName, String applicationGroupName, String desktopName) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName).toBlocking().single().body(); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop 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 updateAsync(String resourceGroupName, String applicationGroupName, String desktopName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName), serviceCallback); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopInner object + */ + public Observable updateAsync(String resourceGroupName, String applicationGroupName, String desktopName) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName).map(new Func1, DesktopInner>() { + @Override + public DesktopInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String desktopName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (desktopName == null) { + throw new IllegalArgumentException("Parameter desktopName 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 DesktopPatch desktop = null; + return service.update(this.client.subscriptionId(), resourceGroupName, applicationGroupName, desktopName, this.client.apiVersion(), desktop, 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); + } + } + }); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @param desktop Object containing Desktop definitions. + * @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 DesktopInner object if successful. + */ + public DesktopInner update(String resourceGroupName, String applicationGroupName, String desktopName, DesktopPatch desktop) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop).toBlocking().single().body(); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @param desktop Object containing Desktop definitions. + * @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 applicationGroupName, String desktopName, DesktopPatch desktop, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop), serviceCallback); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @param desktop Object containing Desktop definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopInner object + */ + public Observable updateAsync(String resourceGroupName, String applicationGroupName, String desktopName, DesktopPatch desktop) { + return updateWithServiceResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop).map(new Func1, DesktopInner>() { + @Override + public DesktopInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a desktop. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @param desktopName The name of the desktop within the specified desktop group + * @param desktop Object containing Desktop definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String applicationGroupName, String desktopName, DesktopPatch desktop) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName is required and cannot be null."); + } + if (desktopName == null) { + throw new IllegalArgumentException("Parameter desktopName 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(desktop); + return service.update(this.client.subscriptionId(), resourceGroupName, applicationGroupName, desktopName, this.client.apiVersion(), desktop, 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 desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 DesktopListInner object if successful. + */ + public DesktopListInner list(String resourceGroupName, String applicationGroupName) { + return listWithServiceResponseAsync(resourceGroupName, applicationGroupName).toBlocking().single().body(); + } + + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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 listAsync(String resourceGroupName, String applicationGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, applicationGroupName), serviceCallback); + } + + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopListInner object + */ + public Observable listAsync(String resourceGroupName, String applicationGroupName) { + return listWithServiceResponseAsync(resourceGroupName, applicationGroupName).map(new Func1, DesktopListInner>() { + @Override + public DesktopListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List desktops. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DesktopListInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String applicationGroupName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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, applicationGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageImpl.java new file mode 100644 index 0000000000000..d5a40c7b288f6 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageImpl.java @@ -0,0 +1,110 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ExpandMsixImage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageApplications; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageDependencies; + +class ExpandMsixImageImpl extends WrapperImpl implements ExpandMsixImage { + private final DesktopVirtualizationManager manager; + ExpandMsixImageImpl(ExpandMsixImageInner inner, DesktopVirtualizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String imagePath() { + return this.inner().imagePath(); + } + + @Override + public boolean isActive() { + return this.inner().isActive(); + } + + @Override + public boolean isRegularRegistration() { + return this.inner().isRegularRegistration(); + } + + @Override + public DateTime lastUpdated() { + return this.inner().lastUpdated(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String packageAlias() { + return this.inner().packageAlias(); + } + + @Override + public List packageApplications() { + return this.inner().packageApplications(); + } + + @Override + public List packageDependencies() { + return this.inner().packageDependencies(); + } + + @Override + public String packageFamilyName() { + return this.inner().packageFamilyName(); + } + + @Override + public String packageFullName() { + return this.inner().packageFullName(); + } + + @Override + public String packageName() { + return this.inner().packageName(); + } + + @Override + public String packageRelativePath() { + return this.inner().packageRelativePath(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageInner.java new file mode 100644 index 0000000000000..a78e5423536ac --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ExpandMsixImageInner.java @@ -0,0 +1,364 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageDependencies; +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageApplications; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents the definition of contents retrieved after expanding the MSIX + * Image. + */ +@JsonFlatten +public class ExpandMsixImageInner extends ProxyResource { + /** + * Alias of MSIX Package. + */ + @JsonProperty(value = "properties.packageAlias") + private String packageAlias; + + /** + * VHD/CIM image path on Network Share. + */ + @JsonProperty(value = "properties.imagePath") + private String imagePath; + + /** + * Package Name from appxmanifest.xml. + */ + @JsonProperty(value = "properties.packageName") + private String packageName; + + /** + * Package Family Name from appxmanifest.xml. Contains Package Name and + * Publisher name. + */ + @JsonProperty(value = "properties.packageFamilyName") + private String packageFamilyName; + + /** + * Package Full Name from appxmanifest.xml. + */ + @JsonProperty(value = "properties.packageFullName") + private String packageFullName; + + /** + * User friendly Name to be displayed in the portal. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Relative Path to the package inside the image. + */ + @JsonProperty(value = "properties.packageRelativePath") + private String packageRelativePath; + + /** + * Specifies how to register Package in feed. + */ + @JsonProperty(value = "properties.isRegularRegistration") + private boolean isRegularRegistration; + + /** + * Make this version of the package the active one across the hostpool. + */ + @JsonProperty(value = "properties.isActive") + private boolean isActive; + + /** + * List of package dependencies. + */ + @JsonProperty(value = "properties.packageDependencies") + private List packageDependencies; + + /** + * Package Version found in the appxmanifest.xml. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Date Package was last updated, found in the appxmanifest.xml. + */ + @JsonProperty(value = "properties.lastUpdated") + private DateTime lastUpdated; + + /** + * List of package applications. + */ + @JsonProperty(value = "properties.packageApplications") + private List packageApplications; + + /** + * Get alias of MSIX Package. + * + * @return the packageAlias value + */ + public String packageAlias() { + return this.packageAlias; + } + + /** + * Set alias of MSIX Package. + * + * @param packageAlias the packageAlias value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withPackageAlias(String packageAlias) { + this.packageAlias = packageAlias; + return this; + } + + /** + * Get vHD/CIM image path on Network Share. + * + * @return the imagePath value + */ + public String imagePath() { + return this.imagePath; + } + + /** + * Set vHD/CIM image path on Network Share. + * + * @param imagePath the imagePath value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withImagePath(String imagePath) { + this.imagePath = imagePath; + return this; + } + + /** + * Get package Name from appxmanifest.xml. + * + * @return the packageName value + */ + public String packageName() { + return this.packageName; + } + + /** + * Set package Name from appxmanifest.xml. + * + * @param packageName the packageName value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withPackageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + * + * @return the packageFamilyName value + */ + public String packageFamilyName() { + return this.packageFamilyName; + } + + /** + * Set package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + * + * @param packageFamilyName the packageFamilyName value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withPackageFamilyName(String packageFamilyName) { + this.packageFamilyName = packageFamilyName; + return this; + } + + /** + * Get package Full Name from appxmanifest.xml. + * + * @return the packageFullName value + */ + public String packageFullName() { + return this.packageFullName; + } + + /** + * Set package Full Name from appxmanifest.xml. + * + * @param packageFullName the packageFullName value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withPackageFullName(String packageFullName) { + this.packageFullName = packageFullName; + return this; + } + + /** + * Get user friendly Name to be displayed in the portal. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set user friendly Name to be displayed in the portal. + * + * @param displayName the displayName value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get relative Path to the package inside the image. + * + * @return the packageRelativePath value + */ + public String packageRelativePath() { + return this.packageRelativePath; + } + + /** + * Set relative Path to the package inside the image. + * + * @param packageRelativePath the packageRelativePath value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withPackageRelativePath(String packageRelativePath) { + this.packageRelativePath = packageRelativePath; + return this; + } + + /** + * Get specifies how to register Package in feed. + * + * @return the isRegularRegistration value + */ + public boolean isRegularRegistration() { + return this.isRegularRegistration; + } + + /** + * Set specifies how to register Package in feed. + * + * @param isRegularRegistration the isRegularRegistration value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withIsRegularRegistration(boolean isRegularRegistration) { + this.isRegularRegistration = isRegularRegistration; + return this; + } + + /** + * Get make this version of the package the active one across the hostpool. + * + * @return the isActive value + */ + public boolean isActive() { + return this.isActive; + } + + /** + * Set make this version of the package the active one across the hostpool. + * + * @param isActive the isActive value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withIsActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get list of package dependencies. + * + * @return the packageDependencies value + */ + public List packageDependencies() { + return this.packageDependencies; + } + + /** + * Set list of package dependencies. + * + * @param packageDependencies the packageDependencies value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withPackageDependencies(List packageDependencies) { + this.packageDependencies = packageDependencies; + return this; + } + + /** + * Get package Version found in the appxmanifest.xml. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set package Version found in the appxmanifest.xml. + * + * @param version the version value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get date Package was last updated, found in the appxmanifest.xml. + * + * @return the lastUpdated value + */ + public DateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set date Package was last updated, found in the appxmanifest.xml. + * + * @param lastUpdated the lastUpdated value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withLastUpdated(DateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get list of package applications. + * + * @return the packageApplications value + */ + public List packageApplications() { + return this.packageApplications; + } + + /** + * Set list of package applications. + * + * @param packageApplications the packageApplications value to set + * @return the ExpandMsixImageInner object itself. + */ + public ExpandMsixImageInner withPackageApplications(List packageApplications) { + this.packageApplications = packageApplications; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolImpl.java new file mode 100644 index 0000000000000..e03f5d8bae99f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolImpl.java @@ -0,0 +1,333 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPool; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPoolPatch; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPoolType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.PersonalDesktopAssignmentType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.LoadBalancerType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.RegistrationInfo; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SSOSecretType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.PreferredAppGroupType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.RegistrationInfoPatch; +import rx.functions.Func1; + +class HostPoolImpl extends GroupableResourceCoreImpl implements HostPool, HostPool.Definition, HostPool.Update { + private HostPoolPatch updateParameter; + HostPoolImpl(String name, HostPoolInner inner, DesktopVirtualizationManager manager) { + super(name, inner, manager); + this.updateParameter = new HostPoolPatch(); + } + + @Override + public Observable createResourceAsync() { + HostPoolsInner client = this.manager().inner().hostPools(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public HostPoolInner call(HostPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + HostPoolsInner client = this.manager().inner().hostPools(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public HostPoolInner call(HostPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + HostPoolsInner client = this.manager().inner().hostPools(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new HostPoolPatch(); + } + + @Override + public List applicationGroupReferences() { + return this.inner().applicationGroupReferences(); + } + + @Override + public String customRdpProperty() { + return this.inner().customRdpProperty(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public HostPoolType hostPoolType() { + return this.inner().hostPoolType(); + } + + @Override + public LoadBalancerType loadBalancerType() { + return this.inner().loadBalancerType(); + } + + @Override + public Integer maxSessionLimit() { + return this.inner().maxSessionLimit(); + } + + @Override + public PersonalDesktopAssignmentType personalDesktopAssignmentType() { + return this.inner().personalDesktopAssignmentType(); + } + + @Override + public PreferredAppGroupType preferredAppGroupType() { + return this.inner().preferredAppGroupType(); + } + + @Override + public RegistrationInfo registrationInfo() { + return this.inner().registrationInfo(); + } + + @Override + public Integer ring() { + return this.inner().ring(); + } + + @Override + public String ssoadfsAuthority() { + return this.inner().ssoadfsAuthority(); + } + + @Override + public String ssoClientId() { + return this.inner().ssoClientId(); + } + + @Override + public String ssoClientSecretKeyVaultPath() { + return this.inner().ssoClientSecretKeyVaultPath(); + } + + @Override + public String ssoContext() { + return this.inner().ssoContext(); + } + + @Override + public SSOSecretType ssoSecretType() { + return this.inner().ssoSecretType(); + } + + @Override + public Boolean validationEnvironment() { + return this.inner().validationEnvironment(); + } + + @Override + public String vmTemplate() { + return this.inner().vmTemplate(); + } + + @Override + public HostPoolImpl withHostPoolType(HostPoolType hostPoolType) { + this.inner().withHostPoolType(hostPoolType); + return this; + } + + @Override + public HostPoolImpl withRegistrationInfo(RegistrationInfo registrationInfo) { + this.inner().withRegistrationInfo(registrationInfo); + return this; + } + + @Override + public HostPoolImpl withRegistrationInfo(RegistrationInfoPatch registrationInfo) { + this.updateParameter.withRegistrationInfo(registrationInfo); + return this; + } + + @Override + public HostPoolImpl withLoadBalancerType(LoadBalancerType loadBalancerType) { + if (isInCreateMode()) { + this.inner().withLoadBalancerType(loadBalancerType); + } else { + this.updateParameter.withLoadBalancerType(loadBalancerType); + } + return this; + } + + @Override + public HostPoolImpl withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType) { + if (isInCreateMode()) { + this.inner().withPreferredAppGroupType(preferredAppGroupType); + } else { + this.updateParameter.withPreferredAppGroupType(preferredAppGroupType); + } + return this; + } + + @Override + public HostPoolImpl withCustomRdpProperty(String customRdpProperty) { + if (isInCreateMode()) { + this.inner().withCustomRdpProperty(customRdpProperty); + } else { + this.updateParameter.withCustomRdpProperty(customRdpProperty); + } + return this; + } + + @Override + public HostPoolImpl withDescription(String description) { + if (isInCreateMode()) { + this.inner().withDescription(description); + } else { + this.updateParameter.withDescription(description); + } + return this; + } + + @Override + public HostPoolImpl withFriendlyName(String friendlyName) { + if (isInCreateMode()) { + this.inner().withFriendlyName(friendlyName); + } else { + this.updateParameter.withFriendlyName(friendlyName); + } + return this; + } + + @Override + public HostPoolImpl withMaxSessionLimit(Integer maxSessionLimit) { + if (isInCreateMode()) { + this.inner().withMaxSessionLimit(maxSessionLimit); + } else { + this.updateParameter.withMaxSessionLimit(maxSessionLimit); + } + return this; + } + + @Override + public HostPoolImpl withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { + if (isInCreateMode()) { + this.inner().withPersonalDesktopAssignmentType(personalDesktopAssignmentType); + } else { + this.updateParameter.withPersonalDesktopAssignmentType(personalDesktopAssignmentType); + } + return this; + } + + @Override + public HostPoolImpl withRing(Integer ring) { + if (isInCreateMode()) { + this.inner().withRing(ring); + } else { + this.updateParameter.withRing(ring); + } + return this; + } + + @Override + public HostPoolImpl withSsoadfsAuthority(String ssoadfsAuthority) { + if (isInCreateMode()) { + this.inner().withSsoadfsAuthority(ssoadfsAuthority); + } else { + this.updateParameter.withSsoadfsAuthority(ssoadfsAuthority); + } + return this; + } + + @Override + public HostPoolImpl withSsoClientId(String ssoClientId) { + if (isInCreateMode()) { + this.inner().withSsoClientId(ssoClientId); + } else { + this.updateParameter.withSsoClientId(ssoClientId); + } + return this; + } + + @Override + public HostPoolImpl withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath) { + if (isInCreateMode()) { + this.inner().withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); + } else { + this.updateParameter.withSsoClientSecretKeyVaultPath(ssoClientSecretKeyVaultPath); + } + return this; + } + + @Override + public HostPoolImpl withSsoContext(String ssoContext) { + if (isInCreateMode()) { + this.inner().withSsoContext(ssoContext); + } else { + this.updateParameter.withSsoContext(ssoContext); + } + return this; + } + + @Override + public HostPoolImpl withSsoSecretType(SSOSecretType ssoSecretType) { + if (isInCreateMode()) { + this.inner().withSsoSecretType(ssoSecretType); + } else { + this.updateParameter.withSsoSecretType(ssoSecretType); + } + return this; + } + + @Override + public HostPoolImpl withValidationEnvironment(Boolean validationEnvironment) { + if (isInCreateMode()) { + this.inner().withValidationEnvironment(validationEnvironment); + } else { + this.updateParameter.withValidationEnvironment(validationEnvironment); + } + return this; + } + + @Override + public HostPoolImpl withVmTemplate(String vmTemplate) { + if (isInCreateMode()) { + this.inner().withVmTemplate(vmTemplate); + } else { + this.updateParameter.withVmTemplate(vmTemplate); + } + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolInner.java new file mode 100644 index 0000000000000..23714d29f3f1d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolInner.java @@ -0,0 +1,493 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPoolType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.PersonalDesktopAssignmentType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.LoadBalancerType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.RegistrationInfo; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SSOSecretType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.PreferredAppGroupType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Represents a HostPool definition. + */ +@JsonFlatten +public class HostPoolInner extends Resource { + /** + * Friendly name of HostPool. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Description of HostPool. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * HostPool type for desktop. Possible values include: 'Personal', + * 'Pooled'. + */ + @JsonProperty(value = "properties.hostPoolType", required = true) + private HostPoolType hostPoolType; + + /** + * PersonalDesktopAssignment type for HostPool. Possible values include: + * 'Automatic', 'Direct'. + */ + @JsonProperty(value = "properties.personalDesktopAssignmentType") + private PersonalDesktopAssignmentType personalDesktopAssignmentType; + + /** + * Custom rdp property of HostPool. + */ + @JsonProperty(value = "properties.customRdpProperty") + private String customRdpProperty; + + /** + * The max session limit of HostPool. + */ + @JsonProperty(value = "properties.maxSessionLimit") + private Integer maxSessionLimit; + + /** + * The type of the load balancer. Possible values include: 'BreadthFirst', + * 'DepthFirst', 'Persistent'. + */ + @JsonProperty(value = "properties.loadBalancerType", required = true) + private LoadBalancerType loadBalancerType; + + /** + * The ring number of HostPool. + */ + @JsonProperty(value = "properties.ring") + private Integer ring; + + /** + * Is validation environment. + */ + @JsonProperty(value = "properties.validationEnvironment") + private Boolean validationEnvironment; + + /** + * The registration info of HostPool. + */ + @JsonProperty(value = "properties.registrationInfo") + private RegistrationInfo registrationInfo; + + /** + * VM template for sessionhosts configuration within hostpool. + */ + @JsonProperty(value = "properties.vmTemplate") + private String vmTemplate; + + /** + * List of applicationGroup links. + */ + @JsonProperty(value = "properties.applicationGroupReferences", access = JsonProperty.Access.WRITE_ONLY) + private List applicationGroupReferences; + + /** + * Path to keyvault containing ssoContext secret. + */ + @JsonProperty(value = "properties.ssoContext") + private String ssoContext; + + /** + * URL to customer ADFS server for signing WVD SSO certificates. + */ + @JsonProperty(value = "properties.ssoadfsAuthority") + private String ssoadfsAuthority; + + /** + * ClientId for the registered Relying Party used to issue WVD SSO + * certificates. + */ + @JsonProperty(value = "properties.ssoClientId") + private String ssoClientId; + + /** + * Path to Azure KeyVault storing the secret used for communication to + * ADFS. + */ + @JsonProperty(value = "properties.ssoClientSecretKeyVaultPath") + private String ssoClientSecretKeyVaultPath; + + /** + * The type of single sign on Secret Type. Possible values include: + * 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', + * 'CertificateInKeyVault'. + */ + @JsonProperty(value = "properties.ssoSecretType") + private SSOSecretType ssoSecretType; + + /** + * The type of preferred application group type, default to Desktop + * Application Group. Possible values include: 'None', 'Desktop', + * 'RailApplications'. + */ + @JsonProperty(value = "properties.preferredAppGroupType", required = true) + private PreferredAppGroupType preferredAppGroupType; + + /** + * Get friendly name of HostPool. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of HostPool. + * + * @param friendlyName the friendlyName value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get description of HostPool. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of HostPool. + * + * @param description the description value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get hostPool type for desktop. Possible values include: 'Personal', 'Pooled'. + * + * @return the hostPoolType value + */ + public HostPoolType hostPoolType() { + return this.hostPoolType; + } + + /** + * Set hostPool type for desktop. Possible values include: 'Personal', 'Pooled'. + * + * @param hostPoolType the hostPoolType value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withHostPoolType(HostPoolType hostPoolType) { + this.hostPoolType = hostPoolType; + return this; + } + + /** + * Get personalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct'. + * + * @return the personalDesktopAssignmentType value + */ + public PersonalDesktopAssignmentType personalDesktopAssignmentType() { + return this.personalDesktopAssignmentType; + } + + /** + * Set personalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct'. + * + * @param personalDesktopAssignmentType the personalDesktopAssignmentType value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { + this.personalDesktopAssignmentType = personalDesktopAssignmentType; + return this; + } + + /** + * Get custom rdp property of HostPool. + * + * @return the customRdpProperty value + */ + public String customRdpProperty() { + return this.customRdpProperty; + } + + /** + * Set custom rdp property of HostPool. + * + * @param customRdpProperty the customRdpProperty value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withCustomRdpProperty(String customRdpProperty) { + this.customRdpProperty = customRdpProperty; + return this; + } + + /** + * Get the max session limit of HostPool. + * + * @return the maxSessionLimit value + */ + public Integer maxSessionLimit() { + return this.maxSessionLimit; + } + + /** + * Set the max session limit of HostPool. + * + * @param maxSessionLimit the maxSessionLimit value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withMaxSessionLimit(Integer maxSessionLimit) { + this.maxSessionLimit = maxSessionLimit; + return this; + } + + /** + * Get the type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent'. + * + * @return the loadBalancerType value + */ + public LoadBalancerType loadBalancerType() { + return this.loadBalancerType; + } + + /** + * Set the type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent'. + * + * @param loadBalancerType the loadBalancerType value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withLoadBalancerType(LoadBalancerType loadBalancerType) { + this.loadBalancerType = loadBalancerType; + return this; + } + + /** + * Get the ring number of HostPool. + * + * @return the ring value + */ + public Integer ring() { + return this.ring; + } + + /** + * Set the ring number of HostPool. + * + * @param ring the ring value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withRing(Integer ring) { + this.ring = ring; + return this; + } + + /** + * Get is validation environment. + * + * @return the validationEnvironment value + */ + public Boolean validationEnvironment() { + return this.validationEnvironment; + } + + /** + * Set is validation environment. + * + * @param validationEnvironment the validationEnvironment value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withValidationEnvironment(Boolean validationEnvironment) { + this.validationEnvironment = validationEnvironment; + return this; + } + + /** + * Get the registration info of HostPool. + * + * @return the registrationInfo value + */ + public RegistrationInfo registrationInfo() { + return this.registrationInfo; + } + + /** + * Set the registration info of HostPool. + * + * @param registrationInfo the registrationInfo value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withRegistrationInfo(RegistrationInfo registrationInfo) { + this.registrationInfo = registrationInfo; + return this; + } + + /** + * Get vM template for sessionhosts configuration within hostpool. + * + * @return the vmTemplate value + */ + public String vmTemplate() { + return this.vmTemplate; + } + + /** + * Set vM template for sessionhosts configuration within hostpool. + * + * @param vmTemplate the vmTemplate value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withVmTemplate(String vmTemplate) { + this.vmTemplate = vmTemplate; + return this; + } + + /** + * Get list of applicationGroup links. + * + * @return the applicationGroupReferences value + */ + public List applicationGroupReferences() { + return this.applicationGroupReferences; + } + + /** + * Get path to keyvault containing ssoContext secret. + * + * @return the ssoContext value + */ + public String ssoContext() { + return this.ssoContext; + } + + /** + * Set path to keyvault containing ssoContext secret. + * + * @param ssoContext the ssoContext value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withSsoContext(String ssoContext) { + this.ssoContext = ssoContext; + return this; + } + + /** + * Get uRL to customer ADFS server for signing WVD SSO certificates. + * + * @return the ssoadfsAuthority value + */ + public String ssoadfsAuthority() { + return this.ssoadfsAuthority; + } + + /** + * Set uRL to customer ADFS server for signing WVD SSO certificates. + * + * @param ssoadfsAuthority the ssoadfsAuthority value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withSsoadfsAuthority(String ssoadfsAuthority) { + this.ssoadfsAuthority = ssoadfsAuthority; + return this; + } + + /** + * Get clientId for the registered Relying Party used to issue WVD SSO certificates. + * + * @return the ssoClientId value + */ + public String ssoClientId() { + return this.ssoClientId; + } + + /** + * Set clientId for the registered Relying Party used to issue WVD SSO certificates. + * + * @param ssoClientId the ssoClientId value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withSsoClientId(String ssoClientId) { + this.ssoClientId = ssoClientId; + return this; + } + + /** + * Get path to Azure KeyVault storing the secret used for communication to ADFS. + * + * @return the ssoClientSecretKeyVaultPath value + */ + public String ssoClientSecretKeyVaultPath() { + return this.ssoClientSecretKeyVaultPath; + } + + /** + * Set path to Azure KeyVault storing the secret used for communication to ADFS. + * + * @param ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath) { + this.ssoClientSecretKeyVaultPath = ssoClientSecretKeyVaultPath; + return this; + } + + /** + * Get the type of single sign on Secret Type. Possible values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault'. + * + * @return the ssoSecretType value + */ + public SSOSecretType ssoSecretType() { + return this.ssoSecretType; + } + + /** + * Set the type of single sign on Secret Type. Possible values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', 'CertificateInKeyVault'. + * + * @param ssoSecretType the ssoSecretType value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withSsoSecretType(SSOSecretType ssoSecretType) { + this.ssoSecretType = ssoSecretType; + return this; + } + + /** + * Get the type of preferred application group type, default to Desktop Application Group. Possible values include: 'None', 'Desktop', 'RailApplications'. + * + * @return the preferredAppGroupType value + */ + public PreferredAppGroupType preferredAppGroupType() { + return this.preferredAppGroupType; + } + + /** + * Set the type of preferred application group type, default to Desktop Application Group. Possible values include: 'None', 'Desktop', 'RailApplications'. + * + * @param preferredAppGroupType the preferredAppGroupType value to set + * @return the HostPoolInner object itself. + */ + public HostPoolInner withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType) { + this.preferredAppGroupType = preferredAppGroupType; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsImpl.java new file mode 100644 index 0000000000000..37a9fab06e862 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsImpl.java @@ -0,0 +1,138 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPools; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPool; +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; + +class HostPoolsImpl extends GroupableResourcesCoreImpl implements HostPools { + protected HostPoolsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().hostPools(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + HostPoolsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + HostPoolsInner 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) { + HostPoolsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + HostPoolsInner 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 HostPool call(HostPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + HostPoolsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + HostPoolsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public HostPool call(HostPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public HostPoolImpl define(String name) { + return wrapModel(name); + } + + @Override + protected HostPoolImpl wrapModel(HostPoolInner inner) { + return new HostPoolImpl(inner.name(), inner, manager()); + } + + @Override + protected HostPoolImpl wrapModel(String name) { + return new HostPoolImpl(name, new HostPoolInner(), this.manager()); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsInner.java new file mode 100644 index 0000000000000..4cebdb65da867 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/HostPoolsInner.java @@ -0,0 +1,1068 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.HostPoolPatch; +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 HostPools. + */ +public class HostPoolsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private HostPoolsService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of HostPoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HostPoolsInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(HostPoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HostPools to be + * used by Retrofit to perform actually REST calls. + */ + interface HostPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.HostPools getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @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.desktopvirtualization.v2020_10_19_preview.HostPools createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Query("api-version") String apiVersion, @Body HostPoolInner hostPool, @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.desktopvirtualization.v2020_10_19_preview.HostPools delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Query("api-version") String apiVersion, @Query("force") Boolean force, @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.desktopvirtualization.v2020_10_19_preview.HostPools update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Query("api-version") String apiVersion, @Body HostPoolPatch hostPool, @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.desktopvirtualization.v2020_10_19_preview.HostPools listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.desktopvirtualization.v2020_10_19_preview.HostPools list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools") + Observable> list(@Path("subscriptionId") String subscriptionId, @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.desktopvirtualization.v2020_10_19_preview.HostPools listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.desktopvirtualization.v2020_10_19_preview.HostPools listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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 HostPoolInner object if successful. + */ + public HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoolName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, hostPoolName).toBlocking().single().body(); + } + + /** + * Get a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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 getByResourceGroupAsync(String resourceGroupName, String hostPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, hostPoolName), serviceCallback); + } + + /** + * Get a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String hostPoolName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, hostPoolName).map(new Func1, HostPoolInner>() { + @Override + public HostPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String hostPoolName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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, hostPoolName, 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 update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @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 HostPoolInner object if successful. + */ + public HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolName, HostPoolInner hostPool) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, hostPoolName, hostPool).toBlocking().single().body(); + } + + /** + * Create or update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @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 hostPoolName, HostPoolInner hostPool, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, hostPoolName, hostPool), serviceCallback); + } + + /** + * Create or update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String hostPoolName, HostPoolInner hostPool) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, hostPoolName, hostPool).map(new Func1, HostPoolInner>() { + @Override + public HostPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String hostPoolName, HostPoolInner hostPool) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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 (hostPool == null) { + throw new IllegalArgumentException("Parameter hostPool is required and cannot be null."); + } + Validator.validate(hostPool); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), hostPool, 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); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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 + */ + public void delete(String resourceGroupName, String hostPoolName) { + deleteWithServiceResponseAsync(resourceGroupName, hostPoolName).toBlocking().single().body(); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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 deleteAsync(String resourceGroupName, String hostPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, hostPoolName), serviceCallback); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String hostPoolName) { + return deleteWithServiceResponseAsync(resourceGroupName, hostPoolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String hostPoolName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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 force = null; + return service.delete(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), force, 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); + } + } + }); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param force Force flag to delete sessionHost. + * @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 hostPoolName, Boolean force) { + deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, force).toBlocking().single().body(); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param force Force flag to delete sessionHost. + * @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 hostPoolName, Boolean force, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, force), serviceCallback); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param force Force flag to delete sessionHost. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String hostPoolName, Boolean force) { + return deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, force).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param force Force flag to delete sessionHost. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String hostPoolName, Boolean force) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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, hostPoolName, this.client.apiVersion(), force, 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); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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 HostPoolInner object if successful. + */ + public HostPoolInner update(String resourceGroupName, String hostPoolName) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName).toBlocking().single().body(); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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 updateAsync(String resourceGroupName, String hostPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, hostPoolName), serviceCallback); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable updateAsync(String resourceGroupName, String hostPoolName) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName).map(new Func1, HostPoolInner>() { + @Override + public HostPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String hostPoolName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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 HostPoolPatch hostPool = null; + return service.update(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), hostPool, 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); + } + } + }); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @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 HostPoolInner object if successful. + */ + public HostPoolInner update(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, hostPool).toBlocking().single().body(); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @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 hostPoolName, HostPoolPatch hostPool, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, hostPoolName, hostPool), serviceCallback); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable updateAsync(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, hostPool).map(new Func1, HostPoolInner>() { + @Override + public HostPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a host pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param hostPool Object containing HostPool definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HostPoolInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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(hostPool); + return service.update(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), hostPool, 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 hostPools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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<HostPoolInner> 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 hostPools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 hostPools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HostPoolInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List hostPools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HostPoolInner> 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 hostPools. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HostPoolInner> 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."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, 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); + } + + /** + * List hostPools in 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<HostPoolInner> 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 hostPools in 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 hostPools in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HostPoolInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List hostPools in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HostPoolInner> 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 hostPools in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HostPoolInner> 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."); + } + return service.list(this.client.subscriptionId(), 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 hostPools. + * + * @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<HostPoolInner> 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 hostPools. + * + * @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 hostPools. + * + * @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<HostPoolInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List hostPools. + * + * @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<HostPoolInner> 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 hostPools. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HostPoolInner> 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); + } + + /** + * List hostPools in 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<HostPoolInner> 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 hostPools in 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 hostPools in 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<HostPoolInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List hostPools in 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<HostPoolInner> 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 hostPools in 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<HostPoolInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/IdParsingUtils.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..9a178b0d1d7b4 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/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.desktopvirtualization.v2020_10_19_preview.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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageImpl.java new file mode 100644 index 0000000000000..34863a0d80432 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageImpl.java @@ -0,0 +1,257 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MSIXPackage; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MSIXPackagePatch; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageDependencies; +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageApplications; +import rx.functions.Func1; + +class MSIXPackageImpl extends CreatableUpdatableImpl implements MSIXPackage, MSIXPackage.Definition, MSIXPackage.Update { + private final DesktopVirtualizationManager manager; + private String resourceGroupName; + private String hostPoolName; + private String msixPackageFullName; + private MSIXPackagePatch updateParameter; + + MSIXPackageImpl(String name, DesktopVirtualizationManager manager) { + super(name, new MSIXPackageInner()); + this.manager = manager; + // Set resource name + this.msixPackageFullName = name; + // + this.updateParameter = new MSIXPackagePatch(); + } + + MSIXPackageImpl(MSIXPackageInner inner, DesktopVirtualizationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.msixPackageFullName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.hostPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "hostPools"); + this.msixPackageFullName = IdParsingUtils.getValueFromIdByName(inner.id(), "msixPackages"); + // + this.updateParameter = new MSIXPackagePatch(); + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + MSIXPackagesInner client = this.manager().inner().mSIXPackages(); + return client.createOrUpdateAsync(this.resourceGroupName, this.hostPoolName, this.msixPackageFullName, this.inner()) + .map(new Func1() { + @Override + public MSIXPackageInner call(MSIXPackageInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MSIXPackagesInner client = this.manager().inner().mSIXPackages(); + return client.updateAsync(this.resourceGroupName, this.hostPoolName, this.msixPackageFullName, this.updateParameter) + .map(new Func1() { + @Override + public MSIXPackageInner call(MSIXPackageInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MSIXPackagesInner client = this.manager().inner().mSIXPackages(); + return client.getAsync(this.resourceGroupName, this.hostPoolName, this.msixPackageFullName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new MSIXPackagePatch(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String imagePath() { + return this.inner().imagePath(); + } + + @Override + public boolean isActive() { + return this.inner().isActive(); + } + + @Override + public boolean isRegularRegistration() { + return this.inner().isRegularRegistration(); + } + + @Override + public DateTime lastUpdated() { + return this.inner().lastUpdated(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List packageApplications() { + return this.inner().packageApplications(); + } + + @Override + public List packageDependencies() { + return this.inner().packageDependencies(); + } + + @Override + public String packageFamilyName() { + return this.inner().packageFamilyName(); + } + + @Override + public String packageName() { + return this.inner().packageName(); + } + + @Override + public String packageRelativePath() { + return this.inner().packageRelativePath(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + + @Override + public MSIXPackageImpl withExistingHostPool(String resourceGroupName, String hostPoolName) { + this.resourceGroupName = resourceGroupName; + this.hostPoolName = hostPoolName; + return this; + } + + @Override + public MSIXPackageImpl withImagePath(String imagePath) { + this.inner().withImagePath(imagePath); + return this; + } + + @Override + public MSIXPackageImpl withIsActive(boolean isActive) { + this.inner().withIsActive(isActive); + return this; + } + + @Override + public MSIXPackageImpl withIsRegularRegistration(boolean isRegularRegistration) { + this.inner().withIsRegularRegistration(isRegularRegistration); + return this; + } + + @Override + public MSIXPackageImpl withLastUpdated(DateTime lastUpdated) { + this.inner().withLastUpdated(lastUpdated); + return this; + } + + @Override + public MSIXPackageImpl withPackageApplications(List packageApplications) { + this.inner().withPackageApplications(packageApplications); + return this; + } + + @Override + public MSIXPackageImpl withPackageDependencies(List packageDependencies) { + this.inner().withPackageDependencies(packageDependencies); + return this; + } + + @Override + public MSIXPackageImpl withPackageFamilyName(String packageFamilyName) { + this.inner().withPackageFamilyName(packageFamilyName); + return this; + } + + @Override + public MSIXPackageImpl withPackageName(String packageName) { + this.inner().withPackageName(packageName); + return this; + } + + @Override + public MSIXPackageImpl withPackageRelativePath(String packageRelativePath) { + this.inner().withPackageRelativePath(packageRelativePath); + return this; + } + + @Override + public MSIXPackageImpl withVersion(String version) { + this.inner().withVersion(version); + return this; + } + + @Override + public MSIXPackageImpl withIsActive(Boolean isActive) { + this.updateParameter.withIsActive(isActive); + return this; + } + + @Override + public MSIXPackageImpl withIsRegularRegistration(Boolean isRegularRegistration) { + this.updateParameter.withIsRegularRegistration(isRegularRegistration); + return this; + } + + @Override + public MSIXPackageImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.inner().withDisplayName(displayName); + } else { + this.updateParameter.withDisplayName(displayName); + } + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageInner.java new file mode 100644 index 0000000000000..a668d7ba41cf3 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackageInner.java @@ -0,0 +1,311 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageDependencies; +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixPackageApplications; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Schema for MSIX Package properties. + */ +@JsonFlatten +public class MSIXPackageInner extends ProxyResource { + /** + * VHD/CIM image path on Network Share. + */ + @JsonProperty(value = "properties.imagePath") + private String imagePath; + + /** + * Package Name from appxmanifest.xml. + */ + @JsonProperty(value = "properties.packageName") + private String packageName; + + /** + * Package Family Name from appxmanifest.xml. Contains Package Name and + * Publisher name. + */ + @JsonProperty(value = "properties.packageFamilyName") + private String packageFamilyName; + + /** + * User friendly Name to be displayed in the portal. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Relative Path to the package inside the image. + */ + @JsonProperty(value = "properties.packageRelativePath") + private String packageRelativePath; + + /** + * Specifies how to register Package in feed. + */ + @JsonProperty(value = "properties.isRegularRegistration") + private boolean isRegularRegistration; + + /** + * Make this version of the package the active one across the hostpool. + */ + @JsonProperty(value = "properties.isActive") + private boolean isActive; + + /** + * List of package dependencies. + */ + @JsonProperty(value = "properties.packageDependencies") + private List packageDependencies; + + /** + * Package Version found in the appxmanifest.xml. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Date Package was last updated, found in the appxmanifest.xml. + */ + @JsonProperty(value = "properties.lastUpdated") + private DateTime lastUpdated; + + /** + * List of package applications. + */ + @JsonProperty(value = "properties.packageApplications") + private List packageApplications; + + /** + * Get vHD/CIM image path on Network Share. + * + * @return the imagePath value + */ + public String imagePath() { + return this.imagePath; + } + + /** + * Set vHD/CIM image path on Network Share. + * + * @param imagePath the imagePath value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withImagePath(String imagePath) { + this.imagePath = imagePath; + return this; + } + + /** + * Get package Name from appxmanifest.xml. + * + * @return the packageName value + */ + public String packageName() { + return this.packageName; + } + + /** + * Set package Name from appxmanifest.xml. + * + * @param packageName the packageName value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withPackageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + * + * @return the packageFamilyName value + */ + public String packageFamilyName() { + return this.packageFamilyName; + } + + /** + * Set package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + * + * @param packageFamilyName the packageFamilyName value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withPackageFamilyName(String packageFamilyName) { + this.packageFamilyName = packageFamilyName; + return this; + } + + /** + * Get user friendly Name to be displayed in the portal. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set user friendly Name to be displayed in the portal. + * + * @param displayName the displayName value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get relative Path to the package inside the image. + * + * @return the packageRelativePath value + */ + public String packageRelativePath() { + return this.packageRelativePath; + } + + /** + * Set relative Path to the package inside the image. + * + * @param packageRelativePath the packageRelativePath value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withPackageRelativePath(String packageRelativePath) { + this.packageRelativePath = packageRelativePath; + return this; + } + + /** + * Get specifies how to register Package in feed. + * + * @return the isRegularRegistration value + */ + public boolean isRegularRegistration() { + return this.isRegularRegistration; + } + + /** + * Set specifies how to register Package in feed. + * + * @param isRegularRegistration the isRegularRegistration value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withIsRegularRegistration(boolean isRegularRegistration) { + this.isRegularRegistration = isRegularRegistration; + return this; + } + + /** + * Get make this version of the package the active one across the hostpool. + * + * @return the isActive value + */ + public boolean isActive() { + return this.isActive; + } + + /** + * Set make this version of the package the active one across the hostpool. + * + * @param isActive the isActive value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withIsActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get list of package dependencies. + * + * @return the packageDependencies value + */ + public List packageDependencies() { + return this.packageDependencies; + } + + /** + * Set list of package dependencies. + * + * @param packageDependencies the packageDependencies value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withPackageDependencies(List packageDependencies) { + this.packageDependencies = packageDependencies; + return this; + } + + /** + * Get package Version found in the appxmanifest.xml. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set package Version found in the appxmanifest.xml. + * + * @param version the version value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get date Package was last updated, found in the appxmanifest.xml. + * + * @return the lastUpdated value + */ + public DateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set date Package was last updated, found in the appxmanifest.xml. + * + * @param lastUpdated the lastUpdated value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withLastUpdated(DateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get list of package applications. + * + * @return the packageApplications value + */ + public List packageApplications() { + return this.packageApplications; + } + + /** + * Set list of package applications. + * + * @param packageApplications the packageApplications value to set + * @return the MSIXPackageInner object itself. + */ + public MSIXPackageInner withPackageApplications(List packageApplications) { + this.packageApplications = packageApplications; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesImpl.java new file mode 100644 index 0000000000000..20d3d22613c96 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesImpl.java @@ -0,0 +1,85 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MSIXPackages; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MSIXPackage; + +class MSIXPackagesImpl extends WrapperImpl implements MSIXPackages { + private final DesktopVirtualizationManager manager; + + MSIXPackagesImpl(DesktopVirtualizationManager manager) { + super(manager.inner().mSIXPackages()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public MSIXPackageImpl define(String name) { + return wrapModel(name); + } + + private MSIXPackageImpl wrapModel(MSIXPackageInner inner) { + return new MSIXPackageImpl(inner, manager()); + } + + private MSIXPackageImpl wrapModel(String name) { + return new MSIXPackageImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String hostPoolName) { + MSIXPackagesInner client = this.inner(); + return client.listAsync(resourceGroupName, hostPoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MSIXPackage call(MSIXPackageInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + MSIXPackagesInner client = this.inner(); + return client.getAsync(resourceGroupName, hostPoolName, msixPackageFullName) + .flatMap(new Func1>() { + @Override + public Observable call(MSIXPackageInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((MSIXPackage)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + MSIXPackagesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, hostPoolName, msixPackageFullName).toCompletable(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesInner.java new file mode 100644 index 0000000000000..2b82bdb2a1836 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MSIXPackagesInner.java @@ -0,0 +1,799 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.MSIXPackagePatch; +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 MSIXPackages. + */ +public class MSIXPackagesInner { + /** The Retrofit service to perform REST calls. */ + private MSIXPackagesService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of MSIXPackagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MSIXPackagesInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(MSIXPackagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MSIXPackages to be + * used by Retrofit to perform actually REST calls. + */ + interface MSIXPackagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MSIXPackages get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("msixPackageFullName") String msixPackageFullName, @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.desktopvirtualization.v2020_10_19_preview.MSIXPackages createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("msixPackageFullName") String msixPackageFullName, @Query("api-version") String apiVersion, @Body MSIXPackageInner msixPackage, @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.desktopvirtualization.v2020_10_19_preview.MSIXPackages delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("msixPackageFullName") String msixPackageFullName, @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.desktopvirtualization.v2020_10_19_preview.MSIXPackages update" }) + @PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("msixPackageFullName") String msixPackageFullName, @Query("api-version") String apiVersion, @Body MSIXPackagePatch msixPackage, @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.desktopvirtualization.v2020_10_19_preview.MSIXPackages list" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @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.desktopvirtualization.v2020_10_19_preview.MSIXPackages listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a msixpackage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @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 MSIXPackageInner object if successful. + */ + public MSIXPackageInner get(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return getWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName).toBlocking().single().body(); + } + + /** + * Get a msixpackage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @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 hostPoolName, String msixPackageFullName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName), serviceCallback); + } + + /** + * Get a msixpackage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable getAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return getWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName).map(new Func1, MSIXPackageInner>() { + @Override + public MSIXPackageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a msixpackage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (msixPackageFullName == null) { + throw new IllegalArgumentException("Parameter msixPackageFullName 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, hostPoolName, msixPackageFullName, 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 update a MSIX package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @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 MSIXPackageInner object if successful. + */ + public MSIXPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, String msixPackageFullName, MSIXPackageInner msixPackage) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage).toBlocking().single().body(); + } + + /** + * Create or update a MSIX package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @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 hostPoolName, String msixPackageFullName, MSIXPackageInner msixPackage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage), serviceCallback); + } + + /** + * Create or update a MSIX package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, MSIXPackageInner msixPackage) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage).map(new Func1, MSIXPackageInner>() { + @Override + public MSIXPackageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a MSIX package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, MSIXPackageInner msixPackage) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (msixPackageFullName == null) { + throw new IllegalArgumentException("Parameter msixPackageFullName 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 (msixPackage == null) { + throw new IllegalArgumentException("Parameter msixPackage is required and cannot be null."); + } + Validator.validate(msixPackage); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, this.client.apiVersion(), msixPackage, 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); + } + + /** + * Remove an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @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 hostPoolName, String msixPackageFullName) { + deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName).toBlocking().single().body(); + } + + /** + * Remove an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @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 hostPoolName, String msixPackageFullName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName), serviceCallback); + } + + /** + * Remove an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (msixPackageFullName == null) { + throw new IllegalArgumentException("Parameter msixPackageFullName 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, hostPoolName, msixPackageFullName, 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); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @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 MSIXPackageInner object if successful. + */ + public MSIXPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName).toBlocking().single().body(); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @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 hostPoolName, String msixPackageFullName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName), serviceCallback); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable updateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName).map(new Func1, MSIXPackageInner>() { + @Override + public MSIXPackageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (msixPackageFullName == null) { + throw new IllegalArgumentException("Parameter msixPackageFullName 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 MSIXPackagePatch msixPackage = null; + return service.update(this.client.subscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, this.client.apiVersion(), msixPackage, 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); + } + } + }); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @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 MSIXPackageInner object if successful. + */ + public MSIXPackageInner update(String resourceGroupName, String hostPoolName, String msixPackageFullName, MSIXPackagePatch msixPackage) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage).toBlocking().single().body(); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @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 hostPoolName, String msixPackageFullName, MSIXPackagePatch msixPackage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage), serviceCallback); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable updateAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, MSIXPackagePatch msixPackage) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage).map(new Func1, MSIXPackageInner>() { + @Override + public MSIXPackageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an MSIX Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool + * @param msixPackage Object containing MSIX Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MSIXPackageInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String msixPackageFullName, MSIXPackagePatch msixPackage) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (msixPackageFullName == null) { + throw new IllegalArgumentException("Parameter msixPackageFullName 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(msixPackage); + return service.update(this.client.subscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, this.client.apiVersion(), msixPackage, 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 MSIX packages in hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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<MSIXPackageInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String hostPoolName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, hostPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List MSIX packages in hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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> listAsync(final String resourceGroupName, final String hostPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, hostPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List MSIX packages in hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MSIXPackageInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String hostPoolName) { + return listWithServiceResponseAsync(resourceGroupName, hostPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List MSIX packages in hostpool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MSIXPackageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String hostPoolName) { + return listSinglePageAsync(resourceGroupName, hostPoolName) + .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 MSIX packages in hostpool. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MSIXPackageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String hostPoolName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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, hostPoolName, 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 MSIX packages in hostpool. + * + * @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<MSIXPackageInner> 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 MSIX packages in hostpool. + * + * @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 MSIX packages in hostpool. + * + * @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<MSIXPackageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List MSIX packages in hostpool. + * + * @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<MSIXPackageInner> 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 MSIX packages in hostpool. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MSIXPackageInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesImpl.java new file mode 100644 index 0000000000000..2cf6f18c82933 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesImpl.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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixImages; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ExpandMsixImage; + +class MsixImagesImpl extends WrapperImpl implements MsixImages { + private final DesktopVirtualizationManager manager; + + MsixImagesImpl(DesktopVirtualizationManager manager) { + super(manager.inner().msixImages()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public Observable expandAsync(final String resourceGroupName, final String hostPoolName) { + MsixImagesInner client = this.inner(); + return client.expandAsync(resourceGroupName, hostPoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpandMsixImage call(ExpandMsixImageInner inner) { + return new ExpandMsixImageImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesInner.java new file mode 100644 index 0000000000000..a1f8ffed9b228 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/MsixImagesInner.java @@ -0,0 +1,432 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.MSIXImageURI; +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.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 MsixImages. + */ +public class MsixImagesInner { + /** The Retrofit service to perform REST calls. */ + private MsixImagesService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of MsixImagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MsixImagesInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(MsixImagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MsixImages to be + * used by Retrofit to perform actually REST calls. + */ + interface MsixImagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixImages expand" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage") + Observable> expand(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MSIXImageURI msixImageURI, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.MsixImages expandNext" }) + @GET + Observable> expandNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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<ExpandMsixImageInner> object if successful. + */ + public PagedList expand(final String resourceGroupName, final String hostPoolName) { + ServiceResponse> response = expandSinglePageAsync(resourceGroupName, hostPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return expandNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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> expandAsync(final String resourceGroupName, final String hostPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + expandSinglePageAsync(resourceGroupName, hostPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return expandNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpandMsixImageInner> object + */ + public Observable> expandAsync(final String resourceGroupName, final String hostPoolName) { + return expandWithServiceResponseAsync(resourceGroupName, hostPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpandMsixImageInner> object + */ + public Observable>> expandWithServiceResponseAsync(final String resourceGroupName, final String hostPoolName) { + return expandSinglePageAsync(resourceGroupName, hostPoolName) + .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(expandNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpandMsixImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> expandSinglePageAsync(final String resourceGroupName, final String hostPoolName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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 uri = null; + MSIXImageURI msixImageURI = new MSIXImageURI(); + msixImageURI.withUri(null); + return service.expand(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), this.client.acceptLanguage(), msixImageURI, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = expandDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param uri URI to 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 PagedList<ExpandMsixImageInner> object if successful. + */ + public PagedList expand(final String resourceGroupName, final String hostPoolName, final String uri) { + ServiceResponse> response = expandSinglePageAsync(resourceGroupName, hostPoolName, uri).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return expandNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param uri URI to 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> expandAsync(final String resourceGroupName, final String hostPoolName, final String uri, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + expandSinglePageAsync(resourceGroupName, hostPoolName, uri), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return expandNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param uri URI to Image + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpandMsixImageInner> object + */ + public Observable> expandAsync(final String resourceGroupName, final String hostPoolName, final String uri) { + return expandWithServiceResponseAsync(resourceGroupName, hostPoolName, uri) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param uri URI to Image + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpandMsixImageInner> object + */ + public Observable>> expandWithServiceResponseAsync(final String resourceGroupName, final String hostPoolName, final String uri) { + return expandSinglePageAsync(resourceGroupName, hostPoolName, uri) + .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(expandNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param hostPoolName The name of the host pool within the specified resource group + ServiceResponse> * @param uri URI to Image + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpandMsixImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> expandSinglePageAsync(final String resourceGroupName, final String hostPoolName, final String uri) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + MSIXImageURI msixImageURI = new MSIXImageURI(); + msixImageURI.withUri(uri); + return service.expand(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), this.client.acceptLanguage(), msixImageURI, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = expandDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> expandDelegate(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); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @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<ExpandMsixImageInner> object if successful. + */ + public PagedList expandNext(final String nextPageLink) { + ServiceResponse> response = expandNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return expandNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @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> expandNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + expandNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return expandNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @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<ExpandMsixImageInner> object + */ + public Observable> expandNextAsync(final String nextPageLink) { + return expandNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + * @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<ExpandMsixImageInner> object + */ + public Observable>> expandNextWithServiceResponseAsync(final String nextPageLink) { + return expandNextSinglePageAsync(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(expandNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Expands and Lists MSIX packages in an Image, given the Image Path. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpandMsixImageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> expandNextSinglePageAsync(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.expandNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = expandNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> expandNextDelegate(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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..306dfa7e1c6b5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsImpl.java @@ -0,0 +1,42 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ResourceProviderOperationList; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DesktopVirtualizationManager manager; + + OperationsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public ResourceProviderOperationList call(ResourceProviderOperationListInner inner) { + return new ResourceProviderOperationListImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..888e10c40fd25 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/OperationsInner.java @@ -0,0 +1,128 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.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 DesktopVirtualizationAPIClientImpl 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, DesktopVirtualizationAPIClientImpl 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.desktopvirtualization.v2020_10_19_preview.Operations list" }) + @GET("providers/Microsoft.DesktopVirtualization/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all of the available operations the Desktop Virtualization resource provider supports. + * + * @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 ResourceProviderOperationListInner object if successful. + */ + public ResourceProviderOperationListInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List all of the available operations the Desktop Virtualization resource provider supports. + * + * @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 ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * List all of the available operations the Desktop Virtualization resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceProviderOperationListInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, ResourceProviderOperationListInner>() { + @Override + public ResourceProviderOperationListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all of the available operations the Desktop Virtualization resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceProviderOperationListInner object + */ + public Observable> listWithServiceResponseAsync() { + 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 clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/PageImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..5a6ec8a43e3a9 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/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.desktopvirtualization.v2020_10_19_preview.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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListImpl.java new file mode 100644 index 0000000000000..8200bd2e3eee0 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListImpl.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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ResourceProviderOperationList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ResourceProviderOperation; + +class ResourceProviderOperationListImpl extends WrapperImpl implements ResourceProviderOperationList { + private final DesktopVirtualizationManager manager; + ResourceProviderOperationListImpl(ResourceProviderOperationListInner inner, DesktopVirtualizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListInner.java new file mode 100644 index 0000000000000..651be0d203300 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/ResourceProviderOperationListInner.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.desktopvirtualization.v2020_10_19_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ResourceProviderOperation; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Result of the request to list operations. + */ +public class ResourceProviderOperationListInner { + /** + * List of operations supported by this resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get list of operations supported by this resource provider. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of operations supported by this resource provider. + * + * @param value the value value to set + * @return the ResourceProviderOperationListInner object itself. + */ + public ResourceProviderOperationListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostImpl.java new file mode 100644 index 0000000000000..e682cb7f3dc4d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostImpl.java @@ -0,0 +1,186 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionHost; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionHostPatch; +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Status; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.UpdateState; +import rx.functions.Func1; + +class SessionHostImpl extends CreatableUpdatableImpl implements SessionHost, SessionHost.Update { + private final DesktopVirtualizationManager manager; + private String resourceGroupName; + private String hostPoolName; + private String sessionHostName; + private SessionHostPatch updateParameter; + + SessionHostImpl(String name, DesktopVirtualizationManager manager) { + super(name, new SessionHostInner()); + this.manager = manager; + // Set resource name + this.sessionHostName = name; + // + this.updateParameter = new SessionHostPatch(); + } + + SessionHostImpl(SessionHostInner inner, DesktopVirtualizationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.sessionHostName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.hostPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "hostPools"); + this.sessionHostName = IdParsingUtils.getValueFromIdByName(inner.id(), "sessionHosts"); + // + this.updateParameter = new SessionHostPatch(); + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SessionHostsInner client = this.manager().inner().sessionHosts(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + SessionHostsInner client = this.manager().inner().sessionHosts(); + return client.updateAsync(this.resourceGroupName, this.hostPoolName, this.sessionHostName, this.updateParameter) + .map(new Func1() { + @Override + public SessionHostInner call(SessionHostInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SessionHostsInner client = this.manager().inner().sessionHosts(); + return client.getAsync(this.resourceGroupName, this.hostPoolName, this.sessionHostName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new SessionHostPatch(); + } + + @Override + public String agentVersion() { + return this.inner().agentVersion(); + } + + @Override + public Boolean allowNewSession() { + return this.inner().allowNewSession(); + } + + @Override + public String assignedUser() { + return this.inner().assignedUser(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastHeartBeat() { + return this.inner().lastHeartBeat(); + } + + @Override + public DateTime lastUpdateTime() { + return this.inner().lastUpdateTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String osVersion() { + return this.inner().osVersion(); + } + + @Override + public String resourceId() { + return this.inner().resourceId(); + } + + @Override + public Integer sessions() { + return this.inner().sessions(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public DateTime statusTimestamp() { + return this.inner().statusTimestamp(); + } + + @Override + public String sxSStackVersion() { + return this.inner().sxSStackVersion(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String updateErrorMessage() { + return this.inner().updateErrorMessage(); + } + + @Override + public UpdateState updateState() { + return this.inner().updateState(); + } + + @Override + public String virtualMachineId() { + return this.inner().virtualMachineId(); + } + + @Override + public SessionHostImpl withAllowNewSession(Boolean allowNewSession) { + this.updateParameter.withAllowNewSession(allowNewSession); + return this; + } + + @Override + public SessionHostImpl withAssignedUser(String assignedUser) { + this.updateParameter.withAssignedUser(assignedUser); + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostInner.java new file mode 100644 index 0000000000000..3d4178fbab4b5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostInner.java @@ -0,0 +1,345 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Status; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.UpdateState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a SessionHost definition. + */ +@JsonFlatten +public class SessionHostInner extends ProxyResource { + /** + * Last heart beat from SessionHost. + */ + @JsonProperty(value = "properties.lastHeartBeat") + private DateTime lastHeartBeat; + + /** + * Number of sessions on SessionHost. + */ + @JsonProperty(value = "properties.sessions") + private Integer sessions; + + /** + * Version of agent on SessionHost. + */ + @JsonProperty(value = "properties.agentVersion") + private String agentVersion; + + /** + * Allow a new session. + */ + @JsonProperty(value = "properties.allowNewSession") + private Boolean allowNewSession; + + /** + * Virtual Machine Id of SessionHost's underlying virtual machine. + */ + @JsonProperty(value = "properties.virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String virtualMachineId; + + /** + * Resource Id of SessionHost's underlying virtual machine. + */ + @JsonProperty(value = "properties.resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * User assigned to SessionHost. + */ + @JsonProperty(value = "properties.assignedUser") + private String assignedUser; + + /** + * Status for a SessionHost. Possible values include: 'Available', + * 'Unavailable', 'Shutdown', 'Disconnected', 'Upgrading', 'UpgradeFailed'. + */ + @JsonProperty(value = "properties.status") + private Status status; + + /** + * The timestamp of the status. + */ + @JsonProperty(value = "properties.statusTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime statusTimestamp; + + /** + * The version of the OS on the session host. + */ + @JsonProperty(value = "properties.osVersion") + private String osVersion; + + /** + * The version of the side by side stack on the session host. + */ + @JsonProperty(value = "properties.sxSStackVersion") + private String sxSStackVersion; + + /** + * Update state of a SessionHost. Possible values include: 'Initial', + * 'Pending', 'Started', 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "properties.updateState") + private UpdateState updateState; + + /** + * The timestamp of the last update. + */ + @JsonProperty(value = "properties.lastUpdateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastUpdateTime; + + /** + * The error message. + */ + @JsonProperty(value = "properties.updateErrorMessage") + private String updateErrorMessage; + + /** + * Get last heart beat from SessionHost. + * + * @return the lastHeartBeat value + */ + public DateTime lastHeartBeat() { + return this.lastHeartBeat; + } + + /** + * Set last heart beat from SessionHost. + * + * @param lastHeartBeat the lastHeartBeat value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withLastHeartBeat(DateTime lastHeartBeat) { + this.lastHeartBeat = lastHeartBeat; + return this; + } + + /** + * Get number of sessions on SessionHost. + * + * @return the sessions value + */ + public Integer sessions() { + return this.sessions; + } + + /** + * Set number of sessions on SessionHost. + * + * @param sessions the sessions value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withSessions(Integer sessions) { + this.sessions = sessions; + return this; + } + + /** + * Get version of agent on SessionHost. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set version of agent on SessionHost. + * + * @param agentVersion the agentVersion value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get allow a new session. + * + * @return the allowNewSession value + */ + public Boolean allowNewSession() { + return this.allowNewSession; + } + + /** + * Set allow a new session. + * + * @param allowNewSession the allowNewSession value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withAllowNewSession(Boolean allowNewSession) { + this.allowNewSession = allowNewSession; + return this; + } + + /** + * Get virtual Machine Id of SessionHost's underlying virtual machine. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Get resource Id of SessionHost's underlying virtual machine. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get user assigned to SessionHost. + * + * @return the assignedUser value + */ + public String assignedUser() { + return this.assignedUser; + } + + /** + * Set user assigned to SessionHost. + * + * @param assignedUser the assignedUser value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withAssignedUser(String assignedUser) { + this.assignedUser = assignedUser; + return this; + } + + /** + * Get status for a SessionHost. Possible values include: 'Available', 'Unavailable', 'Shutdown', 'Disconnected', 'Upgrading', 'UpgradeFailed'. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Set status for a SessionHost. Possible values include: 'Available', 'Unavailable', 'Shutdown', 'Disconnected', 'Upgrading', 'UpgradeFailed'. + * + * @param status the status value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the timestamp of the status. + * + * @return the statusTimestamp value + */ + public DateTime statusTimestamp() { + return this.statusTimestamp; + } + + /** + * Get the version of the OS on the session host. + * + * @return the osVersion value + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the version of the OS on the session host. + * + * @param osVersion the osVersion value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the version of the side by side stack on the session host. + * + * @return the sxSStackVersion value + */ + public String sxSStackVersion() { + return this.sxSStackVersion; + } + + /** + * Set the version of the side by side stack on the session host. + * + * @param sxSStackVersion the sxSStackVersion value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withSxSStackVersion(String sxSStackVersion) { + this.sxSStackVersion = sxSStackVersion; + return this; + } + + /** + * Get update state of a SessionHost. Possible values include: 'Initial', 'Pending', 'Started', 'Succeeded', 'Failed'. + * + * @return the updateState value + */ + public UpdateState updateState() { + return this.updateState; + } + + /** + * Set update state of a SessionHost. Possible values include: 'Initial', 'Pending', 'Started', 'Succeeded', 'Failed'. + * + * @param updateState the updateState value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withUpdateState(UpdateState updateState) { + this.updateState = updateState; + return this; + } + + /** + * Get the timestamp of the last update. + * + * @return the lastUpdateTime value + */ + public DateTime lastUpdateTime() { + return this.lastUpdateTime; + } + + /** + * Get the error message. + * + * @return the updateErrorMessage value + */ + public String updateErrorMessage() { + return this.updateErrorMessage; + } + + /** + * Set the error message. + * + * @param updateErrorMessage the updateErrorMessage value to set + * @return the SessionHostInner object itself. + */ + public SessionHostInner withUpdateErrorMessage(String updateErrorMessage) { + this.updateErrorMessage = updateErrorMessage; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsImpl.java new file mode 100644 index 0000000000000..e4332e0b6e20d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsImpl.java @@ -0,0 +1,76 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionHosts; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionHost; + +class SessionHostsImpl extends WrapperImpl implements SessionHosts { + private final DesktopVirtualizationManager manager; + + SessionHostsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().sessionHosts()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + private SessionHostImpl wrapModel(SessionHostInner inner) { + return new SessionHostImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String hostPoolName) { + SessionHostsInner client = this.inner(); + return client.listAsync(resourceGroupName, hostPoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SessionHost call(SessionHostInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + SessionHostsInner client = this.inner(); + return client.getAsync(resourceGroupName, hostPoolName, sessionHostName) + .flatMap(new Func1>() { + @Override + public Observable call(SessionHostInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SessionHost)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + SessionHostsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, hostPoolName, sessionHostName).toCompletable(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsInner.java new file mode 100644 index 0000000000000..94c5bcc6c1ef5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/SessionHostsInner.java @@ -0,0 +1,782 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.SessionHostPatch; +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.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 SessionHosts. + */ +public class SessionHostsInner { + /** The Retrofit service to perform REST calls. */ + private SessionHostsService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of SessionHostsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SessionHostsInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(SessionHostsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SessionHosts to be + * used by Retrofit to perform actually REST calls. + */ + interface SessionHostsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionHosts get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @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.desktopvirtualization.v2020_10_19_preview.SessionHosts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @Query("api-version") String apiVersion, @Query("force") Boolean force, @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.desktopvirtualization.v2020_10_19_preview.SessionHosts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @Query("api-version") String apiVersion, @Body SessionHostPatch sessionHost, @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.desktopvirtualization.v2020_10_19_preview.SessionHosts list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @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.desktopvirtualization.v2020_10_19_preview.SessionHosts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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 SessionHostInner object if successful. + */ + public SessionHostInner get(String resourceGroupName, String hostPoolName, String sessionHostName) { + return getWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName).toBlocking().single().body(); + } + + /** + * Get a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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 hostPoolName, String sessionHostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName), serviceCallback); + } + + /** + * Get a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SessionHostInner object + */ + public Observable getAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + return getWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName).map(new Func1, SessionHostInner>() { + @Override + public SessionHostInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SessionHostInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName 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, hostPoolName, sessionHostName, 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); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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 hostPoolName, String sessionHostName) { + deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName).toBlocking().single().body(); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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 hostPoolName, String sessionHostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName), serviceCallback); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + return deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName 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 force = null; + return service.delete(this.client.subscriptionId(), resourceGroupName, hostPoolName, sessionHostName, this.client.apiVersion(), force, 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); + } + } + }); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param force Force flag to force sessionHost deletion even when userSession exists. + * @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 hostPoolName, String sessionHostName, Boolean force) { + deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, force).toBlocking().single().body(); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param force Force flag to force sessionHost deletion even when userSession exists. + * @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 hostPoolName, String sessionHostName, Boolean force, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, force), serviceCallback); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param force Force flag to force sessionHost deletion even when userSession exists. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName, Boolean force) { + return deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, force).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a SessionHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param force Force flag to force sessionHost deletion even when userSession exists. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, Boolean force) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName 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, hostPoolName, sessionHostName, this.client.apiVersion(), force, 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); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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 SessionHostInner object if successful. + */ + public SessionHostInner update(String resourceGroupName, String hostPoolName, String sessionHostName) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName).toBlocking().single().body(); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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 hostPoolName, String sessionHostName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName), serviceCallback); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SessionHostInner object + */ + public Observable updateAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName).map(new Func1, SessionHostInner>() { + @Override + public SessionHostInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SessionHostInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName 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 SessionHostPatch sessionHost = null; + return service.update(this.client.subscriptionId(), resourceGroupName, hostPoolName, sessionHostName, this.client.apiVersion(), sessionHost, 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); + } + } + }); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param sessionHost Object containing SessionHost definitions. + * @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 SessionHostInner object if successful. + */ + public SessionHostInner update(String resourceGroupName, String hostPoolName, String sessionHostName, SessionHostPatch sessionHost) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, sessionHost).toBlocking().single().body(); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param sessionHost Object containing SessionHost definitions. + * @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 hostPoolName, String sessionHostName, SessionHostPatch sessionHost, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, sessionHost), serviceCallback); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param sessionHost Object containing SessionHost definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SessionHostInner object + */ + public Observable updateAsync(String resourceGroupName, String hostPoolName, String sessionHostName, SessionHostPatch sessionHost) { + return updateWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, sessionHost).map(new Func1, SessionHostInner>() { + @Override + public SessionHostInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a session host. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param sessionHost Object containing SessionHost definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SessionHostInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, SessionHostPatch sessionHost) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName 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(sessionHost); + return service.update(this.client.subscriptionId(), resourceGroupName, hostPoolName, sessionHostName, this.client.apiVersion(), sessionHost, 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 sessionHosts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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<SessionHostInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String hostPoolName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, hostPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List sessionHosts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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> listAsync(final String resourceGroupName, final String hostPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, hostPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List sessionHosts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SessionHostInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String hostPoolName) { + return listWithServiceResponseAsync(resourceGroupName, hostPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List sessionHosts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SessionHostInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String hostPoolName) { + return listSinglePageAsync(resourceGroupName, hostPoolName) + .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 sessionHosts. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SessionHostInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String hostPoolName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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, hostPoolName, 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 sessionHosts. + * + * @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<SessionHostInner> 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 sessionHosts. + * + * @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 sessionHosts. + * + * @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<SessionHostInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List sessionHosts. + * + * @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<SessionHostInner> 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 sessionHosts. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SessionHostInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemImpl.java new file mode 100644 index 0000000000000..fca649324aa7b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemImpl.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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.StartMenuItem; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class StartMenuItemImpl extends WrapperImpl implements StartMenuItem { + private final DesktopVirtualizationManager manager; + + StartMenuItemImpl(StartMenuItemInner inner, DesktopVirtualizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + + + @Override + public String appAlias() { + return this.inner().appAlias(); + } + + @Override + public String commandLineArguments() { + return this.inner().commandLineArguments(); + } + + @Override + public String filePath() { + return this.inner().filePath(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public Integer iconIndex() { + return this.inner().iconIndex(); + } + + @Override + public String iconPath() { + return this.inner().iconPath(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemInner.java new file mode 100644 index 0000000000000..4bdbb5dba2f6d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemInner.java @@ -0,0 +1,176 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a StartMenuItem definition. + */ +@JsonFlatten +public class StartMenuItemInner extends ProxyResource { + /** + * Alias of StartMenuItem. + */ + @JsonProperty(value = "properties.appAlias") + private String appAlias; + + /** + * Friendly name of StartMenuItem. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Path to the file of StartMenuItem. + */ + @JsonProperty(value = "properties.filePath") + private String filePath; + + /** + * Command line arguments for StartMenuItem. + */ + @JsonProperty(value = "properties.commandLineArguments") + private String commandLineArguments; + + /** + * Path to the icon. + */ + @JsonProperty(value = "properties.iconPath") + private String iconPath; + + /** + * Index of the icon. + */ + @JsonProperty(value = "properties.iconIndex") + private Integer iconIndex; + + /** + * Get alias of StartMenuItem. + * + * @return the appAlias value + */ + public String appAlias() { + return this.appAlias; + } + + /** + * Set alias of StartMenuItem. + * + * @param appAlias the appAlias value to set + * @return the StartMenuItemInner object itself. + */ + public StartMenuItemInner withAppAlias(String appAlias) { + this.appAlias = appAlias; + return this; + } + + /** + * Get friendly name of StartMenuItem. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of StartMenuItem. + * + * @param friendlyName the friendlyName value to set + * @return the StartMenuItemInner object itself. + */ + public StartMenuItemInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get path to the file of StartMenuItem. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set path to the file of StartMenuItem. + * + * @param filePath the filePath value to set + * @return the StartMenuItemInner object itself. + */ + public StartMenuItemInner withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get command line arguments for StartMenuItem. + * + * @return the commandLineArguments value + */ + public String commandLineArguments() { + return this.commandLineArguments; + } + + /** + * Set command line arguments for StartMenuItem. + * + * @param commandLineArguments the commandLineArguments value to set + * @return the StartMenuItemInner object itself. + */ + public StartMenuItemInner withCommandLineArguments(String commandLineArguments) { + this.commandLineArguments = commandLineArguments; + return this; + } + + /** + * Get path to the icon. + * + * @return the iconPath value + */ + public String iconPath() { + return this.iconPath; + } + + /** + * Set path to the icon. + * + * @param iconPath the iconPath value to set + * @return the StartMenuItemInner object itself. + */ + public StartMenuItemInner withIconPath(String iconPath) { + this.iconPath = iconPath; + return this; + } + + /** + * Get index of the icon. + * + * @return the iconIndex value + */ + public Integer iconIndex() { + return this.iconIndex; + } + + /** + * Set index of the icon. + * + * @param iconIndex the iconIndex value to set + * @return the StartMenuItemInner object itself. + */ + public StartMenuItemInner withIconIndex(Integer iconIndex) { + this.iconIndex = iconIndex; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsImpl.java new file mode 100644 index 0000000000000..8b7319c1d1e22 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsImpl.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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.StartMenuItems; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.StartMenuItem; + +class StartMenuItemsImpl extends WrapperImpl implements StartMenuItems { + private final DesktopVirtualizationManager manager; + + StartMenuItemsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().startMenuItems()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + private StartMenuItemImpl wrapModel(StartMenuItemInner inner) { + return new StartMenuItemImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String applicationGroupName) { + StartMenuItemsInner client = this.inner(); + return client.listAsync(resourceGroupName, applicationGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StartMenuItem call(StartMenuItemInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsInner.java new file mode 100644 index 0000000000000..940f2be6f1245 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/StartMenuItemsInner.java @@ -0,0 +1,303 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.Path; +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 StartMenuItems. + */ +public class StartMenuItemsInner { + /** The Retrofit service to perform REST calls. */ + private StartMenuItemsService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of StartMenuItemsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StartMenuItemsInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(StartMenuItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StartMenuItems to be + * used by Retrofit to perform actually REST calls. + */ + interface StartMenuItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.StartMenuItems list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("applicationGroupName") String applicationGroupName, @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.desktopvirtualization.v2020_10_19_preview.StartMenuItems listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List start menu items in the given application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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<StartMenuItemInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String applicationGroupName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, applicationGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List start menu items in the given application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application 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> listAsync(final String resourceGroupName, final String applicationGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, applicationGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List start menu items in the given application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StartMenuItemInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String applicationGroupName) { + return listWithServiceResponseAsync(resourceGroupName, applicationGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List start menu items in the given application group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StartMenuItemInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String applicationGroupName) { + return listSinglePageAsync(resourceGroupName, applicationGroupName) + .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 start menu items in the given application group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param applicationGroupName The name of the application group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StartMenuItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String applicationGroupName) { + 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 (applicationGroupName == null) { + throw new IllegalArgumentException("Parameter applicationGroupName 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, applicationGroupName, 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 start menu items in the given application 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<StartMenuItemInner> 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 start menu items in the given application 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> 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 start menu items in the given application 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<StartMenuItemInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List start menu items in the given application 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<StartMenuItemInner> 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 start menu items in the given application 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<StartMenuItemInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionImpl.java new file mode 100644 index 0000000000000..df17faf33b270 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionImpl.java @@ -0,0 +1,73 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.UserSession; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationType; +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionState; + +class UserSessionImpl extends WrapperImpl implements UserSession { + private final DesktopVirtualizationManager manager; + + UserSessionImpl(UserSessionInner inner, DesktopVirtualizationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DesktopVirtualizationManager manager() { + return this.manager; + } + + + + @Override + public String activeDirectoryUserName() { + return this.inner().activeDirectoryUserName(); + } + + @Override + public ApplicationType applicationType() { + return this.inner().applicationType(); + } + + @Override + public DateTime createTime() { + return this.inner().createTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SessionState sessionState() { + return this.inner().sessionState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String userPrincipalName() { + return this.inner().userPrincipalName(); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionInner.java new file mode 100644 index 0000000000000..80f48b7327108 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionInner.java @@ -0,0 +1,155 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.ApplicationType; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.SessionState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a UserSession definition. + */ +@JsonFlatten +public class UserSessionInner extends ProxyResource { + /** + * The user principal name. + */ + @JsonProperty(value = "properties.userPrincipalName") + private String userPrincipalName; + + /** + * Application type of application. Possible values include: 'RemoteApp', + * 'Desktop'. + */ + @JsonProperty(value = "properties.applicationType") + private ApplicationType applicationType; + + /** + * State of user session. Possible values include: 'Unknown', 'Active', + * 'Disconnected', 'Pending', 'LogOff', 'UserProfileDiskMounted'. + */ + @JsonProperty(value = "properties.sessionState") + private SessionState sessionState; + + /** + * The active directory user name. + */ + @JsonProperty(value = "properties.activeDirectoryUserName") + private String activeDirectoryUserName; + + /** + * The timestamp of the user session create. + */ + @JsonProperty(value = "properties.createTime") + private DateTime createTime; + + /** + * Get the user principal name. + * + * @return the userPrincipalName value + */ + public String userPrincipalName() { + return this.userPrincipalName; + } + + /** + * Set the user principal name. + * + * @param userPrincipalName the userPrincipalName value to set + * @return the UserSessionInner object itself. + */ + public UserSessionInner withUserPrincipalName(String userPrincipalName) { + this.userPrincipalName = userPrincipalName; + return this; + } + + /** + * Get application type of application. Possible values include: 'RemoteApp', 'Desktop'. + * + * @return the applicationType value + */ + public ApplicationType applicationType() { + return this.applicationType; + } + + /** + * Set application type of application. Possible values include: 'RemoteApp', 'Desktop'. + * + * @param applicationType the applicationType value to set + * @return the UserSessionInner object itself. + */ + public UserSessionInner withApplicationType(ApplicationType applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get state of user session. Possible values include: 'Unknown', 'Active', 'Disconnected', 'Pending', 'LogOff', 'UserProfileDiskMounted'. + * + * @return the sessionState value + */ + public SessionState sessionState() { + return this.sessionState; + } + + /** + * Set state of user session. Possible values include: 'Unknown', 'Active', 'Disconnected', 'Pending', 'LogOff', 'UserProfileDiskMounted'. + * + * @param sessionState the sessionState value to set + * @return the UserSessionInner object itself. + */ + public UserSessionInner withSessionState(SessionState sessionState) { + this.sessionState = sessionState; + return this; + } + + /** + * Get the active directory user name. + * + * @return the activeDirectoryUserName value + */ + public String activeDirectoryUserName() { + return this.activeDirectoryUserName; + } + + /** + * Set the active directory user name. + * + * @param activeDirectoryUserName the activeDirectoryUserName value to set + * @return the UserSessionInner object itself. + */ + public UserSessionInner withActiveDirectoryUserName(String activeDirectoryUserName) { + this.activeDirectoryUserName = activeDirectoryUserName; + return this; + } + + /** + * Get the timestamp of the user session create. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the timestamp of the user session create. + * + * @param createTime the createTime value to set + * @return the UserSessionInner object itself. + */ + public UserSessionInner withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsImpl.java new file mode 100644 index 0000000000000..23c6bebc6ea13 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsImpl.java @@ -0,0 +1,102 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.UserSessions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.UserSession; + +class UserSessionsImpl extends WrapperImpl implements UserSessions { + private final DesktopVirtualizationManager manager; + + UserSessionsImpl(DesktopVirtualizationManager manager) { + super(manager.inner().userSessions()); + this.manager = manager; + } + + public DesktopVirtualizationManager manager() { + return this.manager; + } + + private UserSessionImpl wrapModel(UserSessionInner inner) { + return new UserSessionImpl(inner, manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + UserSessionsInner client = this.inner(); + return client.getAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId) + .map(new Func1() { + @Override + public UserSession call(UserSessionInner inner) { + return new UserSessionImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + UserSessionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String hostPoolName, final String sessionHostName) { + UserSessionsInner client = this.inner(); + return client.listAsync(resourceGroupName, hostPoolName, sessionHostName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public UserSession call(UserSessionInner inner) { + return new UserSessionImpl(inner, manager()); + } + }); + } + + @Override + public Completable disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + UserSessionsInner client = this.inner(); + return client.disconnectAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).toCompletable(); + } + + @Override + public Completable sendMessageMethodAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + UserSessionsInner client = this.inner(); + return client.sendMessageMethodAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).toCompletable(); + } + + @Override + public Observable listByHostPoolAsync(final String resourceGroupName, final String hostPoolName) { + UserSessionsInner client = this.inner(); + return client.listByHostPoolAsync(resourceGroupName, hostPoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public UserSession call(UserSessionInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsInner.java new file mode 100644 index 0000000000000..fbd4d793521c5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/UserSessionsInner.java @@ -0,0 +1,1290 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.SendMessage; +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.Path; +import retrofit2.http.POST; +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 UserSessions. + */ +public class UserSessionsInner { + /** The Retrofit service to perform REST calls. */ + private UserSessionsService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of UserSessionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UserSessionsInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(UserSessionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for UserSessions to be + * used by Retrofit to perform actually REST calls. + */ + interface UserSessionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.UserSessions listByHostPool" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions") + Observable> listByHostPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.desktopvirtualization.v2020_10_19_preview.UserSessions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @Path("userSessionId") String userSessionId, @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.desktopvirtualization.v2020_10_19_preview.UserSessions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @Path("userSessionId") String userSessionId, @Query("api-version") String apiVersion, @Query("force") Boolean force, @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.desktopvirtualization.v2020_10_19_preview.UserSessions list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @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.desktopvirtualization.v2020_10_19_preview.UserSessions disconnect" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect") + Observable> disconnect(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @Path("userSessionId") String userSessionId, @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.desktopvirtualization.v2020_10_19_preview.UserSessions sendMessageMethod" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage") + Observable> sendMessageMethod(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hostPoolName") String hostPoolName, @Path("sessionHostName") String sessionHostName, @Path("userSessionId") String userSessionId, @Query("api-version") String apiVersion, @Body SendMessage sendMessage, @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.desktopvirtualization.v2020_10_19_preview.UserSessions listByHostPoolNext" }) + @GET + Observable> listByHostPoolNext(@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.desktopvirtualization.v2020_10_19_preview.UserSessions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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<UserSessionInner> object if successful. + */ + public PagedList listByHostPool(final String resourceGroupName, final String hostPoolName) { + ServiceResponse> response = listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByHostPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified 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> listByHostPoolAsync(final String resourceGroupName, final String hostPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByHostPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserSessionInner> object + */ + public Observable> listByHostPoolAsync(final String resourceGroupName, final String hostPoolName) { + return listByHostPoolWithServiceResponseAsync(resourceGroupName, hostPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserSessionInner> object + */ + public Observable>> listByHostPoolWithServiceResponseAsync(final String resourceGroupName, final String hostPoolName) { + return listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName) + .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(listByHostPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserSessionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByHostPoolSinglePageAsync(final String resourceGroupName, final String hostPoolName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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 filter = null; + return service.listByHostPool(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByHostPoolDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @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<UserSessionInner> object if successful. + */ + public PagedList listByHostPool(final String resourceGroupName, final String hostPoolName, final String filter) { + ServiceResponse> response = listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByHostPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @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> listByHostPoolAsync(final String resourceGroupName, final String hostPoolName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByHostPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserSessionInner> object + */ + public Observable> listByHostPoolAsync(final String resourceGroupName, final String hostPoolName, final String filter) { + return listByHostPoolWithServiceResponseAsync(resourceGroupName, hostPoolName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserSessionInner> object + */ + public Observable>> listByHostPoolWithServiceResponseAsync(final String resourceGroupName, final String hostPoolName, final String filter) { + return listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter) + .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(listByHostPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List userSessions. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param hostPoolName The name of the host pool within the specified resource group + ServiceResponse> * @param filter OData filter expression. Valid properties for filtering are userprincipalname and sessionstate. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserSessionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByHostPoolSinglePageAsync(final String resourceGroupName, final String hostPoolName, final String filter) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName 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.listByHostPool(this.client.subscriptionId(), resourceGroupName, hostPoolName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByHostPoolDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByHostPoolDelegate(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 a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 UserSessionInner object if successful. + */ + public UserSessionInner get(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + return getWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).toBlocking().single().body(); + } + + /** + * Get a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 hostPoolName, String sessionHostName, String userSessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId), serviceCallback); + } + + /** + * Get a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserSessionInner object + */ + public Observable getAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + return getWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).map(new Func1, UserSessionInner>() { + @Override + public UserSessionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserSessionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName is required and cannot be null."); + } + if (userSessionId == null) { + throw new IllegalArgumentException("Parameter userSessionId 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, hostPoolName, sessionHostName, userSessionId, 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); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 hostPoolName, String sessionHostName, String userSessionId) { + deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).toBlocking().single().body(); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 hostPoolName, String sessionHostName, String userSessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId), serviceCallback); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + return deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName is required and cannot be null."); + } + if (userSessionId == null) { + throw new IllegalArgumentException("Parameter userSessionId 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 force = null; + return service.delete(this.client.subscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, this.client.apiVersion(), force, 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); + } + } + }); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param force Force flag to login off userSession. + * @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 hostPoolName, String sessionHostName, String userSessionId, Boolean force) { + deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, force).toBlocking().single().body(); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param force Force flag to login off userSession. + * @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 hostPoolName, String sessionHostName, String userSessionId, Boolean force, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, force), serviceCallback); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param force Force flag to login off userSession. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Boolean force) { + return deleteWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, force).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param force Force flag to login off userSession. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, Boolean force) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName is required and cannot be null."); + } + if (userSessionId == null) { + throw new IllegalArgumentException("Parameter userSessionId 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, hostPoolName, sessionHostName, userSessionId, this.client.apiVersion(), force, 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); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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<UserSessionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String hostPoolName, final String sessionHostName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @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 hostPoolName, final String sessionHostName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserSessionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String hostPoolName, final String sessionHostName) { + return listWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List userSessions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserSessionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String hostPoolName, final String sessionHostName) { + return listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostName) + .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 userSessions. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param hostPoolName The name of the host pool within the specified resource group + ServiceResponse> * @param sessionHostName The name of the session host within the specified host pool + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserSessionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String hostPoolName, final String sessionHostName) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName 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, hostPoolName, sessionHostName, 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); + } + + /** + * Disconnect a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 disconnect(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + disconnectWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).toBlocking().single().body(); + } + + /** + * Disconnect a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disconnectWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId), serviceCallback); + } + + /** + * Disconnect a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + return disconnectWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disconnect a userSession. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disconnectWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName is required and cannot be null."); + } + if (userSessionId == null) { + throw new IllegalArgumentException("Parameter userSessionId 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.disconnect(this.client.subscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disconnectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disconnectDelegate(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); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 sendMessageMethod(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + sendMessageMethodWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).toBlocking().single().body(); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @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 sendMessageMethodAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(sendMessageMethodWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId), serviceCallback); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable sendMessageMethodAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + return sendMessageMethodWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> sendMessageMethodWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName is required and cannot be null."); + } + if (userSessionId == null) { + throw new IllegalArgumentException("Parameter userSessionId 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 SendMessage sendMessage = null; + return service.sendMessageMethod(this.client.subscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, this.client.apiVersion(), sendMessage, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = sendMessageMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param sendMessage Object containing message includes title and message body + * @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 sendMessageMethod(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage) { + sendMessageMethodWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, sendMessage).toBlocking().single().body(); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param sendMessage Object containing message includes title and message body + * @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 sendMessageMethodAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(sendMessageMethodWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, sendMessage), serviceCallback); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param sendMessage Object containing message includes title and message body + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable sendMessageMethodAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage) { + return sendMessageMethodWithServiceResponseAsync(resourceGroupName, hostPoolName, sessionHostName, userSessionId, sendMessage).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a message to a user. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group + * @param sessionHostName The name of the session host within the specified host pool + * @param userSessionId The name of the user session within the specified session host + * @param sendMessage Object containing message includes title and message body + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> sendMessageMethodWithServiceResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostName, String userSessionId, SendMessage sendMessage) { + 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 (hostPoolName == null) { + throw new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."); + } + if (sessionHostName == null) { + throw new IllegalArgumentException("Parameter sessionHostName is required and cannot be null."); + } + if (userSessionId == null) { + throw new IllegalArgumentException("Parameter userSessionId 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(sendMessage); + return service.sendMessageMethod(this.client.subscriptionId(), resourceGroupName, hostPoolName, sessionHostName, userSessionId, this.client.apiVersion(), sendMessage, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = sendMessageMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse sendMessageMethodDelegate(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 userSessions. + * + * @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<UserSessionInner> object if successful. + */ + public PagedList listByHostPoolNext(final String nextPageLink) { + ServiceResponse> response = listByHostPoolNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByHostPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List userSessions. + * + * @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> listByHostPoolNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByHostPoolNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByHostPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List userSessions. + * + * @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<UserSessionInner> object + */ + public Observable> listByHostPoolNextAsync(final String nextPageLink) { + return listByHostPoolNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List userSessions. + * + * @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<UserSessionInner> object + */ + public Observable>> listByHostPoolNextWithServiceResponseAsync(final String nextPageLink) { + return listByHostPoolNextSinglePageAsync(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(listByHostPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List userSessions. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserSessionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByHostPoolNextSinglePageAsync(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.listByHostPoolNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByHostPoolNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByHostPoolNextDelegate(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 userSessions. + * + * @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<UserSessionInner> 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 userSessions. + * + * @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 userSessions. + * + * @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<UserSessionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List userSessions. + * + * @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<UserSessionInner> 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 userSessions. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserSessionInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceImpl.java new file mode 100644 index 0000000000000..57cbdb1a98fe1 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceImpl.java @@ -0,0 +1,113 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Workspace; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.WorkspacePatch; +import java.util.List; +import rx.functions.Func1; + +class WorkspaceImpl extends GroupableResourceCoreImpl implements Workspace, Workspace.Definition, Workspace.Update { + private WorkspacePatch updateParameter; + WorkspaceImpl(String name, WorkspaceInner inner, DesktopVirtualizationManager manager) { + super(name, inner, manager); + this.updateParameter = new WorkspacePatch(); + } + + @Override + public Observable createResourceAsync() { + WorkspacesInner client = this.manager().inner().workspaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public WorkspaceInner call(WorkspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkspacesInner client = this.manager().inner().workspaces(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public WorkspaceInner call(WorkspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkspacesInner client = this.manager().inner().workspaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new WorkspacePatch(); + } + + @Override + public List applicationGroupReferences() { + return this.inner().applicationGroupReferences(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public WorkspaceImpl withApplicationGroupReferences(List applicationGroupReferences) { + if (isInCreateMode()) { + this.inner().withApplicationGroupReferences(applicationGroupReferences); + } else { + this.updateParameter.withApplicationGroupReferences(applicationGroupReferences); + } + return this; + } + + @Override + public WorkspaceImpl withDescription(String description) { + if (isInCreateMode()) { + this.inner().withDescription(description); + } else { + this.updateParameter.withDescription(description); + } + return this; + } + + @Override + public WorkspaceImpl withFriendlyName(String friendlyName) { + if (isInCreateMode()) { + this.inner().withFriendlyName(friendlyName); + } else { + this.updateParameter.withFriendlyName(friendlyName); + } + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceInner.java new file mode 100644 index 0000000000000..9e34dcf5e6cfb --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspaceInner.java @@ -0,0 +1,99 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Represents a Workspace definition. + */ +@JsonFlatten +public class WorkspaceInner extends Resource { + /** + * Description of Workspace. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Friendly name of Workspace. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * List of applicationGroup resource Ids. + */ + @JsonProperty(value = "properties.applicationGroupReferences") + private List applicationGroupReferences; + + /** + * Get description of Workspace. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of Workspace. + * + * @param description the description value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get friendly name of Workspace. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of Workspace. + * + * @param friendlyName the friendlyName value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get list of applicationGroup resource Ids. + * + * @return the applicationGroupReferences value + */ + public List applicationGroupReferences() { + return this.applicationGroupReferences; + } + + /** + * Set list of applicationGroup resource Ids. + * + * @param applicationGroupReferences the applicationGroupReferences value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withApplicationGroupReferences(List applicationGroupReferences) { + this.applicationGroupReferences = applicationGroupReferences; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesImpl.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesImpl.java new file mode 100644 index 0000000000000..f2351d2b6759d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesImpl.java @@ -0,0 +1,138 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Workspaces; +import com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Workspace; +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; + +class WorkspacesImpl extends GroupableResourcesCoreImpl implements Workspaces { + protected WorkspacesImpl(DesktopVirtualizationManager manager) { + super(manager.inner().workspaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + WorkspacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + WorkspacesInner 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) { + WorkspacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + WorkspacesInner 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 Workspace call(WorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + WorkspacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + WorkspacesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Workspace call(WorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public WorkspaceImpl define(String name) { + return wrapModel(name); + } + + @Override + protected WorkspaceImpl wrapModel(WorkspaceInner inner) { + return new WorkspaceImpl(inner.name(), inner, manager()); + } + + @Override + protected WorkspaceImpl wrapModel(String name) { + return new WorkspaceImpl(name, new WorkspaceInner(), this.manager()); + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesInner.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesInner.java new file mode 100644 index 0000000000000..9cf1d0be52f9b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/WorkspacesInner.java @@ -0,0 +1,985 @@ +/** + * 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.desktopvirtualization.v2020_10_19_preview.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.desktopvirtualization.v2020_10_19_preview.WorkspacePatch; +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 Workspaces. + */ +public class WorkspacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private WorkspacesService service; + /** The service client containing this operation class. */ + private DesktopVirtualizationAPIClientImpl client; + + /** + * Initializes an instance of WorkspacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkspacesInner(Retrofit retrofit, DesktopVirtualizationAPIClientImpl client) { + this.service = retrofit.create(WorkspacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Workspaces to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkspacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.Workspaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.desktopvirtualization.v2020_10_19_preview.Workspaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Body WorkspaceInner workspace, @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.desktopvirtualization.v2020_10_19_preview.Workspaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.desktopvirtualization.v2020_10_19_preview.Workspaces update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Body WorkspacePatch workspace, @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.desktopvirtualization.v2020_10_19_preview.Workspaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.desktopvirtualization.v2020_10_19_preview.Workspaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @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.desktopvirtualization.v2020_10_19_preview.Workspaces listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.desktopvirtualization.v2020_10_19_preview.Workspaces listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @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 WorkspaceInner object if successful. + */ + public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Get a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @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 workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Get a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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, workspaceName, 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 update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @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 WorkspaceInner object if successful. + */ + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, workspace).toBlocking().single().body(); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @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 workspaceName, WorkspaceInner workspace, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, workspace), serviceCallback); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, workspace).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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 (workspace == null) { + throw new IllegalArgumentException("Parameter workspace is required and cannot be null."); + } + Validator.validate(workspace); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), workspace, 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); + } + + /** + * Remove a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @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 workspaceName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Remove a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @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 workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Remove a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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, workspaceName, 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); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @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 WorkspaceInner object if successful. + */ + public WorkspaceInner update(String resourceGroupName, String workspaceName) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @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 workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable updateAsync(String resourceGroupName, String workspaceName) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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 WorkspacePatch workspace = null; + return service.update(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), workspace, 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); + } + } + }); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @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 WorkspaceInner object if successful. + */ + public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch workspace) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, workspace).toBlocking().single().body(); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @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 workspaceName, WorkspacePatch workspace, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, workspaceName, workspace), serviceCallback); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable updateAsync(String resourceGroupName, String workspaceName, WorkspacePatch workspace) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, workspace).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param workspace Object containing Workspace definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspacePatch workspace) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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(workspace); + return service.update(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), workspace, 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 workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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<WorkspaceInner> 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 workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkspaceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkspaceInner> 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 workspaces. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkspaceInner> 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."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, 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); + } + + /** + * List workspaces in 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<WorkspaceInner> 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 workspaces in 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 workspaces in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkspaceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List workspaces in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkspaceInner> 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 workspaces in subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkspaceInner> 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."); + } + return service.list(this.client.subscriptionId(), 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 workspaces. + * + * @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<WorkspaceInner> 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 workspaces. + * + * @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 workspaces. + * + * @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<WorkspaceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List workspaces. + * + * @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<WorkspaceInner> 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 workspaces. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkspaceInner> 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); + } + + /** + * List workspaces in 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<WorkspaceInner> 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 workspaces in 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 workspaces in 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<WorkspaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List workspaces in 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<WorkspaceInner> 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 workspaces in 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<WorkspaceInner> 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/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/package-info.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/package-info.java new file mode 100644 index 0000000000000..2853d7c42f4af --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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 DesktopVirtualizationAPIClient. + */ +package com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview.implementation; diff --git a/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/package-info.java b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/package-info.java new file mode 100644 index 0000000000000..e2c46f08aa3bb --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2020_10_19_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2020_10_19_preview/package-info.java @@ -0,0 +1,10 @@ +// 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 DesktopVirtualizationAPIClient. + */ +package com.microsoft.azure.management.desktopvirtualization.v2020_10_19_preview;